Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update translation submodule #2023

Merged
merged 3 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions generate_translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}",`;
}
}
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion lemmy-translations
Submodule lemmy-translations updated 55 files
+3 −0 email/af.json
+14 −5 email/bg.json
+1 −0 email/cs.json
+4 −1 email/de.json
+4 −1 email/eo.json
+5 −2 email/es.json
+23 −0 email/et.json
+12 −7 email/fr.json
+27 −0 email/gl.json
+4 −0 email/hi.json
+2 −1 email/hu.json
+8 −5 email/id.json
+17 −8 email/it.json
+7 −4 email/ja.json
+27 −0 email/nl.json
+27 −0 email/nn.json
+4 −1 email/pt.json
+5 −2 email/pt_BR.json
+5 −2 email/ro.json
+14 −5 email/ru.json
+1 −0 email/th.json
+4 −1 email/tr.json
+21 −12 email/uk.json
+94 −5 translations/ar.json
+176 −43 translations/bg.json
+4 −1 translations/bn.json
+6 −4 translations/ca.json
+7 −1 translations/cs.json
+42 −8 translations/da.json
+6 −2 translations/de.json
+7 −2 translations/el.json
+14 −2 translations/en.json
+18 −6 translations/eo.json
+13 −1 translations/es.json
+442 −0 translations/et.json
+84 −20 translations/eu.json
+148 −20 translations/fa.json
+23 −3 translations/fi.json
+115 −18 translations/fr.json
+39 −5 translations/gl.json
+93 −3 translations/he.json
+85 −65 translations/hi.json
+14 −4 translations/hu.json
+51 −7 translations/id.json
+105 −24 translations/it.json
+26 −1 translations/ja.json
+213 −81 translations/nl.json
+526 −0 translations/nn.json
+29 −4 translations/pl.json
+44 −10 translations/pt.json
+36 −1 translations/pt_BR.json
+543 −1 translations/ro.json
+92 −3 translations/ru.json
+62 −28 translations/tr.json
+337 −125 translations/uk.json