home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.14k stars 29.82k forks source link

Translations: Use references in config flow #40578

Closed MartinHjelmare closed 3 years ago

MartinHjelmare commented 3 years ago

The problem

Integrations

Environment

Problem-relevant configuration.yaml

Traceback/Error logs

Additional information

teharris1 commented 3 years ago

I believe the insteon component is good since my last PR. I just had a look at it and I don't see any strings I would further adjust. All but a few use standard references.

MartinHjelmare commented 3 years ago

I checked that box now.

RobBie1221 commented 3 years ago

dsmr and rfxtrx are also good in dev branch, the latter I'll double check in the options branch

bieniu commented 3 years ago

I think the accuweather integration uses all available references.

bieniu commented 3 years ago

Also dunehd is OK.

Danielhiversen commented 3 years ago

Mill should be ok: https://github.com/home-assistant/core/blob/dev/homeassistant/components/mill/strings.json Met should be ok: https://github.com/home-assistant/core/blob/dev/homeassistant/components/met/strings.json

MartinHjelmare commented 3 years ago

The met integration should replace name_exists with already_configured.

SNoof85 commented 3 years ago

Just to get correct indications :

MartinHjelmare commented 3 years ago
SNoof85 commented 3 years ago

Blink is already OK : https://github.com/home-assistant/core/blob/dev/homeassistant/components/blink/strings.json Bond is already OK : https://github.com/home-assistant/core/blob/dev/homeassistant/components/bond/strings.json

MartinHjelmare commented 3 years ago

Note that we don't change user input data keys unless it's clearly completely safe. Usually this is not safe to do since those keys are used in the config entry data.

SNoof85 commented 3 years ago

Canary is OK : https://github.com/home-assistant/core/blob/dev/homeassistant/components/canary/strings.json control4 is OK : https://github.com/home-assistant/core/blob/dev/homeassistant/components/control4/strings.json dexcom is OK : https://github.com/home-assistant/core/blob/dev/homeassistant/components/dexcom/strings.json dialogflow is OK : https://github.com/home-assistant/core/blob/dev/homeassistant/components/dialogflow/strings.json eafm is OK : https://github.com/home-assistant/core/blob/dev/homeassistant/components/eafm/strings.json

Time for a break !

MartinHjelmare commented 3 years ago

dexcom should rename these keys to the standard names: https://github.com/home-assistant/core/blob/bba0bb1badcd80c52d640d5576314bddca7ae6a8/homeassistant/components/dexcom/strings.json#L15-L16

epenet commented 3 years ago

Does it make sense to keep partial strings?!? How will it work for translations? For example on PR #41057 we have "[%key:common::config_flow::abort::already_configured_service%] for this country."

In English it would become "Service is already configured for this country." But in French would it become "Service déjà configuré for this country."?

MartinHjelmare commented 3 years ago

Each language will get it's own translation. But yes, since the grammar is different between languages the composition of a reference and additional text might not work well.

epenet commented 3 years ago

So, is it encouraged as part of this Hacktoberfest? Or is it discouraged? Personnally I prefer to have a full string in French, or a full string in English, but not a dodgy mix. And I prefer a good English string, than a grammatically wrong French string.

SNoof85 commented 3 years ago

If we stick to English and French examples :

Works good, but i can't guarantee in other languages...for sure !

So...

Spartan-II-117 commented 3 years ago

Yeelight is already good.

groot406 commented 3 years ago

If we update a key in the strings.json, should we also update that key in all translation files? It seems like they won't be loaded anymore if the key's don't match.

MartinHjelmare commented 3 years ago

No, don't touch the translation files. They will be updated by our infrastructure, or manually by an admin change.

RobBie1221 commented 3 years ago

monoprice and somfy are done

MartinHjelmare commented 3 years ago

Somfy should update missing configuration key to: https://github.com/home-assistant/core/blob/ed867955f4ca76ed027765a22237bd762758f730/homeassistant/strings.json#L57

RobBie1221 commented 3 years ago

Ok, that was missed in #40594. Will add them in a new PR

thijsdejong commented 3 years ago

tradfri, xiaomi_miio, xiaomi_aqara, tesla, toon, pi_hole, mailgun, sentry are all good

MartinHjelmare commented 3 years ago

No, only mail gun and sentry are completely good with the available common references.

RobBie1221 commented 3 years ago

somfy and home connect should be fine now

davet2001 commented 3 years ago

What do we do if we find /components/xxxx/strings.json entries that aren't used anywhere? Should we delete them? If so I assume in a separate PR.

MartinHjelmare commented 3 years ago

Yes, please clean up if you find orphan strings. Note that we have helpers that abort and need corresponding strings in each integration, eg self._abort_if_unique_id_configured needs already_configured.

