Fix language bundle loading.

This commit is contained in:
Paulo Gustavo Veiga 2020-11-28 22:49:57 -08:00
parent 4cf2ee9b17
commit facf54b804
3 changed files with 3 additions and 6 deletions

View File

@ -1 +1 @@
[{"/Users/pveiga/repos/wisemapping-react/src/Footer.js":"1","/Users/pveiga/repos/wisemapping-react/src/Header.js":"2","/Users/pveiga/repos/wisemapping-react/src/index.js":"3","/Users/pveiga/repos/wisemapping-react/src/LoginPage.js":"4"},{"size":1747,"mtime":1606529689598,"results":"5","hashOfConfig":"6"},{"size":1557,"mtime":1606529996629,"results":"7","hashOfConfig":"6"},{"size":702,"mtime":1606586450512,"results":"8","hashOfConfig":"6"},{"size":4283,"mtime":1606584003214,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1xegajf",{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"14","messages":"15","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"16","messages":"17","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"/Users/pveiga/repos/wisemapping-react/src/Footer.js",[],"/Users/pveiga/repos/wisemapping-react/src/Header.js",[],"/Users/pveiga/repos/wisemapping-react/src/index.js",[],"/Users/pveiga/repos/wisemapping-react/src/LoginPage.js",["18"],{"ruleId":"19","severity":1,"message":"20","line":7,"column":7,"nodeType":"21","messageId":"22","endLine":7,"endColumn":26},"no-unused-vars","'ConfigStatusMessage' is defined but never used.","Identifier","unusedVar"]
[{"/Users/pveiga/repos/wisemapping-react/src/Footer.js":"1","/Users/pveiga/repos/wisemapping-react/src/Header.js":"2","/Users/pveiga/repos/wisemapping-react/src/index.js":"3","/Users/pveiga/repos/wisemapping-react/src/LoginPage.js":"4"},{"size":1747,"mtime":1606529689598,"results":"5","hashOfConfig":"6"},{"size":1557,"mtime":1606529996629,"results":"7","hashOfConfig":"6"},{"size":695,"mtime":1606632469498,"results":"8","hashOfConfig":"6"},{"size":4283,"mtime":1606584003214,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1xegajf",{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"14","messages":"15","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"16","messages":"17","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"/Users/pveiga/repos/wisemapping-react/src/Footer.js",[],"/Users/pveiga/repos/wisemapping-react/src/Header.js",[],"/Users/pveiga/repos/wisemapping-react/src/index.js",["18"],"/Users/pveiga/repos/wisemapping-react/src/LoginPage.js",["19"],{"ruleId":"20","severity":1,"message":"21","line":8,"column":9,"nodeType":"22","messageId":"23","endLine":8,"endColumn":17},{"ruleId":"20","severity":1,"message":"24","line":7,"column":7,"nodeType":"22","messageId":"23","endLine":7,"endColumn":26},"no-unused-vars","'language' is assigned a value but never used.","Identifier","unusedVar","'ConfigStatusMessage' is defined but never used."]

View File

@ -1,7 +1,6 @@
{
"name": "wisemapping-react",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.6",
"@testing-library/react": "^11.2.2",

View File

@ -5,6 +5,7 @@ import ReactDOM from 'react-dom';
import LoginPage from './LoginPage.js';
function loadLocaleData(locale) {
const language = locale.split('-')[1];
switch (locale) {
case 'es':
return import('./compiled-lang/es.json')
@ -17,10 +18,7 @@ async function bootstrapApplication() {
const locale = window.navigator.language;
console.log("Browser Locale:" + window.navigator.language)
const messages = loadLocaleData(locale);
console.log("loadLocaleData:" + toString(messages))
const messages = (await loadLocaleData(locale));
ReactDOM.render(
<LoginPage locale={locale} messages={messages} />
,