Taking this back to the mailing list...
> On Feb 4, 2024, at 08:44, Dirk Hohndel wrote:
>
>> On Feb 4, 2024, at 02:07, Peter Zaal <[email protected]> wrote:
>>
>> Couple of questions and thinks I noticed:
>> - How do I actually switch to another language? I think the old site had a
>> "en|de|nl|es" switch on top. That would be really helpful. I have no idea
>> how to switch now. I tried to add /nl/... in the url, that worked (and the
>> url is updated to ...?lang=nl), but it doesn't stick. As soon as I select
>> another page it's the English version again. Also it doesn't use the browser
>> settings; I see my browser (Edge on Windows) sending the Accept-Language:
>> nl,en header. But most useful would be to allow the user to select itself
>> with a language selection switch.
>
> This is all really confusing to me - but of course I didn't test with Windows.
> Coming from a Mac or Linux box, the language preference of your browser is
> used.
> If you don't want that, then both the /nl/ and ?lang=nl should work, and they
> should be persistent - they are part of the browser session.
> I quite literally have two different 'profiles' on Firefox here on my Mac,
> one sets preferred language to English, the other to German, and depending
> with which one I go to the site, that's the language I get - and I can still
> override this with /es/ and get Spanish... until I override it with something
> else or close the browser tab.
>
> I now do have a Windows box. I replaced Edge with Firefox right away, but of
> course you can't uninstall it, so it's still there and I'll try.
Today has been a fascinating day of appreciation (for all the people stepping
up to help out) and learning - about all kinds of weird things; most relevant
for this conversation the wild and creative ways in which different browsers on
different OSs do what seems to be the same thing very differently.
Long story short - I think the site should now respect your browser's language
preference (and if it doesn't I really wanna know about it and figure out what
headers YOUR browser sends to my server -- I have tested this with Safari,
Firefox, Chrome, and MSFT Crap... sorry, they named it Edge for some reason...
across macOS, Linux, and Windows (obviously not every browser on every OS, but
at least two browsers on each of them).
On top of that, you should now be able to simply append "?lang=CODE" with the
appropriate language code and that will work. And of course the old "prefix the
language code in front of the URL" thing also works.
So for someone with a German browser,
https://subsurface-divelog.org/current-release should open the page for the
Aktuelle "wöchentliche" Version - and using
https://subsurface-divelog.org/nl/current-release should get them Huidige
"wekelijkse" versie. And each subsequent link within the site will carry with
it the corresponding language indicator. So if you once pick a language
different than what your browser tells us it prefers, subsequently you should
stay in that language if you follow site-internal links.
I will admit that getting this to work was decidedly NOT FUN.
Please test. Please show me examples where it's still broken. I tried very hard
to catch all links, but I'm not 100% sure that none escaped my grep-patterns.
Thanks
/D
_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface