Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default translations for binding add-ons #11760

Merged
merged 4 commits into from
Dec 15, 2021

Conversation

wborn
Copy link
Member

@wborn wborn commented Dec 12, 2021

This makes the texts used by these add-ons translatable with Crowdin.

To keep the PR simple, it only adds default translations for add-ons which do not yet have any default translations properties file.
We can do follow up PRs for adding missing key/values to add-ons that already have these files or to remove duplications.

There are several add-ons in this PR that do have non-English translation files, so I'll upload those to Crowdin when the PR is merged.

This makes the texts used by these add-ons translatable with Crowdin.

To keep the PR simple, it only adds default translations for add-ons which do not yet have any default translations properties file.
We can do follow up PRs for adding missing key/values to add-ons that already have these files or to remove duplications.

There are several add-ons in this PR that do have non-English translation files, so I'll upload those to Crowdin when the PR is merged.

Signed-off-by: Wouter Born <github@maindrain.net>
Signed-off-by: Wouter Born <github@maindrain.net>
@lolodomo
Copy link
Contributor

@wborn : how do you want to proceed ? Noone will check in details all these files. We are confident in your tool and we just merge if it builds ?

@wborn
Copy link
Member Author

wborn commented Dec 12, 2021

Noone will check in details all these files. We are confident in your tool and we just merge if it builds ?

I would keep it open for a couple of hours so there is some time for comments like yours and then merge it today.

Copy link
Member

@bobadair bobadair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! LGTM for the Alarm Decoder and Lutron bindings. Can you make the script available to sync new changes from the XML files to the default language properties files?

@wborn
Copy link
Member Author

wborn commented Dec 12, 2021

It's not a script but a Maven plug-in 😉, see openhab/openhab-core#2544.

You can run it using:

mvn i18n:generate-default-translations

Copy link
Contributor

@ecdye ecdye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for OmniLink

Signed-off-by: Wouter Born <github@maindrain.net>
Copy link

@kabili207 kabili207 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LIRC looks good

Signed-off-by: Wouter Born <github@maindrain.net>
@lolodomo lolodomo merged commit 07a1976 into openhab:main Dec 15, 2021
@lolodomo
Copy link
Contributor

Time to inject all that in Crowdin :)

@lolodomo lolodomo added this to the 3.2 milestone Dec 15, 2021
@wborn wborn deleted the translatable-binding-addons branch December 15, 2021 17:43
@lolodomo
Copy link
Contributor

@wborn : do you have an easy way to rerun your command for the same list of bindings ?
I already know that some entries are missing for few bindings because I/we recently merged PRs that did not care about this default properties file, like wled or omnikonverter for example.

@wborn
Copy link
Member Author

wborn commented Dec 19, 2021

On the CLI you can do something like this with Bash at the repo root:

$ mvn i18n:generate-default-translations
$ git diff-tree --no-commit-id --name-only -r 07a1976c817e92d0b1274b4686cabd3442c8ec12 | xargs -I{} git add {}
$ git commit -m "Modified translations"
$ git add .
$ git reset --hard
$ git reset HEAD^
$ git status
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   bundles/org.openhab.binding.atlona/src/main/resources/OH-INF/i18n/atlona.properties
	modified:   bundles/org.openhab.binding.autelis/src/main/resources/OH-INF/i18n/autelis.properties
	modified:   bundles/org.openhab.binding.benqprojector/src/main/resources/OH-INF/i18n/benqprojector.properties
	modified:   bundles/org.openhab.binding.daikin/src/main/resources/OH-INF/i18n/daikin.properties
	modified:   bundles/org.openhab.binding.deutschebahn/src/main/resources/OH-INF/i18n/deutschebahn.properties
	modified:   bundles/org.openhab.binding.hydrawise/src/main/resources/OH-INF/i18n/hydrawise.properties
	modified:   bundles/org.openhab.binding.magentatv/src/main/resources/OH-INF/i18n/magentatv.properties
	modified:   bundles/org.openhab.binding.monopriceaudio/src/main/resources/OH-INF/i18n/monopriceaudio.properties
	modified:   bundles/org.openhab.binding.nuvo/src/main/resources/OH-INF/i18n/nuvo.properties
	modified:   bundles/org.openhab.binding.omnikinverter/src/main/resources/OH-INF/i18n/omnikinverter.properties
	modified:   bundles/org.openhab.binding.teleinfo/src/main/resources/OH-INF/i18n/teleinfo.properties
	modified:   bundles/org.openhab.binding.wled/src/main/resources/OH-INF/i18n/wled.properties

