SUMMARY kde.org website opens in English by default. This is an undesirable behaviour. Instead, it should check the appropriate system locale, and display the localised version if available. Also, since the language selection is also in English "Languages", it is not intuitive for a non-English speaker to find. The icon does not help in this case. STEPS TO REPRODUCE 1. Visit kde.org with a non-English system OBSERVED RESULT The website displays in English by default. EXPECTED RESULT The website should have displayed the localised version. SOFTWARE/OS VERSIONS macOS: 12.2.1 Latest Safari and Firefox
While i'm not 100% familiar with how translation for our Hugo based websites is done, this is how I solved it for docs.krita.org: https://invent.kde.org/documentation/docs-krita-org/-/blob/master/404handler.php Note that this basically can't be done with Apache redirect rules due to all the special cases around language variants - especially for zh_* languages.
Git commit b972e36b9529e2f6b6879bc5243b3c245d0a1a1c by Phu Nguyen. Committed on 30/03/2022 at 00:36. Pushed by phunh into branch 'master'. Bump up kde-hugo Related: bug 429638 The system language is non-trivial to get, and the browser language is apparently good enough. Although this does not do what the bug report suggested, it solves the problem that the bug report is likely concerned about. M +0 -6 config.yaml M +1 -1 go.mod M +2 -2 go.sum https://invent.kde.org/websites/kde-org/commit/b972e36b9529e2f6b6879bc5243b3c245d0a1a1c
Thanks everyone!
For the other project sites like Plasma Mobile (at least the ones directly linked from kde.org, excluding individual application websites), shall I open a separate ticket or modify and reopen this one?
(In reply to emir_sari from comment #4) > For the other project sites like Plasma Mobile (at least the ones directly > linked from kde.org, excluding individual application websites), shall I > open a separate ticket or modify and reopen this one? The fix has been applied to our most popular sites (Hugo-based sites), including plasma-mobile.org. Could you check again? Other sites will automatically get this feature when and if they are converted to Hugo.
Hmm, curious. Not only Plasma Mobile website; but I emptied all cache, and visited kde.org, and it did not change language as well. Maybe the change did not reflect yet? It works with other localised web pages, so it should be working.
(In reply to emir_sari from comment #6) > Hmm, curious. Not only Plasma Mobile website; but I emptied all cache, and > visited kde.org, and it did not change language as well. Maybe the change > did not reflect yet? It works with other localised web pages, so it should > be working. Have you ever chosen a language in the language selector of kde.org? If yes, an item is set in your local storage for the site, maybe emptying the cache still leaves that behind. What language do you select in your browser for displaying pages?
Tried under Safari 15.4 and Firefox 98.0.2 KDE; both set to Turkish, all caches cleared.
(In reply to Emir Sarı from comment #8) > Tried under Safari 15.4 and Firefox 98.0.2 KDE; both set to Turkish, all caches cleared. Sorry for the spam-forgot to mention; haven't selected a language from kde.org selector after clearing the caches, above Turkish is the system/browser setting.
(In reply to Emir Sarı from comment #9) > Sorry for the spam-forgot to mention; haven't selected a language from > kde.org selector after clearing the caches, above Turkish is the > system/browser setting. As I said, clearing the cache doesn't remove the item from the site's local storage. For Firefox, could you click on the lock icon on the left of the URL then "Clear cookies and site data..."? As for the browser language, please make sure you set the language for displaying pages, not the language to display menus, messages, and notifications from Firefox.
Or let's do it like this: open the Web Developer Tools (press Ctrl+Shift+i), change to Console tab, there should be a pair of language codes there, in the form of "A - B". Tell me what are A and B.
(In reply to Phu H. Nguyen from comment #10) > As I said, clearing the cache doesn't remove the item from the site's local > storage. For Firefox, could you click on the lock icon on the left of the > URL then "Clear cookies and site data..."? Greyed out, already clear I presume. > As for the browser language, please make sure you set the language for > displaying pages, not the language to display menus, messages, and > notifications from Firefox. Yes, it's set for displaying pages. (In reply to Phu H. Nguyen from comment #11) > Or let's do it like this: open the Web Developer Tools (press Ctrl+Shift+i), > change to Console tab, there should be a pair of language codes there, in > the form of "A - B". Tell me what are A and B. `tr-TR - tr-tr`
Git commit 29c63557498912ea1fd9fa2a53159090f3228d99 by Phu Nguyen. Committed on 09/04/2022 at 13:14. Pushed by phunh into branch 'master'. Bump kde-hugo M +1 -1 go.mod M +2 -2 go.sum https://invent.kde.org/websites/kde-org/commit/29c63557498912ea1fd9fa2a53159090f3228d99
(In reply to Emir Sarı from comment #12) > `tr-TR - tr-tr` Many thanks for your answers. The problem lies in the language code: we haven't handled the case of "tr-TR". I have applied a fix for kde.org, and will do for other sites when you check that kde.org is fine. Is that the code you got on Safari? I suppose on Firefox you got tr only, right? I don't see any tr-XX code on Firefox.
Now it’s working as expected! Thank you very much. > Is that the code you got on Safari? I suppose on Firefox you got tr only, right? I don't see any tr-XX code on Firefox. No, that was Firefox. On Safari I get `tr-TR - tr`.
(In reply to Emir Sarı from comment #15) > Now it’s working as expected! Thank you very much. > > > Is that the code you got on Safari? I suppose on Firefox you got tr only, right? I don't see any tr-XX code on Firefox. > > No, that was Firefox. On Safari I get `tr-TR - tr`. Glad it works! Thanks for your support too! And TIL other than tr-TR, there is tr-CY too.
Git commit 03a31ab05bbbdaa99a1d4010fd148a330e9051ee by Phu Nguyen. Committed on 09/04/2022 at 13:44. Pushed by phunh into branch 'master'. Bump kde-hugo M +1 -1 go.mod M +2 -2 go.sum https://invent.kde.org/websites/apps-kde-org/commit/03a31ab05bbbdaa99a1d4010fd148a330e9051ee
Git commit 4acf67a51f77dabb612d6f7bcc2b52e9f5128fc8 by Phu Nguyen. Committed on 09/04/2022 at 13:46. Pushed by phunh into branch 'master'. Bump kde-hugo M +1 -1 go.mod M +2 -2 go.sum https://invent.kde.org/websites/okular-kde-org/commit/4acf67a51f77dabb612d6f7bcc2b52e9f5128fc8
Git commit 863beed1089beef5699ae4d17954f3321eb4a53c by Phu Nguyen. Committed on 09/04/2022 at 13:46. Pushed by phunh into branch 'master'. Bump kde-hugo M +1 -1 go.mod M +2 -2 go.sum https://invent.kde.org/websites/plasma-mobile-org/commit/863beed1089beef5699ae4d17954f3321eb4a53c