-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use formal version of German by default #7351
Conversation
0be9cb5
to
7d4df77
Compare
Codecov Report
@@ Coverage Diff @@
## master #7351 +/- ##
============================================
+ Coverage 50.91% 50.92% +<.01%
- Complexity 24698 24704 +6
============================================
Files 1586 1586
Lines 94113 94125 +12
Branches 1361 1361
============================================
+ Hits 47920 47929 +9
- Misses 46193 46196 +3
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please no. This will lead to a world of pain if we are going to do such weird fallbacks for every other language.
If people want the formal German they should set their browser/os properly. Or else set it in the settings.
The problem is that the browser sends per default "de" and not "de_DE". At least Firefox, but from user feedback this is also true for other browsers. So it is not the users fault who can't know our internal hack and who set the browser correctly to German but didn't get the expected result. As the whole "de" vs "de_DE" hack is our "fault" I think it is also our responsibility to pick the right one if the browser is set to German. And the default should definitely be the formal one. Nobody is offended by calling them "Sie" but many are offended by calling them "Du" |
Added @MorrisJobke and @blizzz as additional reviewers because I think that's a quite "German problem" 😉 |
You can also set German/Germany (de_DE) in firefox. I see no reason to prefer German/Germany over German/Liechtenstein here. |
Well… I would not sign this for Berlin :) |
Silly language you have. Do as you please.
lib/private/L10N/Factory.php
Outdated
@@ -159,6 +159,8 @@ public function findLanguage($app = null) { | |||
try { | |||
// Try to get the language from the Request | |||
$lang = $this->getLanguageFromRequest($app); | |||
// use formal version of german ("Sie" instead of "Du") by default | |||
$lang = strtolower($lang) === 'de' ? 'de_DE' : $lang; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then don't do this here, but in the actual method that sets it during the first login.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say this should go into getLanguageFromRequest, so it still works for guests.
But I'd really like to see this optional.
If we do this at all, we should only change this during the first login, otherwise this method has some erratic behaviour. We should set it to
|
I don't really think we should autocorrect user preferences. Currently the priority is: I really really really do not want to have all people seeing the formal german on all the instances by default. This is really a minority, so either patch or config for them, but no way distance-by-default. |
I guess the main issue here is "Guests" in which case the "solution" of Morris also wouldn't work, because it only works on login? |
This implies that the user knows that "de" is the non-formal version and de_DE is the formal version which I don't think is common sense outside of the Nextcloud universe. But I like your idea to also look at the default_language and only do it if this is set to de_DE... I will add it. Thanks for this really good suggestion |
1207187
to
a37f701
Compare
@nickvergessen @MorrisJobke @rullzer updated, I think this is now a really good solution. |
a37f701
to
a479535
Compare
lib/private/L10N/Factory.php
Outdated
try { | ||
// Try to get the language from the Request | ||
$lang = $this->getLanguageFromRequest($app); | ||
// use formal version of german ("Sie" instead of "Du") if the default | ||
// language is set to 'de_DE' | ||
if (strtolower($lang) === 'de' && strtolower($defaultLanguage) === 'de_de') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should try to move this into getLanguageFromRequest
or at least check languageExists
because if de exists, but de_DE not (lets say for an app), it would fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nickvergessen moved it to getLanguageFromRequest
So, with the updated behavior the default for Germans is still the friendlier informal way, unless specifically set to de_DE in system-wide settings or Nextcloud itself? |
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
a479535
to
8b73434
Compare
exactly, only if the admin sets 'default_language' to 'de_DE' in the config.php, it will be preferred. |
Could you document this in the sample config? Then I'm fine with this here 👍 |
lib/private/L10N/Factory.php
Outdated
// use formal version of german ("Sie" instead of "Du") if the default | ||
// language is set to 'de_DE' if possible | ||
if (strtolower($lang) === 'de' | ||
&& strtolower($defaultLanguage) === 'de_de' && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And please check this variable first - https://3v4l.org/msAEZ (totally fine for now, but let's fix it upfront: https://3v4l.org/dmBJK)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
@MorrisJobke documentation added 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This version I can deal with 😉
Use formal version of German by default, if not explicitly defined differently.
Germans are sometimes a bit old school and prefer the formal "Sie" instead of "Du". 😉 So I think it makes sense to use this version as default if the browser is set to German.