forked from metabrainz/musicbrainz-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprovidePluginConfig.js
61 lines (51 loc) · 1.98 KB
/
providePluginConfig.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* Copyright (C) 2019 MetaBrainz Foundation
*
* This file is part of MusicBrainz, the open internet music database,
* and is licensed under the GPL version 2, or (at your option) any
* later version: http://www.gnu.org/licenses/gpl-2.0.txt
*/
/* eslint-disable import/no-commonjs */
const path = require('path');
const {GETTEXT_DOMAINS} = require('./constants');
const commonPath = path.resolve(__dirname, '../root/static/scripts/common/');
const i18nPath = path.resolve(commonPath, 'i18n');
const addColonPath = path.resolve(i18nPath, 'addColon');
const hyphenateTitlePath = path.resolve(i18nPath, 'hyphenateTitle');
const expandPath = path.resolve(i18nPath, 'expand2react');
const expandTextPath = path.resolve(i18nPath, 'expand2text');
const hasOwnPropPath = path.resolve(commonPath, 'utility/hasOwnProp');
const nonEmptyPath = path.resolve(commonPath, 'utility/nonEmpty');
const hydratePath = path.resolve(__dirname, '../root/utility/hydrate');
const invariantPath = path.resolve(__dirname, '../root/utility/invariant');
module.exports = {
'addColon': [addColonPath, 'default'],
'addColonText': [addColonPath, 'addColonText'],
'hasOwnProp': [hasOwnPropPath, 'default'],
'hyphenateTitle': [hyphenateTitlePath, 'default'],
'hydrate': [hydratePath, 'default'],
'invariant': [invariantPath, 'default'],
'nonEmpty': [nonEmptyPath, 'default'],
'l': [i18nPath, 'l'],
'ln': [i18nPath, 'ln'],
'lp': [i18nPath, 'lp'],
'N_l': [i18nPath, 'N_l'],
'N_ln': [i18nPath, 'N_ln'],
'N_lp': [i18nPath, 'N_lp'],
'exp.l': [expandPath, 'l'],
'exp.ln': [expandPath, 'ln'],
'exp.lp': [expandPath, 'lp'],
'texp.l': [expandTextPath, 'l'],
'texp.ln': [expandTextPath, 'ln'],
'texp.lp': [expandTextPath, 'lp'],
};
GETTEXT_DOMAINS.forEach(domain => {
if (domain === 'mb_server') {
return;
}
const domainPath = path.resolve(i18nPath, domain);
['l', 'ln', 'lp'].forEach(func => {
const domainFunc = func + '_' + domain;
module.exports[domainFunc] = [domainPath, domainFunc];
});
});