File tree Expand file tree Collapse file tree 4 files changed +8
-43
lines changed Expand file tree Collapse file tree 4 files changed +8
-43
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " workshop_butler_widget" ,
3
- "version" : " 1.17 .0" ,
3
+ "version" : " 1.18 .0" ,
4
4
"description" : " Workshop Butler JS Widgets" ,
5
5
"author" : " https://workshopbutler.com" ,
6
6
"license" : " ISC" ,
65
65
"test" : " mocha --require ./ignoreImports.ts --require ts-node/register 'test/**/*.ts' '**/*.test.ts'" ,
66
66
"watch:webpack" : " NODE_ENV=watch webpack-dev-server --mode development" ,
67
67
"watch:eleventy" : " eleventy --watch" ,
68
- "fast-build" : " NODE_ENV=build webpack --mode production" ,
69
- "build" : " for lang in en de es fr nl no pt \n do \n LANG=$lang NODE_ENV=build webpack --mode production \n done" ,
68
+ "build" : " NODE_ENV=build webpack --mode production" ,
70
69
"build-wordpress" : " NODE_ENV=build-wordpress webpack --mode production" ,
71
70
"check-css-style" : " stylelint \" src/styles/**/*.less\" " ,
72
71
"fix-css-style" : " stylelint \" src/styles/**/*.less\" --fix" ,
Original file line number Diff line number Diff line change 1
1
import i18next from 'i18next' ;
2
2
import IPlainObject from '../interfaces/IPlainObject' ;
3
3
import * as resources from '../locales' ;
4
-
5
- declare const WIDGET_LANGUAGE : string ;
6
-
7
4
/**
8
5
* Controls the translation of message tokens to actual strings
9
6
*/
@@ -17,16 +14,16 @@ export default class Localisation {
17
14
* @param userDict {IPlainObject} User dictionary to replace some default values
18
15
*/
19
16
constructor ( locale : string , language : string , userDict : IPlainObject ) {
20
- const dict = ( resources as any ) [ WIDGET_LANGUAGE ] ;
17
+ const dict = ( resources as any ) [ language ] ;
21
18
const skinnyResource : IPlainObject = { } ;
22
- skinnyResource [ WIDGET_LANGUAGE ] = {
23
- translation : userDict [ WIDGET_LANGUAGE ] ? this . deepCopy ( dict , userDict [ WIDGET_LANGUAGE ] ) : dict ,
19
+ skinnyResource [ language ] = {
20
+ translation : userDict [ language ] ? this . deepCopy ( dict , userDict [ language ] ) : dict ,
24
21
} ;
25
22
this . locale = locale ;
26
23
i18next . init ( {
27
24
debug : false ,
28
- fallbackLng : WIDGET_LANGUAGE ,
29
- lng : WIDGET_LANGUAGE ,
25
+ fallbackLng : language ,
26
+ lng : language ,
30
27
resources : skinnyResource ,
31
28
} ) ;
32
29
}
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ const options = {
14
14
apiKey : process . env . API_KEY ,
15
15
theme : 'alfred' ,
16
16
apiVersion : '2021-09-26' ,
17
- lang : process . env . LANG ? process . env . LANG : 'en' ,
18
17
} ;
19
18
20
19
let webpackConfig = {
@@ -31,7 +30,7 @@ let webpackConfig = {
31
30
} ,
32
31
output : {
33
32
path : path . resolve ( __dirname , isDev ? 'site/static/' : `dist/` ) ,
34
- filename : isDev ? `[name].js` : `[name].${ getVersion ( ) } .${ options . lang } . js` ,
33
+ filename : isDev ? `[name].js` : `[name].${ getVersion ( ) } .js` ,
35
34
sourceMapFilename : isDev ? `[name].js.map` : `[name].${ getVersion ( ) } .js.map`
36
35
} ,
37
36
externals : {
@@ -112,7 +111,6 @@ function getPlugins() {
112
111
BACKEND_URL : JSON . stringify ( options . backend ) ,
113
112
API_VERSION : JSON . stringify ( options . apiVersion ) ,
114
113
WIDGET_VERSION : JSON . stringify ( getVersion ( ) ) ,
115
- WIDGET_LANGUAGE : JSON . stringify ( options . lang ) ,
116
114
} ) ,
117
115
new MiniCssExtractPlugin ( {
118
116
filename : isDev ? `[name].css` : `[name].${ getVersion ( ) } .min.css`
You can’t perform that action at this time.
0 commit comments