@configuratorware/configurator-frontendgui 1.42.1 → 1.42.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,32 +15,33 @@ function initLanguage(_x) {
15
15
  }
16
16
  function _initLanguage() {
17
17
  _initLanguage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(lang) {
18
- var fileKey, langKey, results;
18
+ var fileKey, langKey, cachedTranslationsDomain, results;
19
19
  return _regeneratorRuntime().wrap(function _callee$(_context) {
20
20
  while (1) switch (_context.prev = _context.next) {
21
21
  case 0:
22
22
  // ensure that the filename always has an underscore and no dash
23
23
  fileKey = lang.replace('-', '_');
24
24
  langKey = lang.substring(0, 2);
25
+ cachedTranslationsDomain = 'messages.';
25
26
  if (!(0, _configuration.isProduction)()) {
26
- _context.next = 8;
27
+ _context.next = 9;
27
28
  break;
28
29
  }
29
- _context.next = 5;
30
- return Promise.all([loadLanguageJson('/translations_cached/' + fileKey + '.json', langKey)]);
31
- case 5:
30
+ _context.next = 6;
31
+ return Promise.all([loadLanguageJson('/translations_cached/' + cachedTranslationsDomain + fileKey + '.json', langKey)]);
32
+ case 6:
32
33
  _context.t0 = _context.sent;
33
- _context.next = 11;
34
+ _context.next = 12;
34
35
  break;
35
- case 8:
36
- _context.next = 10;
36
+ case 9:
37
+ _context.next = 11;
37
38
  return Promise.all([loadLanguageJson('/translations/' + fileKey + '.json', langKey), loadLanguageJson('/translations_custom/' + fileKey + '.json', langKey)]);
38
- case 10:
39
- _context.t0 = _context.sent;
40
39
  case 11:
40
+ _context.t0 = _context.sent;
41
+ case 12:
41
42
  results = _context.t0;
42
43
  results.forEach(_i18n.use);
43
- case 13:
44
+ case 14:
44
45
  case "end":
45
46
  return _context.stop();
46
47
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@configuratorware/configurator-frontendgui",
3
- "version": "1.42.1",
3
+ "version": "1.42.3",
4
4
  "license": "UNLICENSED",
5
5
  "private": false,
6
6
  "main": "./index.js",
7
7
  "dependencies": {
8
8
  "@babel/polyfill": "^7.12.1",
9
- "@configuratorware/scripts": "1.42.1",
9
+ "@configuratorware/scripts": "1.42.3",
10
10
  "@material-ui/core": "^4.12.4",
11
11
  "@material-ui/icons": "^4.11.3",
12
12
  "@material-ui/lab": "^4.0.0-alpha.61",
@@ -36,8 +36,8 @@
36
36
  "react-router-dom": "^5.3.4",
37
37
  "react-swipeable": "^5.5.1",
38
38
  "react-zoom-pan-pinch": "^2.1.3",
39
- "redhotmagma-graphics-editor": "1.42.1",
40
- "redhotmagma-visualization": "1.42.1",
39
+ "redhotmagma-graphics-editor": "1.42.3",
40
+ "redhotmagma-visualization": "1.42.3",
41
41
  "redux": "^4.1.0",
42
42
  "redux-logger": "^3.0.6",
43
43
  "redux-persist": "^5.10.0",
@@ -38,8 +38,11 @@ function getConfig(mode, dirname) {
38
38
  const commonRules = [
39
39
  {
40
40
  test: /\.[jt]sx?$/,
41
- use: 'babel-loader',
41
+ loader: 'babel-loader',
42
42
  include: [path.resolve('src')],
43
+ options: {
44
+ envName: mode === 'dev' ? 'development' : 'production',
45
+ },
43
46
  },
44
47
  {
45
48
  test: /\.(png|jpg|gif)$/,
@@ -4,9 +4,15 @@ export async function initLanguage(lang) {
4
4
  // ensure that the filename always has an underscore and no dash
5
5
  const fileKey = lang.replace('-', '_');
6
6
  const langKey = lang.substring(0, 2);
7
+ const cachedTranslationsDomain = 'messages.';
7
8
 
8
9
  const results = isProduction()
9
- ? await Promise.all([loadLanguageJson('/translations_cached/' + fileKey + '.json', langKey)])
10
+ ? await Promise.all([
11
+ loadLanguageJson(
12
+ '/translations_cached/' + cachedTranslationsDomain + fileKey + '.json',
13
+ langKey
14
+ ),
15
+ ])
10
16
  : await Promise.all([
11
17
  loadLanguageJson('/translations/' + fileKey + '.json', langKey),
12
18
  loadLanguageJson('/translations_custom/' + fileKey + '.json', langKey),