Pigotka commented 3 years ago

tuya is fine

SNoof85 commented 3 years ago

nightscout is OK : https://github.com/home-assistant/core/blob/dev/homeassistant/components/nightscout/strings.json plum_lightpad is OK : https://github.com/home-assistant/core/blob/dev/homeassistant/components/plum_lightpad/strings.json poolsense is OK : https://github.com/home-assistant/core/blob/dev/homeassistant/components/poolsense/strings.json progettihwsw is OK : https://github.com/home-assistant/core/blob/dev/homeassistant/components/progettihwsw/strings.json

MartinHjelmare commented 3 years ago

Tuya should replace the keys auth_failed and conn_error with invalid_auth and cannot_connect.

Pigotka commented 3 years ago

Gpslogger is OK: https://github.com/home-assistant/core/blob/dev/homeassistant/components/gpslogger/strings.json Griddy can reuse already_configured but is marked as done. Can I take it? https://github.com/home-assistant/core/blob/dev/homeassistant/components/griddy/strings.json

SNoof85 commented 3 years ago

Gpslogger is OK: https://github.com/home-assistant/core/blob/dev/homeassistant/components/gpslogger/strings.json Griddy can reuse already_configured but is marked as done. Can I take it? https://github.com/home-assistant/core/blob/dev/homeassistant/components/griddy/strings.json

Griddy was done from me, and i thought that the generic error message doesn't fit with the explicit message set in the strings.json That is just a personnal feeling.

outadoc commented 3 years ago

SmartHab should already be good as well.

SNoof85 commented 3 years ago

Alarmdecoder looks good : https://github.com/home-assistant/core/blob/dev/homeassistant/components/alarmdecoder/strings.json hlk_sw16 looks good : https://github.com/home-assistant/core/blob/dev/homeassistant/components/hlk_sw16/strings.json Kodi looks good : https://github.com/home-assistant/core/blob/dev/homeassistant/components/kodi/strings.json mobile is fine : https://github.com/home-assistant/core/blob/dev/homeassistant/components/mobile_app/strings.json

davet2001 commented 3 years ago

guardian looks good https://github.com/home-assistant/core/blob/dev/homeassistant/components/guardian/strings.json spider looks good https://github.com/home-assistant/core/blob/dev/homeassistant/components/spider/strings.json nzbget looks good https://github.com/home-assistant/core/blob/dev/homeassistant/components/nzbget/strings.json

MartinHjelmare commented 3 years ago

We should replace the wrong_login key with invalid_auth for smarthab.

MartinHjelmare commented 3 years ago

We should replace the service_unavailable key with cannot_connect for alarmdecoder.

SNoof85 commented 3 years ago

Tomorrow evening I should have enough time to make a full pass on all. Maybe not open PR for all but at least give a full status 👍

spacegaier commented 3 years ago

speedtestdotnet can now also receive the checkmark, since related PR #41139 has been merged.

scheric commented 3 years ago

Ambiclimate, Dexcom, Rfxtrx, sharkiq, Smappee, VIZIO, Withings Use"already_configured_account": or "already_configured_device": the rest (132(144) intergrations) use "already_configured": Should "already_configured_account": and "already_configured_device": be replaced by "already_configured": in these intergrations?

MartinHjelmare commented 3 years ago

Yes, please.

SNoof85 commented 3 years ago

Tomorrow evening I should have enough time to make a full pass on all. Maybe not open PR for all but at least give a full status 👍

Ehh I did not found the time to to this and I think with the complications I have right now in personal life I won't be able to make a full pass before a while. Sorry, I won't be able to help more on the topic, good job until now from all pple around here :) I know it will be done great :)

MartinHjelmare commented 3 years ago

Thanks @SNoof85! Great job!

briglx commented 3 years ago

@MartinHjelmare looks like zerproc has nothing to change.

GauthamVarmaK commented 3 years ago

If any reviewers are free please have a look at the open pulls related to this issue, so we can check more items in the list😁

briglx commented 3 years ago

@MartinHjelmare you can update the checkbox for xiaomi_miio

MartinHjelmare commented 3 years ago

Should we replace the name key too in the data section for xiamoi_miio? https://github.com/home-assistant/core/blob/0f1011ba3f5b2f9b75d8dbcd52b012bcd1e4143c/homeassistant/strings.json#L29

ronal2do commented 3 years ago

Flo, Geofency, Emulated_roku, Wled, Enocean, Gogogate2, ifttt, wolflink looks already done https://github.com/home-assistant/core/blob/dev/homeassistant/components/flo/strings.json

wouterbaake commented 3 years ago

https://github.com/home-assistant/core/blob/dev/homeassistant/components/shelly/strings.json only contains references to common strings. This one can be marked as done.