[ci skip] Added crowdin sync github action

This commit is contained in:
RaphiMC 2024-12-27 16:44:42 +01:00
parent 5d03465a3e
commit 8aadedf97c
No known key found for this signature in database
GPG Key ID: 0F6BB0657A03AC94
8 changed files with 53 additions and 10 deletions

12
.github/crowdin.yml vendored Normal file
View File

@ -0,0 +1,12 @@
project_id_env: "CROWDIN_PROJECT_ID"
api_token_env: "CROWDIN_PERSONAL_TOKEN"
base_path: "../"
preserve_hierarchy: true
files: [
{
source: "/src/main/resources/assets/viaproxy/language/en_US.properties",
translation: "/src/main/resources/assets/viaproxy/language/%locale_with_underscore%.properties",
escape_quotes: 0,
escape_special_characters: 0
}
]

30
.github/workflows/crowdin-sync.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: crowdin-sync
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
synchronize-with-crowdin:
runs-on: ubuntu-24.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Crowdin Sync
uses: crowdin/github-action@v2
with:
config: .github/crowdin.yml
upload_sources: true
download_translations: true
localization_branch_name: l10n_crowdin_translations
create_pull_request: true
pull_request_base_branch_name: main
pull_request_title: "New Crowdin Translations"
pull_request_body: "New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)"
commit_message: "[ci skip] Updated translations from Crowdin"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

View File