It reruns the plugin on all add-ons and then only adds the files in my commit to another commit... and then cleans all modified/untracked files in the workspace and undos the commit.

NickWaterton pushed a commit to NickWaterton/openhab-addons that referenced this pull request Dec 30, 2021
* Add default translations for binding add-ons

This makes the texts used by these add-ons translatable with Crowdin.

To keep the PR simple, it only adds default translations for add-ons which do not yet have any default translations properties file.
We can do follow up PRs for adding missing key/values to add-ons that already have these files or to remove duplications.

There are several add-ons in this PR that do have non-English translation files, so I'll upload those to Crowdin when the PR is merged.

Signed-off-by: Wouter Born <github@maindrain.net>
Signed-off-by: Nick Waterton <n.waterton@outlook.com>
mischmidt83 pushed a commit to mischmidt83/openhab-addons that referenced this pull request Jan 9, 2022
* Add default translations for binding add-ons

This makes the texts used by these add-ons translatable with Crowdin.

To keep the PR simple, it only adds default translations for add-ons which do not yet have any default translations properties file.
We can do follow up PRs for adding missing key/values to add-ons that already have these files or to remove duplications.

There are several add-ons in this PR that do have non-English translation files, so I'll upload those to Crowdin when the PR is merged.

Signed-off-by: Wouter Born <github@maindrain.net>
Signed-off-by: Michael Schmidt <mi.schmidt.83@gmail.com>
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Jan 28, 2022
* Add default translations for binding add-ons

This makes the texts used by these add-ons translatable with Crowdin.

To keep the PR simple, it only adds default translations for add-ons which do not yet have any default translations properties file.
We can do follow up PRs for adding missing key/values to add-ons that already have these files or to remove duplications.

There are several add-ons in this PR that do have non-English translation files, so I'll upload those to Crowdin when the PR is merged.

Signed-off-by: Wouter Born <github@maindrain.net>
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this pull request May 5, 2022
* Add default translations for binding add-ons

This makes the texts used by these add-ons translatable with Crowdin.

To keep the PR simple, it only adds default translations for add-ons which do not yet have any default translations properties file.
We can do follow up PRs for adding missing key/values to add-ons that already have these files or to remove duplications.

There are several add-ons in this PR that do have non-English translation files, so I'll upload those to Crowdin when the PR is merged.

Signed-off-by: Wouter Born <github@maindrain.net>
andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
* Add default translations for binding add-ons

This makes the texts used by these add-ons translatable with Crowdin.

To keep the PR simple, it only adds default translations for add-ons which do not yet have any default translations properties file.
We can do follow up PRs for adding missing key/values to add-ons that already have these files or to remove duplications.

There are several add-ons in this PR that do have non-English translation files, so I'll upload those to Crowdin when the PR is merged.

Signed-off-by: Wouter Born <github@maindrain.net>
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Nov 12, 2022
* Add default translations for binding add-ons

This makes the texts used by these add-ons translatable with Crowdin.

To keep the PR simple, it only adds default translations for add-ons which do not yet have any default translations properties file.
We can do follow up PRs for adding missing key/values to add-ons that already have these files or to remove duplications.

There are several add-ons in this PR that do have non-English translation files, so I'll upload those to Crowdin when the PR is merged.

Signed-off-by: Wouter Born <github@maindrain.net>
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants