poly-lexis 0.8.0 → 0.8.1
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/dist/cli/translations.js +4 -2
- package/dist/cli/translations.js.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/translations.js
CHANGED
|
@@ -903,7 +903,7 @@ function generateTranslationTypes(projectRoot = process.cwd()) {
|
|
|
903
903
|
if (!fs3.existsSync(outputDir)) {
|
|
904
904
|
fs3.mkdirSync(outputDir, { recursive: true });
|
|
905
905
|
}
|
|
906
|
-
const typeString = typeTemplate(allKeys, namespaces);
|
|
906
|
+
const typeString = typeTemplate(allKeys, namespaces, config.languages);
|
|
907
907
|
fs3.writeFileSync(outputFilePath, typeString, "utf8");
|
|
908
908
|
console.log(`Generated types with ${allKeys.length} keys and ${namespaces.length} namespaces`);
|
|
909
909
|
console.log(`Output: ${outputFilePath}`);
|
|
@@ -926,12 +926,14 @@ var init_generate_types = __esm({
|
|
|
926
926
|
init_utils();
|
|
927
927
|
init_init();
|
|
928
928
|
PLURAL_SUFFIXES = ["_zero", "_one", "_two", "_few", "_many", "_other"];
|
|
929
|
-
typeTemplate = (translationKeys, namespaceKeys) => `
|
|
929
|
+
typeTemplate = (translationKeys, namespaceKeys, languages) => `
|
|
930
930
|
export const translationKeys = [${translationKeys.map((key) => `"${key}"`).join(", ")}] as const;
|
|
931
931
|
export const namespaceKeys = [${namespaceKeys.map((key) => `"${key}"`).join(", ")}] as const;
|
|
932
|
+
export const languages = [${languages.map((lang) => `"${lang}"`).join(", ")}] as const;
|
|
932
933
|
|
|
933
934
|
export type TranslationKey = typeof translationKeys[number];
|
|
934
935
|
export type TranslationNamespace = typeof namespaceKeys[number];
|
|
936
|
+
export type Language = typeof languages[number];
|
|
935
937
|
`;
|
|
936
938
|
}
|
|
937
939
|
});
|