Moin
8 Aprile 2024, 2:34pm
1
Il menu a discesa della lingua nelle traduzioni del tema sembra utilizzare la locale del sito al caricamento iniziale, mentre le traduzioni vengono mostrate nella locale dell’utente.
La locale predefinita del mio sito è il tedesco e la locale del mio utente è l’inglese. Quando apro le impostazioni del Dark-Light Toggle, la traduzione appare così:
Quindi, il menu a discesa mostra il tedesco (locale del sito), ma ‘Toggle color scheme’ è in inglese (locale personale).
Quando cambio la lingua nel menu a discesa in inglese, sia il menu a discesa che la traduzione sono in inglese.
E quando scelgo il tedesco successivamente, sia il menu a discesa che la traduzione sono in tedesco.
Mi aspetterei che una di queste appaia quando apro le impostazioni. Il mix crea la falsa impressione che non esista una traduzione in tedesco.
3 Mi Piace
gabriel
(Gabriel Grubba)
19 Aprile 2024, 5:50pm
7
Abbiamo buone notizie!
Questo problema è stato risolto:
main ← fix/locale-mismatch-at-theme-translations
opened 02:55PM - 19 Apr 24 UTC
Before, the theme translations picker value was set to the site's default locale… , which mismatches from the user's locale.
This commit changes the picker value to the user locale.
relates to https://meta.discourse.org/t/locale-mismatch-at-theme-translations/302879
<details>
<summary>Before</summary>
<img width="1397" alt="Screenshot 2024-04-19 at 11 46 13" src="https://github.com/discourse/discourse/assets/70247653/0a4d2b65-e857-4ebf-a5b2-bf5f32f1e8f7">
_You can see in the left-right corner that the picker is not consistent_
</details>
<details>
<summary>Now</summary>
<img width="1399" alt="Screenshot 2024-04-19 at 11 42 54" src="https://github.com/discourse/discourse/assets/70247653/7cb2933c-55fa-4165-8e6f-6ed061d08890">
</details>
> [!NOTE]
> Is there a better way to get the user's locale session? I used ruby [I18n.locale](https://github.com/discourse/discourse/blob/a45b2b1124e71a1d9fd8af2b53f69efdf5dba2af/app/assets/javascripts/admin/addon/routes/admin-customize-themes-show.js#L44) for [consistency](https://stackoverflow.com/questions/673905/how-can-i-determine-a-users-locale-within-the-browser).
Grazie per la pazienza; se hai problemi, faccelo sapere!
7 Mi Piace
Questo argomento è stato chiuso automaticamente dopo 2 giorni. Non sono più consentite nuove risposte.