summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gui/package-lock.json12
-rw-r--r--gui/package.json4
-rw-r--r--gui/src/shared/gettext.ts21
3 files changed, 12 insertions, 25 deletions
diff --git a/gui/package-lock.json b/gui/package-lock.json
index e3160cf716..3a31490963 100644
--- a/gui/package-lock.json
+++ b/gui/package-lock.json
@@ -352,9 +352,9 @@
"dev": true
},
"@types/node-gettext": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/@types/node-gettext/-/node-gettext-2.0.1.tgz",
- "integrity": "sha512-5UCSuDsP7zBwQtBPoJ9Ni0T96+Fuxus7/cF39ZoP319aj7kdsvFR5Zhu5P1IpA3X8PEvED/e8OnFOlFigqfg5A==",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@types/node-gettext/-/node-gettext-3.0.0.tgz",
+ "integrity": "sha512-rLLEKuX6Y+JZgIvny7+O+3GzbqEaWVlRQWe3yRqNi+tprQ/TdHXps7W+xi6Mgts6xDAgCSobX9A+7QwZEkLPAg==",
"dev": true
},
"@types/parse5": {
@@ -7391,9 +7391,9 @@
}
},
"node-gettext": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/node-gettext/-/node-gettext-2.0.0.tgz",
- "integrity": "sha1-8dwSN83FRvUVk9o0AwS4vrpbhSU=",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/node-gettext/-/node-gettext-3.0.0.tgz",
+ "integrity": "sha512-/VRYibXmVoN6tnSAY2JWhNRhWYJ8Cd844jrZU/DwLVoI4vBI6ceYbd8i42sYZ9uOgDH3S7vslIKOWV/ZrT2YBA==",
"requires": {
"lodash.get": "^4.4.2"
}
diff --git a/gui/package.json b/gui/package.json
index 6509501a8d..53c95bb37f 100644
--- a/gui/package.json
+++ b/gui/package.json
@@ -20,7 +20,7 @@
"jsonrpc-lite": "^2.0.7",
"mkdirp": "^1.0.3",
"moment": "^2.24.0",
- "node-gettext": "^2.0.0",
+ "node-gettext": "^3.0.0",
"rbush": "^2.0.2",
"react": "^16.5.0",
"react-dom": "^16.5.0",
@@ -47,7 +47,7 @@
"@types/mkdirp": "^1.0.0",
"@types/mocha": "^5.2.6",
"@types/node": "^10.12.3",
- "@types/node-gettext": "^2.0.0",
+ "@types/node-gettext": "^3.0.0",
"@types/rbush": "^2.0.2",
"@types/react": "^16.8.8",
"@types/react-dom": "^16.8.2",
diff --git a/gui/src/shared/gettext.ts b/gui/src/shared/gettext.ts
index 5f33190109..ee8e8bf8d0 100644
--- a/gui/src/shared/gettext.ts
+++ b/gui/src/shared/gettext.ts
@@ -67,29 +67,16 @@ function parseTranslation(locale: string, domain: string, catalogue: Gettext): b
function setErrorHandler(catalogue: Gettext) {
catalogue.on('error', (error) => {
- // NOTE: locale is not publicly exposed
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const catalogueLocale = (catalogue as any).locale;
-
- // Filter out the "no translation was found" errors for the source language.
- // The catalogue's locale is set to an empty string when using the source translation.
- if (
- (catalogueLocale === '' || catalogueLocale === SOURCE_LANGUAGE) &&
- error.indexOf('No translation was found') !== -1
- ) {
- return;
- }
-
log.warn(`Gettext error: ${error}`);
});
}
-// `{debug: false}` option prevents Gettext from printing the warnings to console in development
-// the errors are handled separately in the "error" handler below
-export const messages = new Gettext({ debug: false });
+const gettextOptions = { sourceLocale: SOURCE_LANGUAGE };
+
+export const messages = new Gettext(gettextOptions);
messages.setTextDomain('messages');
setErrorHandler(messages);
-export const relayLocations = new Gettext({ debug: false });
+export const relayLocations = new Gettext(gettextOptions);
relayLocations.setTextDomain('relay-locations');
setErrorHandler(relayLocations);