@ -42,6 +42,7 @@ public class I18n {
for (Map.Entry<Path, byte[]> entry : FileSystemUtil.getFilesInDirectory("assets/viaproxy/language").entrySet()) {
final Properties properties = new Properties();
properties.load(new InputStreamReader(new ByteArrayInputStream(entry.getValue()), StandardCharsets.UTF_8));
if (properties.isEmpty()) continue;
LOCALES.put(entry.getKey().getFileName().toString().replace(".properties", ""), properties);
}
} catch (Throwable e) {

View File

@ -86,6 +86,8 @@ tab.ui_settings.name=Benutzeroberflächeneinstellungen
tab.ui_settings.language.label=Sprache:
tab.ui_settings.language.completion=%s übersetzt
tab.ui_settings.language.success=Die Sprache wurde zu %s (%s) geändert. ViaProxy startet jetzt neu!
tab.ui_settings.crowdin.info=Fehlt deine Sprache oder ist sie unvollständig? Hilf uns ViaProxy auf Crowdin zu übersetzen!
tab.ui_settings.crowdin.link=Klick hier um Crowdin zu öffnen
popup.login_account.title=Konto hinzufügen
popup.login_account.instructions.browser=Bitte öffne folgende URL in deinem Browser:
popup.login_account.instructions.close=Das Popup schließt sich automatisch, nachdem du angemeldet wurdest.
@ -93,5 +95,3 @@ popup.download.title=Lade herunter...
popup.update.info=Du verwendest eine alte Version von ViaProxy!\nAktuelle Version: %s\nNeueste Version: %s
popup.update.question=Möchtest du aktualisieren?
popup.update.success=Die neueste Version wurde heruntergeladen. ViaProxy startet jetzt neu!
tab.ui_settings.crowdin.info=Fehlt deine Sprache oder ist sie unvollständig? Hilf uns ViaProxy auf Crowdin zu übersetzen!
tab.ui_settings.crowdin.link=Klick hier um Crowdin zu öffnen

View File

@ -86,6 +86,8 @@ tab.ui_settings.name=UI Settings
tab.ui_settings.language.label=Language:
tab.ui_settings.language.completion=%s translated
tab.ui_settings.language.success=Language changed to %s (%s). ViaProxy will now restart!
tab.ui_settings.crowdin.info=Is your language missing or incomplete? Help us to translate ViaProxy on Crowdin!
tab.ui_settings.crowdin.link=Click here to go to Crowdin
popup.login_account.title=Add Account
popup.login_account.instructions.browser=Please open the following URL in your browser:
popup.login_account.instructions.close=The popup will close automatically after you have been logged in.
@ -93,5 +95,3 @@ popup.download.title=Downloading...
popup.update.info=You are running an outdated version of ViaProxy!\nCurrent version: %s\nLatest version: %s
popup.update.question=Do you want to update?
popup.update.success=Downloaded the latest version of ViaProxy. ViaProxy will now restart!
tab.ui_settings.crowdin.info=Is your language missing or incomplete? Help us to translate ViaProxy on Crowdin!
tab.ui_settings.crowdin.link=Click here to go to Crowdin

View File

@ -86,6 +86,8 @@ tab.ui_settings.name=UI 설정
tab.ui_settings.language.label=언어 선택:
tab.ui_settings.language.completion=%s 번역됨
tab.ui_settings.language.success=%s (%s)으로 언어 변경에 성공했습니다. ViaProxy가 곧 재시작합니다.
tab.ui_settings.crowdin.info=언어가 없거나 미완성되었나요? Crowdin에서 ViaProxy 번역에 도움을 주실 수 있어요!
tab.ui_settings.crowdin.link=클릭해서 Crowdin 가기
popup.login_account.title=계정 추가
popup.login_account.instructions.browser=브라우저에서 이 링크를 열어주세요:
popup.login_account.instructions.close=이 창은 당신이 로그인한 뒤 자동으로 닫힙니다.
@ -93,5 +95,3 @@ popup.download.title=다운로드 중...
popup.update.info=ViaProxy의 구버전을 사용하고 있습니다!\n현재 버전: %s\n최신 버전: %s
popup.update.question=업데이트 하시겠습니까?
popup.update.success=ViaProxy 최신 버전이 다운로드되었습니다. ViaProxy가 곧 재시작합니다.
tab.ui_settings.crowdin.info=언어가 없거나 미완성되었나요? Crowdin에서 ViaProxy 번역에 도움을 주실 수 있어요!
tab.ui_settings.crowdin.link=클릭해서 Crowdin 가기

View File

@ -86,6 +86,8 @@ tab.ui_settings.name=界面设置
tab.ui_settings.language.label=语言:
tab.ui_settings.language.completion=已翻译%s
tab.ui_settings.language.success=语言已更改为%s%s。ViaProxy即将重新启动
tab.ui_settings.crowdin.info=你的语言是否缺失或不完整帮助我们在Crowdin上翻译 ViaProxy
tab.ui_settings.crowdin.link=单击此处前往Crowdin
popup.login_account.title=添加账户
popup.login_account.instructions.browser=请在浏览器中打开以下URL
popup.login_account.instructions.close=登录后,弹窗将自动关闭。
@ -93,5 +95,3 @@ popup.download.title=正在下载…
popup.update.info=你正在使用过时的ViaProxy版本\n当前版本%s\n最新版本%s
popup.update.question=是否更新?
popup.update.success=已下载最新版本的ViaProxy。ViaProxy即将重新启动
tab.ui_settings.crowdin.info=你的语言是否缺失或不完整帮助我们在Crowdin上翻译 ViaProxy
tab.ui_settings.crowdin.link=单击此处前往Crowdin

View File

@ -86,6 +86,8 @@ tab.ui_settings.name=介面
tab.ui_settings.language.label=語言:
tab.ui_settings.language.completion=已翻譯 %s
tab.ui_settings.language.success=語言已變更為%s%s。ViaProxy 即將重新啟動!
tab.ui_settings.crowdin.info=你使用的語言有缺失嗎? 在Crowdin上幫助ViaProxy翻譯吧!
tab.ui_settings.crowdin.link=點這裡前往Crowdin
popup.login_account.title=新增帳號
popup.login_account.instructions.browser=請在瀏覽器中開啟以下 URL
popup.login_account.instructions.close=登入後,彈出式視窗將自動關閉。
@ -93,5 +95,3 @@ popup.download.title=正在下載...
popup.update.info=你正在使用的 ViaProxy 版本太舊!\n目前版本%s\n最新版本%s
popup.update.question=你想要更新嗎?
popup.update.success=已下載 ViaProxy 的最新版本。ViaProxy 即將重新啟動!
tab.ui_settings.crowdin.info=你使用的語言有缺失嗎? 在Crowdin上幫助ViaProxy翻譯吧!
tab.ui_settings.crowdin.link=點這裡前往Crowdin