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

Migrate translations to keys and switch to Localazy #1198

Merged
merged 19 commits into from
Sep 5, 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: 8 additions & 0 deletions .github/workflows/localazy_download.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Localazy Download
on:
workflow_dispatch: {}
jobs:
download:
uses: matrix-org/matrix-web-i18n/.github/workflows/localazy_download.yaml@main
secrets:
ELEMENT_BOT_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
11 changes: 11 additions & 0 deletions .github/workflows/localazy_upload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Localazy Upload
on:
push:
branches: [develop]
paths:
- "src/strings/i18n/en_EN.json"
jobs:
upload:
uses: matrix-org/matrix-web-i18n/.github/workflows/localazy_upload.yaml@main
secrets:
LOCALAZY_WRITE_KEY: ${{ secrets.LOCALAZY_WRITE_KEY }}
2 changes: 1 addition & 1 deletion .github/workflows/static_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

i18n_lint:
name: "i18n Check"
uses: matrix-org/matrix-react-sdk/.github/workflows/i18n_check.yml@develop
uses: matrix-org/matrix-web-i18n/.github/workflows/i18n_check.yml@main

js_lint:
name: "ESLint"
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![Build](https://github.com/vector-im/element-desktop/actions/workflows/build.yaml/badge.svg)
![Static Analysis](https://github.com/vector-im/element-desktop/actions/workflows/static_analysis.yaml/badge.svg)
[![Weblate](https://translate.element.io/widgets/element-desktop/-/element-desktop/svg-badge.svg)](https://translate.element.io/engage/element-desktop/)
[![Localazy](https://img.shields.io/endpoint?url=https%3A%2F%2Fconnect.localazy.com%2Fstatus%2Felement-web%2Fdata%3Fcontent%3Dall%26title%3Dlocalazy%26logo%3Dtrue)](https://localazy.com/p/element-web)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=element-desktop&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=element-desktop)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=element-desktop&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=element-desktop)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=element-desktop&metric=bugs)](https://sonarcloud.io/summary/new_code?id=element-desktop)
Expand Down Expand Up @@ -149,8 +149,6 @@ To add a new translation, head to the [translating doc](https://github.com/vecto

For a developer guide, see the [translating dev doc](https://github.com/vector-im/element-web/blob/develop/docs/translating-dev.md).

[<img src="https://translate.element.io/widgets/element-desktop/-/multi-auto.svg" alt="translationsstatus" width="340">](https://translate.element.io/engage/element-desktop/?utm_source=widget)

# Report bugs & give feedback

If you run into any bugs or have feedback you'd like to share, please let us know on GitHub.
Expand Down
37 changes: 37 additions & 0 deletions localazy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"readKey": "a7688614897667993891-866e2615b0a22e6ccef56aea9b10e815efa3e1296752a7a30bd9925f1a8f33e7",

"upload": {
"type": "json",
"keySeparator": "|",
"deprecate": "file",
"features": ["plural_object", "filter_untranslated"],
"files": [
{
"pattern": "src/i18n/strings/en_EN.json",
"file": "element-desktop.json",
"lang": "inherited"
},
{
"group": "existing",
"pattern": "src/i18n/strings/*.json",
"file": "element-desktop.json",
"excludes": ["src/i18n/strings/en_EN.json"],
"lang": "${autodetectLang}"
}
]
},

"download": {
"files": [
{
"conditions": "equals: ${file}, element-desktop.json",
"output": "src/i18n/strings/${langLsrUnderscore}.json"
}
],
"includeSourceLang": "${includeSourceLang|false}",
"langAliases": {
"en-GB": "en-EN"
}
}
}
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
"node": ">=16.0.0"
},
"scripts": {
"i18n": "matrix-gen-i18n",
"prunei18n": "matrix-prune-i18n",
"diff-i18n": "cp src/i18n/strings/en_EN.json src/i18n/strings/en_EN_orig.json && matrix-gen-i18n && matrix-compare-i18n-files src/i18n/strings/en_EN_orig.json src/i18n/strings/en_EN.json",
"i18n": "matrix-gen-i18n && yarn i18n:sort && yarn i18n:lint",
"i18n:sort": "jq --sort-keys '.' src/i18n/strings/en_EN.json > src/i18n/strings/en_EN.json.tmp && mv src/i18n/strings/en_EN.json.tmp src/i18n/strings/en_EN.json",
"i18n:lint": "prettier --loglevel silent --write src/i18n/strings/ --ignore-path /dev/null",
"i18n:diff": "cp src/i18n/strings/en_EN.json src/i18n/strings/en_EN_orig.json && yarn i18n && matrix-compare-i18n-files src/i18n/strings/en_EN_orig.json src/i18n/strings/en_EN.json",
"mkdirs": "mkdirp packages deploys",
"fetch": "yarn run mkdirs && ts-node scripts/fetch-package.ts",
"asar-webapp": "asar p webapp webapp.asar",
Expand Down Expand Up @@ -105,7 +106,7 @@
"fs-extra": "^11.0.0",
"glob": "^10.0.0",
"jest": "^29.0.0",
"matrix-web-i18n": "^2.0.0",
"matrix-web-i18n": "^3.1.1",
"mkdirp": "^3.0.0",
"node-pre-gyp": "^0.17.0",
"pacote": "^15.0.0",
Expand Down
9 changes: 5 additions & 4 deletions src/electron-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ global.appQuitting = false;
const exitShortcuts: Array<(input: Input, platform: string) => boolean> = [
(input, platform): boolean => platform !== "darwin" && input.alt && input.key.toUpperCase() === "F4",
(input, platform): boolean => platform !== "darwin" && input.control && input.key.toUpperCase() === "Q",
(input, platform): boolean => platform === "darwin" && input.meta && !input.control && input.key.toUpperCase() === "Q",
(input, platform): boolean =>
platform === "darwin" && input.meta && !input.control && input.key.toUpperCase() === "Q",
];

const warnBeforeExit = (event: Event, input: Input): void => {
Expand All @@ -273,12 +274,12 @@ const warnBeforeExit = (event: Event, input: Input): void => {
dialog.showMessageBoxSync(global.mainWindow, {
type: "question",
buttons: [
_t("Cancel"),
_t("Close %(brand)s", {
_t("action|cancel"),
_t("action|close_brand", {
brand: global.vectorConfig.brand || "Element",
}),
],
message: _t("Are you sure you want to quit?"),
message: _t("confirm_quit"),
defaultId: 1,
cancelId: 0,
}) === 0;
Expand Down
104 changes: 60 additions & 44 deletions src/i18n/strings/ar.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,62 @@
{
"File": "ملف",
"Close": "أغلِق",
"Actual Size": "المقاس الفعلي",
"View": "منظور",
"Select All": "حدّد الكل",
"Delete": "احذف",
"Copy": "انسخ",
"Edit": "تحرير",
"Cancel": "ألغِ",
"Bring All to Front": "ضَع الكل في المقدّمة",
"Speech": "نطق",
"Add to dictionary": "أضِف إلى القاموس",
"The image failed to save": "فشل حفظ الصورة",
"Failed to save image": "فشل حفظ الصورة",
"Save image as...": "احفظ الصورة كَ‍...",
"Copy link address": "انسخ عنوان الرابط",
"Copy email address": "انسخ عنوان البريد الإلكتروني",
"Copy image": "انسخ الصورة",
"Zoom": "تقريب",
"Stop Speaking": "أوقِف النطق",
"Start Speaking": "ابدأ النطق",
"Unhide": "اعرض",
"Hide Others": "أخفِ البقية",
"Hide": "أخفِ",
"Services": "الخدمات",
"About": "عن",
"Help": "مساعدة",
"Minimize": "صغّر",
"Window": "نافذة",
"Toggle Developer Tools": "فعّل/عطّل أدوات المطوّرين",
"Toggle Full Screen": "فعّل/عطّل ملء الشاشة",
"Preferences": "التفضيلات",
"Zoom In": "قرّب",
"Zoom Out": "بعّد",
"Paste and Match Style": "ألصِق وطابِق النمط",
"Paste": "ألصِق",
"Cut": "قصّ",
"Redo": "أعِد",
"Undo": "تراجَع",
"Quit": "غادِر",
"Show/Hide": "اعرض/أخفِ",
"Are you sure you want to quit?": "أمتأكّد من الإغلاق؟",
"Copy image address": "انسخ عنوان (رابط) الصورة",
"Close %(brand)s": "اغلاق %(brand)s"
"action": {
"cancel": "ألغِ",
"close": "أغلِق",
"close_brand": "اغلاق %(brand)s",
"copy": "انسخ",
"cut": "قصّ",
"delete": "احذف",
"edit": "تحرير",
"minimise": "صغّر",
"paste": "ألصِق",
"paste_match_style": "ألصِق وطابِق النمط",
"quit": "غادِر",
"redo": "أعِد",
"select_all": "حدّد الكل",
"show_hide": "اعرض/أخفِ",
"undo": "تراجَع",
"zoom_in": "قرّب",
"zoom_out": "بعّد"
},
"common": {
"about": "عن",
"help": "مساعدة",
"preferences": "التفضيلات"
},
"confirm_quit": "أمتأكّد من الإغلاق؟",
"edit_menu": {
"speech": "نطق",
"speech_start_speaking": "ابدأ النطق",
"speech_stop_speaking": "أوقِف النطق"
},
"file_menu": {
"label": "ملف"
},
"menu": {
"hide": "أخفِ",
"hide_others": "أخفِ البقية",
"services": "الخدمات",
"unhide": "اعرض"
},
"right_click_menu": {
"add_to_dictionary": "أضِف إلى القاموس",
"copy_email": "انسخ عنوان البريد الإلكتروني",
"copy_image": "انسخ الصورة",
"copy_image_url": "انسخ عنوان (رابط) الصورة",
"copy_link_url": "انسخ عنوان الرابط",
"save_image_as": "احفظ الصورة كَ‍...",
"save_image_as_error_description": "فشل حفظ الصورة",
"save_image_as_error_title": "فشل حفظ الصورة"
},
"view_menu": {
"actual_size": "المقاس الفعلي",
"toggle_developer_tools": "فعّل/عطّل أدوات المطوّرين",
"toggle_full_screen": "فعّل/عطّل ملء الشاشة",
"view": "منظور"
},
"window_menu": {
"bring_all_to_front": "ضَع الكل في المقدّمة",
"label": "نافذة",
"zoom": "تقريب"
}
}
1 change: 0 additions & 1 deletion src/i18n/strings/basefile.json

This file was deleted.

100 changes: 58 additions & 42 deletions src/i18n/strings/be.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,60 @@
{
"Add to dictionary": "Дадаць у слоўнік",
"The image failed to save": "Не атрымалася захаваць малюнак",
"Failed to save image": "Не атрымалася захаваць малюнак",
"Save image as...": "Захаваць малюнак як...",
"Copy link address": "Скапіраваць спасылку",
"Copy email address": "Скапіраваць адрас пошты",
"Copy image": "Скапіраваць малюнак",
"File": "Файл",
"Bring All to Front": "Вынесці ўсё наперад",
"Zoom": "Маштаб",
"Stop Speaking": "Перастаць гаварыць",
"Start Speaking": "Гаварыць",
"Speech": "Голас",
"Unhide": "Паказаць",
"Hide Others": "Схаваць іншыя",
"Hide": "Схаваць",
"Services": "Сервісы",
"About": "Аб праграме",
"Help": "Даведка",
"Close": "Зачыніць",
"Minimize": "Згарнуць",
"Window": "Акно",
"Toggle Developer Tools": "Пераключэнне інструментаў распрацоўніка",
"Toggle Full Screen": "Пераключэнне на ўвесь экран",
"Preferences": "Параметры",
"Zoom Out": "Паменшыць",
"Zoom In": "Павялічыць",
"Actual Size": "Фактычны Памер",
"View": "Прагляд",
"Select All": "Выбраць усё",
"Delete": "Выдаліць",
"Paste and Match Style": "Уставіць і супаставіць стыль",
"Paste": "Уставіць",
"Copy": "Капіяваць",
"Cut": "Выразаць",
"Redo": "Паўтарыць",
"Undo": "Адмяніць",
"Edit": "Змяніць",
"Quit": "Выйсці",
"Show/Hide": "Паказаць / схаваць",
"Are you sure you want to quit?": "Вы ўпэўненыя, што хочаце выйсці?",
"Cancel": "Адмена"
"action": {
"cancel": "Адмена",
"close": "Зачыніць",
"copy": "Капіяваць",
"cut": "Выразаць",
"delete": "Выдаліць",
"edit": "Змяніць",
"minimise": "Згарнуць",
"paste": "Уставіць",
"paste_match_style": "Уставіць і супаставіць стыль",
"quit": "Выйсці",
"redo": "Паўтарыць",
"select_all": "Выбраць усё",
"show_hide": "Паказаць / схаваць",
"undo": "Адмяніць",
"zoom_in": "Павялічыць",
"zoom_out": "Паменшыць"
},
"common": {
"about": "Аб праграме",
"help": "Даведка",
"preferences": "Параметры"
},
"confirm_quit": "Вы ўпэўненыя, што хочаце выйсці?",
"edit_menu": {
"speech": "Голас",
"speech_start_speaking": "Гаварыць",
"speech_stop_speaking": "Перастаць гаварыць"
},
"file_menu": {
"label": "Файл"
},
"menu": {
"hide": "Схаваць",
"hide_others": "Схаваць іншыя",
"services": "Сервісы",
"unhide": "Паказаць"
},
"right_click_menu": {
"add_to_dictionary": "Дадаць у слоўнік",
"copy_email": "Скапіраваць адрас пошты",
"copy_image": "Скапіраваць малюнак",
"copy_link_url": "Скапіраваць спасылку",
"save_image_as": "Захаваць малюнак як...",
"save_image_as_error_description": "Не атрымалася захаваць малюнак",
"save_image_as_error_title": "Не атрымалася захаваць малюнак"
},
"view_menu": {
"actual_size": "Фактычны Памер",
"toggle_developer_tools": "Пераключэнне інструментаў распрацоўніка",
"toggle_full_screen": "Пераключэнне на ўвесь экран",
"view": "Прагляд"
},
"window_menu": {
"bring_all_to_front": "Вынесці ўсё наперад",
"label": "Акно",
"zoom": "Маштаб"
}
}
Loading
Loading