@gtkx/i18n 2.0.0-beta.11 → 2.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js.map +1 -1
- package/dist/i18n.js +1 -1
- package/dist/i18n.js.map +1 -1
- package/dist/locale.d.ts.map +1 -1
- package/dist/locale.js +18 -3
- package/dist/locale.js.map +1 -1
- package/package.json +12 -20
- package/src/backend.ts +1 -6
- package/src/i18n.ts +4 -22
- package/src/locale.ts +26 -9
- package/src/virtual-config.d.ts +2 -1
package/README.md
CHANGED
|
@@ -4,14 +4,14 @@ Gettext localization for GTKX through react-i18next.
|
|
|
4
4
|
|
|
5
5
|
Translate React content with `useTranslation` and `Trans`. The CLI extracts messages and compiles gettext catalogs; application bootstrap loads the catalog for the current locale.
|
|
6
6
|
|
|
7
|
-
In an existing GTKX
|
|
7
|
+
In an existing GTKX app:
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
npm install @gtkx/i18n@
|
|
10
|
+
npm install @gtkx/i18n@2
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
[Guide](https://gtkx.dev/v2/guide/internationalization) · [API reference](https://gtkx.dev/v2/reference/@gtkx/i18n/) · [GTKX](https://gtkx.dev)
|
|
14
14
|
|
|
15
|
-
GTKX
|
|
15
|
+
GTKX requires Linux, Node.js, and the [native prerequisites](https://gtkx.dev/v2/guide/getting-started).
|
|
16
16
|
|
|
17
17
|
[MPL-2.0](https://github.com/gtkx-org/gtkx/blob/main/LICENSE).
|
package/dist/backend.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C,KAAK,cAAc,GAAG;IAClB,OAAO,CAAC,KAAK,EAAE,M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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AASpD,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAClC,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AAExD,MAAM,cAAc,GAAmB;IACnC,OAAO,CAAC,KAAK;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;IACD,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK;QAC9B,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;IACpF,CAAC;IACD,QAAQ,CAAC,OAAO,EAAE,KAAK;QACnB,MAAM,UAAU,GAAG,eAAe,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACnD,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;QAE5D,OAAO,UAAU,KAAK,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC;IAC9D,CAAC;IACD,SAAS,CAAC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK;QACxC,MAAM,kBAAkB,GAAG,eAAe,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC3D,MAAM,gBAAgB,GAAG,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAE/D,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,q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SAAS,EAAE,UAAU,EAAE,QAAQ;QAChC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,oBAAoB,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC;IAC/D,CAAC;CACJ,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,KAAa,EAAU,EAAE;IAC7C,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,UAAU,CAAC,mDAAmD,CAAC,CAAC;IAC9E,CAAC;IAED,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,OAAe,EAAE,KAAa,EAAU,EAAE,CAAC,GAAG,OAAO,GAAG,iBAAiB,GAAG,KAAK,EAAE,CAAC;AAC7G,MAAM,gBAAgB,GAAG,CAAC,KAAc,EAA2B,EAAE,CAAC,KAAK,KAAK,cAAc,CAAC;AAE/F,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,gBAAgB,EAAuB,CAAC","sourcesContent":["import type { BackendModule } from \"i18next\";\nimport * as GLib from \"@gtkx/gi/glib\";\nimport { applicationId } from \"virtual:gtkx-config\";\n\ntype GettextCatalog = {\n gettext(msgid: string): string;\n ngettext(msgid: string, msgidPlural: string, count: number): string;\n npgettext(context: string, msgid: string, msgidPlural: string, count: number): string | undefined;\n pgettext(context: string, msgid: string): string | undefined;\n};\n\nconst CONTEXT_SEPARATOR = \"\\u{4}\";\nconst GETTEXT_RESOURCE_KEY = \"__gtkx_gettext_catalog__\";\n\nconst gettextCatalog: GettextCatalog = {\n gettext(msgid) {\n return GLib.dgettext(applicationId, msgid);\n },\n ngettext(msgid, msgidPlural, count) {\n return GLib.dngettext(applicationId, msgid, msgidPlural, normalizeCount(count));\n },\n pgettext(context, msgid) {\n const contextual = contextualMsgid(context, msgid);\n const translated = GLib.dgettext(applicationId, contextual);\n\n return translated === contextual ? undefined : translated;\n },\n npgettext(context, msgid, msgidPlural, count) {\n const contextualSingular = contextualMsgid(context, msgid);\n const contextualPlural = contextualMsgid(context, msgidPlural);\n\n const translated = GLib.dngettext(applicationId, contextualSingular, contextualPlural, normalizeCount(count));\n\n return translated === contextualSingular || translated === contextualPlural ? undefined : translated;\n },\n};\n\nconst gettextBackend: BackendModule = {\n type: \"backend\",\n init() {\n return;\n },\n read(_language, _namespace, callback) {\n callback(null, { [GETTEXT_RESOURCE_KEY]: gettextCatalog });\n },\n};\n\nconst normalizeCount = (count: number): bigint => {\n if (!Number.isSafeInteger(count) || count < 0) {\n throw new RangeError(\"gettext counts must be non-negative safe integers\");\n }\n\n return BigInt(count);\n};\n\nconst contextualMsgid = (context: string, msgid: string): string => `${context}${CONTEXT_SEPARATOR}${msgid}`;\nconst isGettextCatalog = (value: unknown): value is GettextCatalog => value === gettextCatalog;\n\nexport { GETTEXT_RESOURCE_KEY, gettextBackend, isGettextCatalog, type GettextCatalog };\n"]}
|
package/dist/i18n.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import i18next from "i18next";
|
|
2
2
|
import { initReactI18next } from "react-i18next";
|
|
3
|
-
import { GETTEXT_RESOURCE_KEY, gettextBackend, isGettextCatalog
|
|
3
|
+
import { GETTEXT_RESOURCE_KEY, gettextBackend, isGettextCatalog } from "./backend.js";
|
|
4
4
|
import { locale } from "./locale.js";
|
|
5
5
|
const gettextFormat = {
|
|
6
6
|
type: "i18nFormat",
|
package/dist/i18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAA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AAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,iBAAiB,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAErE,KAAK,OAAO,CAAC,IAAI,CAAC;IACd,SAAS,EAAE,aAAa;IACxB,WAAW,EAAE,KAAK;IAClB,SAAS,EAAE,KAAK;IAChB,aAAa,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;IACrC,gBAAgB,EAAE,OAAO;IACzB,YAAY,EAAE,GAAG;IACjB,GAAG,EAAE,MAAM;IACX,EAAE,EAAE,CAAC,aAAa,CAAC;IACnB,WAAW,EAAE,KAAK;CACrB,CAAC,CAAC","sourcesContent":["import type { I18nFormatModule, TOptions } from \"i18next\";\nimport i18next from \"i18next\";\nimport { initReactI18next } from \"react-i18next\";\nimport { GETTEXT_RESOURCE_KEY, gettextBackend, type GettextCatalog, isGettextCatalog } from \"./backend.js\";\nimport { locale } from \"./locale.js\";\n\ntype GettextFormat = I18nFormatModule & {\n addLookupKeys(): void;\n getResource(language: string, namespace: string, msgid: string, options: TOptions): string | undefined;\n handleAsObject: boolean;\n};\n\ntype PluralLookup = {\n catalog: GettextCatalog;\n context: string | undefined;\n count: number;\n msgid: string;\n msgidPlural: string;\n};\n\nconst gettextFormat: GettextFormat = {\n type: \"i18nFormat\",\n handleAsObject: false,\n addLookupKeys() {\n return;\n },\n getResource(language, namespace, msgid, options) {\n const resource: unknown = i18next.getResource(language, namespace, GETTEXT_RESOURCE_KEY, {\n keySeparator: false,\n });\n\n if (!isGettextCatalog(resource)) {\n return;\n }\n\n return pointLookup(resource, msgid, options);\n },\n};\n\nconst getContext = (value: unknown): string | undefined => {\n if (typeof value !== \"string\" && typeof value !== \"number\") {\n return undefined;\n }\n\n const context = String(value);\n\n return context.length === 0 ? undefined : context;\n};\n\nconst pluralLookup = ({ catalog, context, count, msgid, msgidPlural }: PluralLookup): string => {\n if (context === undefined) {\n return catalog.ngettext(msgid, msgidPlural, count);\n }\n\n return catalog.npgettext(context, msgid, msgidPlural, count) ?? catalog.ngettext(msgid, msgidPlural, count);\n};\n\nconst stringOption = (options: TOptions, key: string): string | undefined => {\n const value = options[key];\n\n return typeof value === \"string\" ? value : undefined;\n};\n\nconst assertSupportedPluralOptions = (options: TOptions): void => {\n if (options.ordinal === true || stringOption(options, \"defaultValue_zero\") !== undefined) {\n throw new RangeError(\"GNU gettext does not support ordinal or zero-specific plural forms\");\n }\n};\n\nconst pluralSources = (msgid: string, options: TOptions): { plural: string; singular: string } => {\n assertSupportedPluralOptions(options);\n const defaultValue = stringOption(options, \"defaultValue\");\n const defaultValueOne = stringOption(options, \"defaultValue_one\");\n const defaultValueOther = stringOption(options, \"defaultValue_other\");\n const hasPluralDefaults = defaultValueOne !== undefined || defaultValueOther !== undefined;\n\n if (!hasPluralDefaults) {\n return { plural: defaultValue ?? msgid, singular: msgid };\n }\n\n return {\n plural: defaultValueOther ?? defaultValue ?? msgid,\n singular: defaultValueOne ?? defaultValue ?? msgid,\n };\n};\n\nconst pluralPointLookup = (catalog: GettextCatalog, msgid: string, options: TOptions, count: number): string => {\n const { plural, singular } = pluralSources(msgid, options);\n\n return pluralLookup({\n catalog,\n context: getContext(options.context),\n count,\n msgid: singular,\n msgidPlural: plural,\n });\n};\n\nconst contextualLookup = (catalog: GettextCatalog, source: string, context: string | undefined): string => {\n if (context === undefined) {\n return catalog.gettext(source);\n }\n\n return catalog.pgettext(context, source) ?? catalog.gettext(source);\n};\n\nconst singularPointLookup = (catalog: GettextCatalog, msgid: string, options: TOptions): string | undefined => {\n const source = stringOption(options, \"defaultValue\") ?? msgid;\n const translated = contextualLookup(catalog, source, getContext(options.context));\n\n return translated === source ? undefined : translated;\n};\n\nconst pointLookup = (catalog: GettextCatalog, msgid: string, options: TOptions): string | undefined => {\n if (options.count !== undefined) {\n return pluralPointLookup(catalog, msgid, options, options.count);\n }\n\n return singularPointLookup(catalog, msgid, options);\n};\n\ni18next.use(gettextBackend).use(gettextFormat).use(initReactI18next);\n\nvoid i18next.init({\n defaultNS: \"translation\",\n fallbackLng: false,\n initAsync: false,\n interpolation: { escapeValue: false },\n contextSeparator: \"\\u{4}\",\n keySeparator: \".\",\n lng: locale,\n ns: [\"translation\"],\n nsSeparator: false,\n});\n"]}
|
package/dist/locale.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../src/locale.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../src/locale.ts"],"names":[],"mappings":"AAcA,QAAA,MAAM,MAAM,EAAE,MAA2B,CAAC;AAyC1C,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/locale.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { t } from "@gtkx/runtime";
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
3
|
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { applicationId } from "virtual:gtkx-config";
|
|
4
|
+
import { applicationId, localeDir } from "virtual:gtkx-config";
|
|
4
5
|
const LIBC = "libc.so.6";
|
|
5
6
|
const LC_ALL = 6;
|
|
6
7
|
const GETTEXT_CODESET = ["UTF", "8"].join("-");
|
|
@@ -16,12 +17,26 @@ function requireStringResult(result) {
|
|
|
16
17
|
return result;
|
|
17
18
|
}
|
|
18
19
|
function initializeLocale() {
|
|
19
|
-
const
|
|
20
|
+
const directory = localeDir ?? bundledLocaleDir();
|
|
20
21
|
requireStringResult(setLocaleBinding(LC_ALL, ""));
|
|
21
|
-
requireStringResult(bindTextDomainBinding(applicationId,
|
|
22
|
+
requireStringResult(bindTextDomainBinding(applicationId, directory));
|
|
22
23
|
requireStringResult(bindTextDomainCodesetBinding(applicationId, GETTEXT_CODESET));
|
|
23
24
|
requireStringResult(textDomainBinding(applicationId));
|
|
24
25
|
return new Intl.NumberFormat().resolvedOptions().locale;
|
|
25
26
|
}
|
|
27
|
+
function bundledLocaleDir() {
|
|
28
|
+
const configUrl = new URL("gtkx-i18n.json", import.meta.url);
|
|
29
|
+
if (!existsSync(configUrl)) {
|
|
30
|
+
return fileURLToPath(new URL("locale", configUrl));
|
|
31
|
+
}
|
|
32
|
+
const config = JSON.parse(readFileSync(configUrl, "utf8"));
|
|
33
|
+
if (typeof config !== "object" ||
|
|
34
|
+
config === null ||
|
|
35
|
+
!("localeDir" in config) ||
|
|
36
|
+
typeof config.localeDir !== "string") {
|
|
37
|
+
throw new TypeError("Invalid GTKX locale configuration");
|
|
38
|
+
}
|
|
39
|
+
return fileURLToPath(new URL(config.localeDir, configUrl));
|
|
40
|
+
}
|
|
26
41
|
export { locale };
|
|
27
42
|
//# sourceMappingURL=locale.js.map
|
package/dist/locale.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../src/locale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../src/locale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAA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CAAC,CAAC;IAClD,mBAAmB,CAAC,qBAAqB,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC;IACrE,mBAAmB,CAAC,4BAA4B,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC;IAClF,mBAAmB,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC;IAEtD,OAAO,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC,eAAe,EAAE,CAAC,MAAM,CAAC;AAC5D,CAAC;AAED,SAAS,gBAAgB;IACrB,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,gBAAgB,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;IAE7D,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QACzB,OAAO,aAAa,CAAC,IAAI,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IAEpE,IACI,OAAO,MAAM,KAAK,QAAQ;QAC1B,MAAM,KAAK,IAAI;QACf,CAAC,CAAC,WAAW,IAAI,MAAM,CAAC;QACxB,OAAO,MAAM,CAAC,SAAS,KAAK,QAAQ,EACtC,CAAC;QACC,MAAM,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,aAAa,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC","sourcesContent":["import { t } from \"@gtkx/runtime\";\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\nimport { applicationId, localeDir } from \"virtual:gtkx-config\";\n\nconst LIBC = \"libc.so.6\";\nconst LC_ALL = 6;\nconst GETTEXT_CODESET = [\"UTF\", \"8\"].join(\"-\");\nconst setLocaleBinding = t.bind(LIBC, \"setlocale\", [t.int32, t.string()], t.string());\nconst bindTextDomainBinding = t.bind(LIBC, \"bindtextdomain\", [t.string(), t.string()], t.string());\n\nconst bindTextDomainCodesetBinding = t.bind(LIBC, \"bind_textdomain_codeset\", [t.string(), t.string()], t.string());\n\nconst textDomainBinding = t.bind(LIBC, \"textdomain\", [t.string()], t.string());\nconst locale: string = initializeLocale();\n\nfunction requireStringResult(result: unknown): string {\n if (typeof result !== \"string\") {\n throw new TypeError(\"Unable to initialize the process locale\");\n }\n\n return result;\n}\n\nfunction initializeLocale(): string {\n const directory = localeDir ?? bundledLocaleDir();\n requireStringResult(setLocaleBinding(LC_ALL, \"\"));\n requireStringResult(bindTextDomainBinding(applicationId, directory));\n requireStringResult(bindTextDomainCodesetBinding(applicationId, GETTEXT_CODESET));\n requireStringResult(textDomainBinding(applicationId));\n\n return new Intl.NumberFormat().resolvedOptions().locale;\n}\n\nfunction bundledLocaleDir(): string {\n const configUrl = new URL(\"gtkx-i18n.json\", import.meta.url);\n\n if (!existsSync(configUrl)) {\n return fileURLToPath(new URL(\"locale\", configUrl));\n }\n\n const config: unknown = JSON.parse(readFileSync(configUrl, \"utf8\"));\n\n if (\n typeof config !== \"object\" ||\n config === null ||\n !(\"localeDir\" in config) ||\n typeof config.localeDir !== \"string\"\n ) {\n throw new TypeError(\"Invalid GTKX locale configuration\");\n }\n\n return fileURLToPath(new URL(config.localeDir, configUrl));\n}\n\nexport { locale };\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gtkx/i18n",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.12",
|
|
4
4
|
"description": "Gettext localization for GTKX through react-i18next.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gtkx",
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
"gettext",
|
|
14
14
|
"localization",
|
|
15
15
|
"linux",
|
|
16
|
-
"desktop"
|
|
16
|
+
"desktop",
|
|
17
|
+
"i18next",
|
|
18
|
+
"react-i18next"
|
|
17
19
|
],
|
|
18
20
|
"homepage": "https://gtkx.dev",
|
|
19
21
|
"bugs": {
|
|
@@ -56,36 +58,26 @@
|
|
|
56
58
|
"dist",
|
|
57
59
|
"src"
|
|
58
60
|
],
|
|
59
|
-
"nx": {
|
|
60
|
-
"targets": {
|
|
61
|
-
"lint": {
|
|
62
|
-
"options": {
|
|
63
|
-
"cwd": ".",
|
|
64
|
-
"command": "eslint {projectRoot}"
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
61
|
"engines": {
|
|
70
62
|
"node": ">=26.7.0"
|
|
71
63
|
},
|
|
72
64
|
"dependencies": {
|
|
73
|
-
"@gtkx/runtime": "2.0.0-beta.
|
|
74
|
-
"i18next": "^26.
|
|
75
|
-
"react-i18next": "^17.0.
|
|
65
|
+
"@gtkx/runtime": "2.0.0-beta.12",
|
|
66
|
+
"i18next": "^26.5.2",
|
|
67
|
+
"react-i18next": "^17.0.21"
|
|
76
68
|
},
|
|
77
69
|
"peerDependencies": {
|
|
78
70
|
"@types/react": "^19.3",
|
|
79
71
|
"react": "^19.3"
|
|
80
72
|
},
|
|
81
73
|
"devDependencies": {
|
|
82
|
-
"@gtkx/config": "2.0.0-beta.
|
|
83
|
-
"@gtkx/testing": "2.0.0-beta.
|
|
84
|
-
"@gtkx/vitest": "2.0.0-beta.
|
|
74
|
+
"@gtkx/config": "2.0.0-beta.12",
|
|
75
|
+
"@gtkx/testing": "2.0.0-beta.12",
|
|
76
|
+
"@gtkx/vitest": "2.0.0-beta.12",
|
|
85
77
|
"@types/react": "^19.3.0",
|
|
86
|
-
"vitest": "
|
|
78
|
+
"vitest": "5.0.5"
|
|
87
79
|
},
|
|
88
80
|
"scripts": {
|
|
89
|
-
"release": "
|
|
81
|
+
"release": "node ../../scripts/release/publish-package.ts"
|
|
90
82
|
}
|
|
91
83
|
}
|
package/src/backend.ts
CHANGED
|
@@ -29,12 +29,7 @@ const gettextCatalog: GettextCatalog = {
|
|
|
29
29
|
const contextualSingular = contextualMsgid(context, msgid);
|
|
30
30
|
const contextualPlural = contextualMsgid(context, msgidPlural);
|
|
31
31
|
|
|
32
|
-
const translated = GLib.dngettext(
|
|
33
|
-
applicationId,
|
|
34
|
-
contextualSingular,
|
|
35
|
-
contextualPlural,
|
|
36
|
-
normalizeCount(count),
|
|
37
|
-
);
|
|
32
|
+
const translated = GLib.dngettext(applicationId, contextualSingular, contextualPlural, normalizeCount(count));
|
|
38
33
|
|
|
39
34
|
return translated === contextualSingular || translated === contextualPlural ? undefined : translated;
|
|
40
35
|
},
|
package/src/i18n.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import type { I18nFormatModule, TOptions } from "i18next";
|
|
2
2
|
import i18next from "i18next";
|
|
3
3
|
import { initReactI18next } from "react-i18next";
|
|
4
|
-
import {
|
|
5
|
-
GETTEXT_RESOURCE_KEY,
|
|
6
|
-
gettextBackend,
|
|
7
|
-
type GettextCatalog,
|
|
8
|
-
isGettextCatalog,
|
|
9
|
-
} from "./backend.js";
|
|
4
|
+
import { GETTEXT_RESOURCE_KEY, gettextBackend, type GettextCatalog, isGettextCatalog } from "./backend.js";
|
|
10
5
|
import { locale } from "./locale.js";
|
|
11
6
|
|
|
12
7
|
type GettextFormat = I18nFormatModule & {
|
|
@@ -89,12 +84,7 @@ const pluralSources = (msgid: string, options: TOptions): { plural: string; sing
|
|
|
89
84
|
};
|
|
90
85
|
};
|
|
91
86
|
|
|
92
|
-
const pluralPointLookup = (
|
|
93
|
-
catalog: GettextCatalog,
|
|
94
|
-
msgid: string,
|
|
95
|
-
options: TOptions,
|
|
96
|
-
count: number,
|
|
97
|
-
): string => {
|
|
87
|
+
const pluralPointLookup = (catalog: GettextCatalog, msgid: string, options: TOptions, count: number): string => {
|
|
98
88
|
const { plural, singular } = pluralSources(msgid, options);
|
|
99
89
|
|
|
100
90
|
return pluralLookup({
|
|
@@ -106,11 +96,7 @@ const pluralPointLookup = (
|
|
|
106
96
|
});
|
|
107
97
|
};
|
|
108
98
|
|
|
109
|
-
const contextualLookup = (
|
|
110
|
-
catalog: GettextCatalog,
|
|
111
|
-
source: string,
|
|
112
|
-
context: string | undefined,
|
|
113
|
-
): string => {
|
|
99
|
+
const contextualLookup = (catalog: GettextCatalog, source: string, context: string | undefined): string => {
|
|
114
100
|
if (context === undefined) {
|
|
115
101
|
return catalog.gettext(source);
|
|
116
102
|
}
|
|
@@ -118,11 +104,7 @@ const contextualLookup = (
|
|
|
118
104
|
return catalog.pgettext(context, source) ?? catalog.gettext(source);
|
|
119
105
|
};
|
|
120
106
|
|
|
121
|
-
const singularPointLookup = (
|
|
122
|
-
catalog: GettextCatalog,
|
|
123
|
-
msgid: string,
|
|
124
|
-
options: TOptions,
|
|
125
|
-
): string | undefined => {
|
|
107
|
+
const singularPointLookup = (catalog: GettextCatalog, msgid: string, options: TOptions): string | undefined => {
|
|
126
108
|
const source = stringOption(options, "defaultValue") ?? msgid;
|
|
127
109
|
const translated = contextualLookup(catalog, source, getContext(options.context));
|
|
128
110
|
|
package/src/locale.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { t } from "@gtkx/runtime";
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
3
|
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { applicationId } from "virtual:gtkx-config";
|
|
4
|
+
import { applicationId, localeDir } from "virtual:gtkx-config";
|
|
4
5
|
|
|
5
6
|
const LIBC = "libc.so.6";
|
|
6
7
|
const LC_ALL = 6;
|
|
@@ -8,12 +9,7 @@ const GETTEXT_CODESET = ["UTF", "8"].join("-");
|
|
|
8
9
|
const setLocaleBinding = t.bind(LIBC, "setlocale", [t.int32, t.string()], t.string());
|
|
9
10
|
const bindTextDomainBinding = t.bind(LIBC, "bindtextdomain", [t.string(), t.string()], t.string());
|
|
10
11
|
|
|
11
|
-
const bindTextDomainCodesetBinding = t.bind(
|
|
12
|
-
LIBC,
|
|
13
|
-
"bind_textdomain_codeset",
|
|
14
|
-
[t.string(), t.string()],
|
|
15
|
-
t.string(),
|
|
16
|
-
);
|
|
12
|
+
const bindTextDomainCodesetBinding = t.bind(LIBC, "bind_textdomain_codeset", [t.string(), t.string()], t.string());
|
|
17
13
|
|
|
18
14
|
const textDomainBinding = t.bind(LIBC, "textdomain", [t.string()], t.string());
|
|
19
15
|
const locale: string = initializeLocale();
|
|
@@ -27,13 +23,34 @@ function requireStringResult(result: unknown): string {
|
|
|
27
23
|
}
|
|
28
24
|
|
|
29
25
|
function initializeLocale(): string {
|
|
30
|
-
const
|
|
26
|
+
const directory = localeDir ?? bundledLocaleDir();
|
|
31
27
|
requireStringResult(setLocaleBinding(LC_ALL, ""));
|
|
32
|
-
requireStringResult(bindTextDomainBinding(applicationId,
|
|
28
|
+
requireStringResult(bindTextDomainBinding(applicationId, directory));
|
|
33
29
|
requireStringResult(bindTextDomainCodesetBinding(applicationId, GETTEXT_CODESET));
|
|
34
30
|
requireStringResult(textDomainBinding(applicationId));
|
|
35
31
|
|
|
36
32
|
return new Intl.NumberFormat().resolvedOptions().locale;
|
|
37
33
|
}
|
|
38
34
|
|
|
35
|
+
function bundledLocaleDir(): string {
|
|
36
|
+
const configUrl = new URL("gtkx-i18n.json", import.meta.url);
|
|
37
|
+
|
|
38
|
+
if (!existsSync(configUrl)) {
|
|
39
|
+
return fileURLToPath(new URL("locale", configUrl));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const config: unknown = JSON.parse(readFileSync(configUrl, "utf8"));
|
|
43
|
+
|
|
44
|
+
if (
|
|
45
|
+
typeof config !== "object" ||
|
|
46
|
+
config === null ||
|
|
47
|
+
!("localeDir" in config) ||
|
|
48
|
+
typeof config.localeDir !== "string"
|
|
49
|
+
) {
|
|
50
|
+
throw new TypeError("Invalid GTKX locale configuration");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return fileURLToPath(new URL(config.localeDir, configUrl));
|
|
54
|
+
}
|
|
55
|
+
|
|
39
56
|
export { locale };
|
package/src/virtual-config.d.ts
CHANGED