summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gui/src/shared/gettext.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/gui/src/shared/gettext.ts b/gui/src/shared/gettext.ts
index 07a560bdd8..c8cc97969c 100644
--- a/gui/src/shared/gettext.ts
+++ b/gui/src/shared/gettext.ts
@@ -35,10 +35,10 @@ export function loadTranslations(currentLocale: string, catalogue: Gettext) {
function parseTranslation(locale: string, domain: string, catalogue: Gettext): boolean {
const filename = path.join(LOCALES_DIR, locale, `${domain}.po`);
- let buffer: Buffer;
+ let contents: string;
try {
- buffer = fs.readFileSync(filename);
+ contents = fs.readFileSync(filename, { encoding: 'utf8' });
} catch (error) {
if (error.code !== 'ENOENT') {
log.error(`Cannot read the gettext file "${filename}": ${error.message}`);
@@ -48,7 +48,7 @@ function parseTranslation(locale: string, domain: string, catalogue: Gettext): b
let translations: object;
try {
- translations = po.parse(buffer);
+ translations = po.parse(contents);
} catch (error) {
log.error(`Cannot parse the gettext file "${filename}": ${error.message}`);
return false;