Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
Translations
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-codechimp committed Jun 4, 2024
1 parent 73cc11d commit 24b8bb1
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/new_language_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: New Language
description: Submit a request for a new language to be created in Crowdin for translation.
title: "New Language"
labels: ["new-language"]
body:
- type: markdown
attributes:
value: |
To learn more about adding a new language see [here](https://github.com/andrew-codechimp/HA-Mealie#translations)
- type: input
id: language
attributes:
label: Language
description: The language you would like to submit translations for.
validations:
required: true
32 changes: 32 additions & 0 deletions .github/workflows/crowdin-download.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Crowdin download

on:
workflow_dispatch:
schedule:
- cron: "0 6 * * *"

permissions: write-all

jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: crowdin action
uses: crowdin/github-action@v1
with:
upload_sources: false
upload_translations: false
download_translations: true
localization_branch_name: crowdin
create_pull_request: true
pull_request_title: 'Update translations'
pull_request_body: 'New Crowdin translations submitted'
pull_request_base_branch_name: 'main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/crowdin-upload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Crowdin upload

on:
push:
paths:
- custom_components/mealie/translations/*
branches: [ main ]
workflow_dispatch:

jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: crowdin action
uses: crowdin/github-action@v1
with:
upload_sources: true
upload_translations: true
download_translations: false
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,39 @@ mealie:
dinner_end: "21:00"
```

## Translations

You can help by adding missing translations when you are a native speaker. Or add a complete new language when there is no language file available.

Mealie uses Crowdin to make contributing easy.

<details>
<summary>Show detailed instructions</summary>

### Changing or adding to existing language

First register and join the translation project

- If you don’t have a Crowdin account yet, create one at [https://crowdin.com](https://crowdin.com)
- Go to the [HA-Mealie Crowdin project page](https://crowdin.com/project/ha-mealie)
- Click Join.

Next translate a string

- Select the language you want to contribute to from the dashboard.
- Click Translate All.
- Find the string you want to edit, missing translation are marked red.
- Fill in or modify the translation and click Save.
- Repeat for other translations.

GitHub will automatically pull in latest changes to translations every day and create a Pull Request. After that is reviewed by a maintainer it will be included in the next release of Mealie.

### Adding a new language

Create an [Issue](https://github.com/andrew-codechimp/HA-Mealie/issues/new?template=new_language_request.yml&title=New+Language) requesting a new language. We will do the necessary work to add the new translation to the integration and Crowdin site, when it's ready for you to contribute we'll comment on the issue you raised.
</details>


***

[commits-shield]: https://img.shields.io/github/commit-activity/y/andrew-codechimp/HA-Mealie.svg?style=for-the-badge
Expand Down
11 changes: 11 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"project_id_env": "CROWDIN_PROJECT_ID"
"api_token_env": "CROWDIN_PERSONAL_TOKEN"
"base_path": "."
"base_url": "https://api.crowdin.com"
"preserve_hierarchy": true
files: [
{
"source": "/custom_components/mealie/translations/en.json",
"translation": "/custom_components/mealie/translations/%two_letters_code%.json",
}
]

0 comments on commit 24b8bb1

Please sign in to comment.