diff --git a/.prettierignore b/.prettierignore index 9bafe569..f4ae1059 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,3 @@ /app/**/*.js -/app/translations/*.json /dist +/public/translations/*.json diff --git a/.tx/config b/.tx/config index 783032e1..5046c1a5 100644 --- a/.tx/config +++ b/.tx/config @@ -2,8 +2,8 @@ host = https://www.transifex.com [zulip.desktopjson] -file_filter = app/translations/.json +file_filter = public/translations/.json minimum_perc = 0 -source_file = app/translations/en.json +source_file = public/translations/en.json source_lang = en type = KEYVALUEJSON diff --git a/app/common/translation-util.ts b/app/common/translation-util.ts index d2658fec..3b861c3f 100644 --- a/app/common/translation-util.ts +++ b/app/common/translation-util.ts @@ -5,7 +5,7 @@ import i18n from "i18n"; import * as ConfigUtil from "./config-util.js"; i18n.configure({ - directory: path.join(__dirname, "../translations/"), + directory: path.join(__dirname, "../../public/translations/"), updateFiles: false, }); diff --git a/app/renderer/js/pages/preference/general-section.ts b/app/renderer/js/pages/preference/general-section.ts index ebfbcc6c..320c827a 100644 --- a/app/renderer/js/pages/preference/general-section.ts +++ b/app/renderer/js/pages/preference/general-section.ts @@ -9,11 +9,11 @@ import Tagify from "@yaireo/tagify"; import ISO6391 from "iso-639-1"; import * as z from "zod"; +import supportedLocales from "../../../../../public/translations/supported-locales.json"; import * as ConfigUtil from "../../../../common/config-util.js"; import * as EnterpriseUtil from "../../../../common/enterprise-util.js"; import {html} from "../../../../common/html.js"; import * as t from "../../../../common/translation-util.js"; -import supportedLocales from "../../../../translations/supported-locales.json"; import {ipcRenderer} from "../../typed-ipc-renderer.js"; import {generateSelectHtml, generateSettingOption} from "./base-section.js"; diff --git a/docs/howto/translations.md b/docs/howto/translations.md index 5bee7136..084bccd9 100644 --- a/docs/howto/translations.md +++ b/docs/howto/translations.md @@ -38,7 +38,7 @@ You'll want Transifex's CLI client, `tx`. Run `tx push -s`. -This uploads from `app/translations/en.json` to the +This uploads from `public/translations/en.json` to the set of strings Transifex shows for contributors to translate. (See `.tx/config` for how that's configured.) @@ -46,7 +46,7 @@ set of strings Transifex shows for contributors to translate. Run `tools/tx-pull`. -This writes to files `app/translations/.json`. +This writes to files `public/translations/.json`. (See `.tx/config` for how that's configured.) Then look at the following sections to see if further updates are @@ -59,7 +59,7 @@ language. This happens when we've opened up a new language for people to contribute translations into in the Zulip project on Transifex, which we do when someone expresses interest in contributing them. -The locales for supported languages are stored in `app/translations/supported-locales.json` +The locales for supported languages are stored in `public/translations/supported-locales.json` So, when a new language is added, update the `supported-locales` module. diff --git a/package.json b/package.json index a176114c..1d33b862 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,8 @@ "**/*.node" ], "files": [ - "app/**/*" + "app/**/*", + "public/**/*" ], "copyright": "©2020 Kandra Labs, Inc.", "mac": { @@ -203,8 +204,7 @@ "target": "./app/common", "from": "./app", "except": [ - "./common", - "./translations" + "./common" ] }, { @@ -212,8 +212,7 @@ "from": "./app", "except": [ "./common", - "./main", - "./translations" + "./main" ] }, { @@ -221,8 +220,7 @@ "from": "./app", "except": [ "./common", - "./renderer", - "./translations" + "./renderer" ] } ] diff --git a/app/translations/README.md b/public/translations/README.md similarity index 100% rename from app/translations/README.md rename to public/translations/README.md diff --git a/app/translations/ar.json b/public/translations/ar.json similarity index 100% rename from app/translations/ar.json rename to public/translations/ar.json diff --git a/app/translations/bg.json b/public/translations/bg.json similarity index 100% rename from app/translations/bg.json rename to public/translations/bg.json diff --git a/app/translations/ca.json b/public/translations/ca.json similarity index 100% rename from app/translations/ca.json rename to public/translations/ca.json diff --git a/app/translations/cs.json b/public/translations/cs.json similarity index 100% rename from app/translations/cs.json rename to public/translations/cs.json diff --git a/app/translations/da.json b/public/translations/da.json similarity index 100% rename from app/translations/da.json rename to public/translations/da.json diff --git a/app/translations/de.json b/public/translations/de.json similarity index 100% rename from app/translations/de.json rename to public/translations/de.json diff --git a/app/translations/el.json b/public/translations/el.json similarity index 100% rename from app/translations/el.json rename to public/translations/el.json diff --git a/app/translations/el_GR.json b/public/translations/el_GR.json similarity index 100% rename from app/translations/el_GR.json rename to public/translations/el_GR.json diff --git a/app/translations/en.json b/public/translations/en.json similarity index 100% rename from app/translations/en.json rename to public/translations/en.json diff --git a/app/translations/en_GB.json b/public/translations/en_GB.json similarity index 100% rename from app/translations/en_GB.json rename to public/translations/en_GB.json diff --git a/app/translations/es.json b/public/translations/es.json similarity index 100% rename from app/translations/es.json rename to public/translations/es.json diff --git a/app/translations/fa.json b/public/translations/fa.json similarity index 100% rename from app/translations/fa.json rename to public/translations/fa.json diff --git a/app/translations/fi.json b/public/translations/fi.json similarity index 100% rename from app/translations/fi.json rename to public/translations/fi.json diff --git a/app/translations/fr.json b/public/translations/fr.json similarity index 100% rename from app/translations/fr.json rename to public/translations/fr.json diff --git a/app/translations/gl.json b/public/translations/gl.json similarity index 100% rename from app/translations/gl.json rename to public/translations/gl.json diff --git a/app/translations/hi.json b/public/translations/hi.json similarity index 100% rename from app/translations/hi.json rename to public/translations/hi.json diff --git a/app/translations/hr.json b/public/translations/hr.json similarity index 100% rename from app/translations/hr.json rename to public/translations/hr.json diff --git a/app/translations/hu.json b/public/translations/hu.json similarity index 100% rename from app/translations/hu.json rename to public/translations/hu.json diff --git a/app/translations/id_ID.json b/public/translations/id_ID.json similarity index 100% rename from app/translations/id_ID.json rename to public/translations/id_ID.json diff --git a/app/translations/it.json b/public/translations/it.json similarity index 100% rename from app/translations/it.json rename to public/translations/it.json diff --git a/app/translations/ja.json b/public/translations/ja.json similarity index 100% rename from app/translations/ja.json rename to public/translations/ja.json diff --git a/app/translations/ko.json b/public/translations/ko.json similarity index 100% rename from app/translations/ko.json rename to public/translations/ko.json diff --git a/app/translations/lt.json b/public/translations/lt.json similarity index 100% rename from app/translations/lt.json rename to public/translations/lt.json diff --git a/app/translations/ml.json b/public/translations/ml.json similarity index 100% rename from app/translations/ml.json rename to public/translations/ml.json diff --git a/app/translations/nb_NO.json b/public/translations/nb_NO.json similarity index 100% rename from app/translations/nb_NO.json rename to public/translations/nb_NO.json diff --git a/app/translations/nl.json b/public/translations/nl.json similarity index 100% rename from app/translations/nl.json rename to public/translations/nl.json diff --git a/app/translations/pl.json b/public/translations/pl.json similarity index 100% rename from app/translations/pl.json rename to public/translations/pl.json diff --git a/app/translations/pt.json b/public/translations/pt.json similarity index 100% rename from app/translations/pt.json rename to public/translations/pt.json diff --git a/app/translations/ro.json b/public/translations/ro.json similarity index 100% rename from app/translations/ro.json rename to public/translations/ro.json diff --git a/app/translations/ru.json b/public/translations/ru.json similarity index 100% rename from app/translations/ru.json rename to public/translations/ru.json diff --git a/app/translations/sk.json b/public/translations/sk.json similarity index 100% rename from app/translations/sk.json rename to public/translations/sk.json diff --git a/app/translations/sr.json b/public/translations/sr.json similarity index 100% rename from app/translations/sr.json rename to public/translations/sr.json diff --git a/app/translations/supported-locales.json b/public/translations/supported-locales.json similarity index 100% rename from app/translations/supported-locales.json rename to public/translations/supported-locales.json diff --git a/app/translations/sv.json b/public/translations/sv.json similarity index 100% rename from app/translations/sv.json rename to public/translations/sv.json diff --git a/app/translations/ta.json b/public/translations/ta.json similarity index 100% rename from app/translations/ta.json rename to public/translations/ta.json diff --git a/app/translations/tr.json b/public/translations/tr.json similarity index 100% rename from app/translations/tr.json rename to public/translations/tr.json diff --git a/app/translations/uk.json b/public/translations/uk.json similarity index 100% rename from app/translations/uk.json rename to public/translations/uk.json diff --git a/app/translations/uz.json b/public/translations/uz.json similarity index 100% rename from app/translations/uz.json rename to public/translations/uz.json diff --git a/app/translations/vi.json b/public/translations/vi.json similarity index 100% rename from app/translations/vi.json rename to public/translations/vi.json diff --git a/app/translations/zh-Hans.json b/public/translations/zh-Hans.json similarity index 100% rename from app/translations/zh-Hans.json rename to public/translations/zh-Hans.json diff --git a/app/translations/zh-Hant.json b/public/translations/zh-Hant.json similarity index 100% rename from app/translations/zh-Hant.json rename to public/translations/zh-Hant.json diff --git a/app/translations/zh_TW.json b/public/translations/zh_TW.json similarity index 100% rename from app/translations/zh_TW.json rename to public/translations/zh_TW.json