Update translation submodule (#2023)

* Update translation submodule

* Fix translation generation error
This commit is contained in:
SleeplessOne1917 2023-08-04 20:24:13 +00:00 committed by GitHub
parent afafb777b4
commit 1a53a247ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -8,12 +8,12 @@ fs.readdir(translationDir, (_err, files) => {
const lang = filename.split(".")[0];
try {
const json = JSON.parse(
fs.readFileSync(translationDir + filename, "utf8")
fs.readFileSync(translationDir + filename, "utf8"),
);
let data = `export const ${lang} = {\n translation: {`;
for (const key in json) {
if (key in json) {
const value = json[key].replace(/"/g, '\\"');
const value = json[key].replace(/"/g, '\\"').replace("\n", "\\n");
data += `\n ${key}: "${value}",`;
}
}
@ -67,14 +67,14 @@ ${optionKeys.map(key => `${indent}| "${key}"`).join("\n")};
export type I18nKeys = NoOptionI18nKeys | OptionI18nKeys;
export type TTypedOptions<TKey extends OptionI18nKeys> =${Array.from(
optionMap.entries()
optionMap.entries(),
).reduce(
(acc, [key, options]) =>
`${acc} TKey extends \"${key}\" ? ${
options.reduce((acc, cur) => acc + `${cur}: string | number; `, "{ ") +
"}"
} :\n${indent}`,
""
"",
)} (Record<string, unknown> | string);
export interface TFunctionTyped {

@ -1 +1 @@
Subproject commit 713ceed9c7ef84deaa222e68361e670e0763cd83
Subproject commit 22637606f4a4455458e64cefe9f5ec33dccb6c52