From 34cd84c3c53598e22fb1e7c215e45f10d7ecca91 Mon Sep 17 00:00:00 2001 From: Andrew Jackson Date: Sat, 10 Feb 2024 10:40:36 +0000 Subject: [PATCH] Translations --- .../ISSUE_TEMPLATE/new_language_request.yml | 17 +++++++++++ .github/workflows/crowdin-download.yaml | 4 +-- README.md | 4 +++ docs/translations.md | 30 +++++++++++++++++++ mkdocs.yml | 1 + 5 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/new_language_request.yml create mode 100644 docs/translations.md diff --git a/.github/ISSUE_TEMPLATE/new_language_request.yml b/.github/ISSUE_TEMPLATE/new_language_request.yml new file mode 100644 index 000000000..74a0d396f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/new_language_request.yml @@ -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://andrew-codechimp.github.io/HA-Battery-Notes/translations) + + - type: input + id: language + attributes: + label: Language + description: The language you would like to submit translations for. + validations: + required: true diff --git a/.github/workflows/crowdin-download.yaml b/.github/workflows/crowdin-download.yaml index 929bb7d1d..45fe3de81 100644 --- a/.github/workflows/crowdin-download.yaml +++ b/.github/workflows/crowdin-download.yaml @@ -2,8 +2,8 @@ name: Crowdin download on: workflow_dispatch: - # schedule: - # - cron: '0 * * * *' + schedule: + - cron: "0 0 * * *" permissions: write-all diff --git a/README.md b/README.md index a437a9834..61bf1ab5a 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,10 @@ To get full use of the integration, please visit the [docs](https://andrew-codec To add a device definition to the battery library so that it will be automatically configured fill out the above form or see the [docs](https://andrew-codechimp.github.io/HA-Battery-Notes/library) for adding via pull request. +## Translations + +To add a new language translation to Battery Notes see [here](https://andrew-codechimp.github.io/HA-Battery-Notes/translations) + ## Contributions are welcome! If you want to contribute to this please read the [Contribution guidelines](CONTRIBUTING.md). diff --git a/docs/translations.md b/docs/translations.md new file mode 100644 index 000000000..d81f19c00 --- /dev/null +++ b/docs/translations.md @@ -0,0 +1,30 @@ +# 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. + +Battery Notes uses Crowdin to make contributing easy. + +## 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 +- Go to the [Battery Notes Crowdin project page](https://crowdin.com/project/battery-notes) +- 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. + +!!! info + + Battery Notes 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 Battery Notes. + +## Adding a new language + +Create an [Issue](https://github.com/andrew-codechimp/HA-Battery-Notes/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. + diff --git a/mkdocs.yml b/mkdocs.yml index 17d5f928d..92e729657 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -11,6 +11,7 @@ nav: - Library: library.md - Configuration: configuration.md - Community: community.md + - Translations: translations.md - FAQ: faq.md markdown_extensions: