forked from locize/locize-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
formats.js
31 lines (28 loc) · 857 Bytes
/
formats.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const fileExtensionsMap = {
'.json': ['json', 'flat'],
'.po': ['po', 'gettext', 'po_i18next', 'gettext_i18next'],
'.xml': ['android'],
'.strings': ['strings'],
'.csv': ['csv'],
'.resx': ['resx'],
'.yaml': ['yaml', 'yaml-rails', 'yaml-nested'],
'.xlsx': ['xlsx'],
'.xliff': ['xliff2', 'xliff12'],
'.xlf': ['xlf2', 'xlf12'],
'.ftl': ['fluent'],
'.tmx': ['tmx'],
'.php': ['laravel'],
'.properties': ['properties']
};
const acceptedFileExtensions = Object.keys(fileExtensionsMap);
const reversedFileExtensionsMap = {};
acceptedFileExtensions.forEach((ext) => {
fileExtensionsMap[ext].forEach((format) => {
reversedFileExtensionsMap[format] = ext;
});
});
module.exports = {
fileExtensionsMap: fileExtensionsMap,
acceptedFileExtensions: acceptedFileExtensions,
reversedFileExtensionsMap: reversedFileExtensionsMap
};