Language support question: Regional settings language vs. browser language

Hi,

Currently I see a lot of pull request adding default i18n properties files and also a lot of Crowdin updates. It almost seems like a coordinated effort, although I can’t see anything mentioned here. :slight_smile: But I got curious as I already had some internationalization on my TODO for the Miele binding as it exposes some localized strings through channels that would be nice to have translated.

So to get myself started I added a i18n/miele.properties file as well as miele_da.properties. My openHAB 3.1 installation is English, but yet the new Danish strings started to appear in Main UI. It took me some time and experiments to figure out why, and it turned out to be because of my browser settings preferring Danish over English.

Which leads to first question: Which parts of openHAB should be localized according to openHAB setting and which parts according to browser settings?

Example:

In this example German is configured as language (shown as “tysk” because of browser settings set to Danish). Headline is “Regionale Einstellungen”, so German. Everything fine so far. Now, let’s go back to my initial settings:

Now, with English configured as language, let’s have a look at the things from the binding where two strings now exists in English (miele.properties) and Danish (miele_da.properties):

These strings are displayed in Danish because of browser settings. Is this behavior intentional - and perhaps documented somewhere?

Somewhat related question: If the pull requests currently appearing with default properties files are coordinated, can anyone share the reason/plan? I can deduct that we need them in order to have texts translated from English at Crowdin. Have all binding developers been encouraged to provide these files?

Last question for now: It seems to me that after creating the texts in the properties file, they should be referenced by the XML files and removed from there to not have redundant/duplicated texts which will get out of sync over time. I didn’t see this in at least a few PR’s. If this fully supported, or planned?

Best regards,
Jacob Laursen

Yes the .properties files are needed for Crowdin translations. There is a PR for a Maven plug-in which makes it a lot more fun to generate these from the existing XML :slight_smile: :

If there is a lot of duplication in strings it makes sense to use @text/ identifiers for these texts.

I think that the different languages being used in the UI is a bug. IMHO the UI/backend should respect the configured language in the browser and only use the configured locale in OH as fallback, see also:

Many operations on the openHAB REST API already use the Accept-Language headers sent by the browser to determine the locale and use the configured openHAB locale only as fallback when this header is not present.

1 Like

@wborn - thanks for the details, exactly the information I was looking for. Really cool plugin, I will use that. :slightly_smiling_face:

Best regards,
Jacob Laursen

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.