Update Languages.plist: NGObjWeb: map "tr"/"tr-tr" to TurkishTurkey (SOGo ships no Turkish.lproj) - #75
Open
ozgurkazancci wants to merge 1 commit into
Open
Update Languages.plist: NGObjWeb: map "tr"/"tr-tr" to TurkishTurkey (SOGo ships no Turkish.lproj)#75ozgurkazancci wants to merge 1 commit into
ozgurkazancci wants to merge 1 commit into
Conversation
…SOGo ships no Turkish.lproj)
## Problem
SOGo's Turkish translation is shipped only as `TurkishTurkey.lproj` (all 11 UI bundles in Alinto/sogo master; there is no `Turkish.lproj`). NGObjWeb's browser-language table
`sope-appserver/NGObjWeb/Languages.plist` still maps the bare code to the old name:
"tr" = "Turkish";
As a result a browser that sends `Accept-Language: tr-TR,tr` never reaches the Turkish translation: WOResourceManager looks for `Turkish.lproj`, logs
sogod [pid]: [ERROR] [we-rm] did not find locale for language: Turkish and SOGo falls back to English (login page, and the whole UI for every user who has not saved a language preference yet), regardless of `SOGoLanguage = TurkishTurkey` in sogo.conf.
## Reproduction (SOGo 5.12.9 + SOPE 4.9, OpenBSD 7.9 packages)
curl -sk -H 'Accept-Language: tr-TR,tr;q=0.9,en;q=0.5' https://mail.example.com/SOGo/ | grep -o '<html[^>]*lang="[^"]*"'
-> lang="en" (expected: Turkish)
curl -sk -H 'Accept-Language: de-DE,de;q=0.9' ... -> lang="de" (German works: "de" = "German" and German.lproj exists)
ls /usr/local/lib/GNUstep/SOGo/MainUI.SOGo/Resources/ | grep -i turk
TurkishTurkey.lproj (no Turkish.lproj)
## Fix
Point the mapping at the bundle that actually exists, exactly like the existing entries
for Spanish (`"es" = "SpanishSpain"`; SOGo ships `SpanishSpain.lproj`, no `Spanish.lproj`),
and add the regional key browsers send:
"tr" = "TurkishTurkey";
"tr-tr" = "TurkishTurkey";
## Verification
With the one-line change applied to the installed plist and sogod restarted:
Accept-Language: tr-TR,tr;q=0.9,en;q=0.5 -> <html lang="tr-TR">
Accept-Language: en-US,en;q=0.9 -> lang="en" (unchanged)
Accept-Language: de-DE,de;q=0.9 -> lang="de" (unchanged)
sogo.log: no further "did not find locale for language: Turkish" entries
Verified on three OpenBSD 7.9 hosts (SOGo 5.12.9, sope-4.9 packages). Users who have explicitly saved another language in Preferences are not affected; only the browser-language detection changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
SOGo's Turkish translation is shipped only as
TurkishTurkey.lproj(all 11 UI bundles in Alinto/sogo master; there is noTurkish.lproj). NGObjWeb's browser-language tablesope-appserver/NGObjWeb/Languages.pliststill maps the bare code to the old name:As a result a browser that sends
Accept-Language: tr-TR,trnever reaches the Turkish translation: WOResourceManager looks forTurkish.lproj, logssogod [pid]: [ERROR] [we-rm] did not find locale for language: Turkish and SOGo falls back to English (login page, and the whole UI for every user who has not saved a language preference yet), regardless of
SOGoLanguage = TurkishTurkeyin sogo.conf.Reproduction (SOGo 5.12.9 + SOPE 4.9, OpenBSD 7.9 packages)
curl -sk -H 'Accept-Language: tr-TR,tr;q=0.9,en;q=0.5' https://mail.example.com/SOGo/ | grep -o '<html[^>]lang="[^"]"'
-> lang="en" (expected: Turkish)
curl -sk -H 'Accept-Language: de-DE,de;q=0.9' ... -> lang="de" (German works: "de" = "German" and German.lproj exists)
Fix
Point the mapping at the bundle that actually exists, exactly like the existing entries for Spanish (
"es" = "SpanishSpain"; SOGo shipsSpanishSpain.lproj, noSpanish.lproj), and add the regional key browsers send:Verification
With the one-line change applied to the installed plist and sogod restarted:
Verified on three OpenBSD 7.9 hosts (SOGo 5.12.9, sope-4.9 packages). Users who have explicitly saved another language in Preferences are not affected; only the browser-language detection changes.