diff options
| author | Oskar <oskar@mullvad.net> | 2024-11-05 07:57:08 +0100 |
|---|---|---|
| committer | Oskar <oskar@mullvad.net> | 2024-11-14 16:43:18 +0100 |
| commit | 84f14d79c4f0dde73337820ec94ba8ff928a3797 (patch) | |
| tree | ce468658e5ba7b0a74950c7ad1b09b3a4d00520b /gui/src/shared/gettext.ts | |
| parent | e3ce0eb5cd0610dbff6ec98cb8cb388415c74bf6 (diff) | |
| download | mullvadvpn-84f14d79c4f0dde73337820ec94ba8ff928a3797.tar.xz mullvadvpn-84f14d79c4f0dde73337820ec94ba8ff928a3797.zip | |
Move gui directory to desktop/packages/mullvad-vpn
Diffstat (limited to 'gui/src/shared/gettext.ts')
| -rw-r--r-- | gui/src/shared/gettext.ts | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/gui/src/shared/gettext.ts b/gui/src/shared/gettext.ts deleted file mode 100644 index 90391107e0..0000000000 --- a/gui/src/shared/gettext.ts +++ /dev/null @@ -1,32 +0,0 @@ -import Gettext from 'node-gettext'; - -import { LocalizationContexts } from './localization-contexts'; -import log from './logging'; - -const SOURCE_LANGUAGE = 'en'; - -function setErrorHandler(catalogue: Gettext) { - catalogue.on('error', (error) => { - log.debug(`Gettext error: ${error.message}`); - }); -} - -const gettextOptions = { sourceLocale: SOURCE_LANGUAGE }; - -declare class GettextWithAppContexts extends Gettext { - pgettext(msgctxt: LocalizationContexts, msgid: string): string; - npgettext( - msgctxt: LocalizationContexts, - msgid: string, - msgidPlural: string, - count: number, - ): string; -} - -export const messages = new Gettext(gettextOptions) as GettextWithAppContexts; -messages.setTextDomain('messages'); -setErrorHandler(messages); - -export const relayLocations = new Gettext(gettextOptions); -relayLocations.setTextDomain('relay-locations'); -setErrorHandler(relayLocations); |
