diff --git a/.github/config.yml b/.github/config.yml deleted file mode 100644 index 5e14ed2..0000000 --- a/.github/config.yml +++ /dev/null @@ -1,4 +0,0 @@ -pull_request_templates: - - .github/PULL_REQUEST_TEMPLATE/01-add-an-alternative.md - - .github/PULL_REQUEST_TEMPLATE/02-site-changes.md - - .github/PULL_REQUEST_TEMPLATE/03-chore-stuff.md diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml new file mode 100644 index 0000000..4d3d0d3 --- /dev/null +++ b/.github/workflows/translations.yml @@ -0,0 +1,63 @@ +name: Crowdin translations stuff + +run-name: Update from Crowdin + +on: + schedule: + - cron: "0 */12 * * *" + workflow_dispatch: + +permissions: + contents: write + +jobs: + crowdin-translations-progress: + name: Crowdin translations progress updater + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Generate Crowdin translations progress markdown + uses: benjaminjonard/crowdin-translations-progress-action@1.0.7 + with: + languages_per_row: 10 + minimum_completion_percent: 80 + file: README.md + env: + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} + + - name: Push changes + uses: actions-go/push@v1 + with: + author-name: Actionsbot + author-email: actions@github.com + commit-message: 'Update Crowdin translation progress badge' + remote: origin + + update-from-crowdin: + name: Update strings from Crowdin + runs-on: ubuntu-latest + steps: + - name: Grab strings from Crowdin + uses: crowdin/github-action@v2.0.0 + with: + config: crowdin.yml + upload_sources: true + upload_translations: false + upload_language: us + download_sources: true + download_translations: true + skip_untranslated_files: true + skip_untranslated_strings: true + export_only_approved: true + localization_branch_name: i18n-crowdin-translations + create_pull_request: true + pull_request_title: (Crowdin Action) New translation strings + pull_request_body: New translated strings are now available! + pull_request_labels: crowdin + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md index bc5ca23..adef542 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,12 @@ A website linking to mods that can substitute Essential's features. ## I want to help! Review our contributing guidelines at [CONTRIBUTING.md](./CONTRIBUTING.md) + +## Translation progress + +Only useful to maintainers and translators. + + + + + \ No newline at end of file diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 0000000..38af476 --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,3 @@ +files: + - source: /i18n/lang/en-US.json + translations: %original_path%/%locale%.json \ No newline at end of file diff --git a/i18n/i18n.config.ts b/i18n/i18n.config.ts index d908fbf..939ee5d 100644 --- a/i18n/i18n.config.ts +++ b/i18n/i18n.config.ts @@ -1,10 +1,10 @@ import enUS from "./lang/en-US.json" -import enLOL from "./lang/lol.json" +import enLOL from "./lang/en-LOL.json" import enUD from "./lang/en-UD.json" -import ruRU from "./lang/ru.json" -import deDE from "./lang/de.json" +import ruRU from "./lang/ru-RU.json" +import deDE from "./lang/de-DE.json" import esES from "./lang/es-ES.json" -import noNO from "./lang/no.json" +import noNO from "./lang/no-NO.json" import ptBR from "./lang/pt-BR.json" export default defineI18nConfig(() => ({ @@ -12,7 +12,7 @@ export default defineI18nConfig(() => ({ fallbackLocale: "en", locale: "en", messages: { - en: enUS, + "en-US": enUS, "en-UD": enUD, "en-LOL": enLOL, ru: ruRU, diff --git a/i18n/lang/de.json b/i18n/lang/de-DE.json similarity index 100% rename from i18n/lang/de.json rename to i18n/lang/de-DE.json diff --git a/i18n/lang/lol.json b/i18n/lang/en-LOL.json similarity index 100% rename from i18n/lang/lol.json rename to i18n/lang/en-LOL.json diff --git a/i18n/lang/no.json b/i18n/lang/no-NO.json similarity index 100% rename from i18n/lang/no.json rename to i18n/lang/no-NO.json diff --git a/i18n/lang/ru.json b/i18n/lang/ru-RU.json similarity index 100% rename from i18n/lang/ru.json rename to i18n/lang/ru-RU.json