Skip to content

Commit

Permalink
add: Crowdin Actions integration
Browse files Browse the repository at this point in the history
not sure if this is a mistake instead of using the Crowdin CLI but we'll see
  • Loading branch information
KTrain5169 committed Jul 22, 2024
1 parent 4e46e22 commit 6750548
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 9 deletions.
4 changes: 0 additions & 4 deletions .github/config.yml

This file was deleted.

63 changes: 63 additions & 0 deletions .github/workflows/translations.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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: [email protected]
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/[email protected]
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 }}
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
<!-- CROWDIN-TRANSLATIONS-PROGRESS-ACTION-START -->



<!-- CROWDIN-TRANSLATIONS-PROGRESS-ACTION-END -->
3 changes: 3 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
files:
- source: /i18n/lang/en-US.json
translations: %original_path%/%locale%.json
10 changes: 5 additions & 5 deletions i18n/i18n.config.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
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(() => ({
legacy: false,
fallbackLocale: "en",
locale: "en",
messages: {
en: enUS,
"en-US": enUS,
"en-UD": enUD,
"en-LOL": enLOL,
ru: ruRU,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 6750548

Please sign in to comment.