Strings to be translated duplication

Hello,

While writing my AirZone addon, I have created a airzone.properties file located in the src\main\resources\OH-INF\i18n folder. It gets used just fine, but I have noticed that I have some identical words / sentences associated to multiple keys. For instance, I have this:

channel-options.airzone.zone.sleep.off = Off
channel-options.airzone.zone.air-quality-mode.off = Off
channel-options.airzone.zone.air-quality.off = Off
channel-options.airzone.zone.eco-adapt.off = Off

I feels a bit cumbersome to require translators to repeat 4 times the translation for Off, when it’s the same in all cases.
I was thinking of creating a single key like this:

channel-options.airzone...off = Off

But is that considered a good practice in the openHAB environment?

I completely agree with your observation, being a translator, validating 8 times that CLOSED means FERMÉ is a bit wearing. I think it can be wrapped by using @text annotations in resources files but during development it s really not easy

2 Likes

Yes, being on both sides of the fence, it’s really tedious to have to repeat the same string over and over.
I really much prefer the GNU gettext approach but it seems people insist on using resource files…