Re: Rename pt to pt_PT in svn

2023-01-09 Thread Albert Astals Cid
El diumenge, 8 de gener de 2023, a les 9:57:18 (CET), hanyoung va escriure:
> Hello everyone,
> 
> I'd like to rename `pt` directory in our svn to `pt_PT` to fix the bug that
> most applications treat `pt` as `pt_BR`. My understanding is that
> `l10n-kf5/$LANGUAGE/messages/plasma-workspace/plasmashell.po` will be sync
> to `plasma-workspace/po/$LANGUAGE/plasmashell.po`. In turn, when we call
> `KLocalizedString::availableDomainTranslations("plasmashell").values()` in
> systemsetting to get the list of available languages, it essentially
> iterates over the translation directories and return the list of directory
> names that have plasmashell.po in them. And that's why we're getting ["pt",
> "pt_BR"]. Sadly, most applications (include KDE itself) treat `pt` as
> `pt_BR`.

"most applications" is not correct, as far as i understand the only thing that 
says pt -> pt_BR is QLocale (and CLDR but as far as i know there's not much 
plain CLDR usage out there). 

The rest of the glibc world treats pt as that, just pt with no country 
specialization.

> So effectively, user can't set their system language to `pt_PT` in
> systemsettings.

That's a bug in systemsettings, we've had code tha takes into account "pt in 
glibc locale world needs to be pt_PT in QLocale world" since I fixed in 2015, 
but I guess someone removed it at some point.

> As a temporary measure, we can explicitly set 'pt' to 'pt_PT' in
> systemsettings code. As I did in this MR:
> https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2478

That seems reasonable (except for the hand rolled search algorithm) (haven't 
tested either)

I don't see why you consider that a temporary measure, it's the correct fix 
that manages correctly the fact that glibc and qlocale disagree.

> However, I wish in the long term we can rename the 'pt' in
> https://websvn.kde.org/trunk/l10n-kf5/pt/ to 'pt_PT'. This should fix the
> root issue.

I think that would be bad idea since it would make people using the pt_MO 
locale not getting any translation.

Cheers,
  Albert

> 
> Relevant bug report, forum discussion and MR:
> https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2478
> https://discuss.kde.org/t/rename-pt-in-i10n-svn-to-pt-pt/118
> https://bugs.kde.org/show_bug.cgi?id=454991
> 
> Note: please reply on either MR, forum post or bug report. Forum post is
> preferred since I linked it to the MR and bug report (and also in source
> code comment)
> 
> Regards,
> Han






Re: Rename pt to pt_PT in svn

2023-01-08 Thread Luigi Toscano
hanyoung ha scritto:
> Hello everyone,
> 
> I'd like to rename `pt` directory in our svn to `pt_PT` to fix the bug that 
> most applications treat `pt` as `pt_BR`.

As I wrote on the bug report:
Let's not promise a solution which hasn't been agreed upon. Other relevant
software in the free software world based on gettext (I've checked GNU, GNOME
and LibreOffice) uses pt. Does it mean they are broken too? If there is an
issue, maybe it should be solved in gettext.

> Note: please reply on either MR, forum post or bug report. Forum post is 
> preferred since I linked it to the MR and bug report (and also in source code 
> comment)

I concur with what Albert wrote, obviously. The discussion should take place
here. I've added a note to the forum post to close it.

-- 
Luigi




Re: Rename pt to pt_PT in svn

2023-01-08 Thread Albert Astals Cid
El diumenge, 8 de gener de 2023, a les 9:57:18 (CET), hanyoung va escriure:
> Hello everyone,
> 
> I'd like to rename `pt` directory in our svn to `pt_PT` to fix the bug that
> most applications treat `pt` as `pt_BR`. My understanding is that
> `l10n-kf5/$LANGUAGE/messages/plasma-workspace/plasmashell.po` will be sync
> to `plasma-workspace/po/$LANGUAGE/plasmashell.po`. In turn, when we call
> `KLocalizedString::availableDomainTranslations("plasmashell").values()` in
> systemsetting to get the list of available languages, it essentially
> iterates over the translation directories and return the list of directory
> names that have plasmashell.po in them. And that's why we're getting ["pt",
> "pt_BR"]. Sadly, most applications (include KDE itself) treat `pt` as
> `pt_BR`. So effectively, user can't set their system language to `pt_PT` in
> systemsettings.
> 
> As a temporary measure, we can explicitly set 'pt' to 'pt_PT' in
> systemsettings code. As I did in this MR:
> https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2478
> However, I wish in the long term we can rename the 'pt' in
> https://websvn.kde.org/trunk/l10n-kf5/pt/ to 'pt_PT'. This should fix the
> root issue.
> 
> Relevant bug report, forum discussion and MR:
> https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2478
> https://discuss.kde.org/t/rename-pt-in-i10n-svn-to-pt-pt/118
> https://bugs.kde.org/show_bug.cgi?id=454991
> 
> Note: please reply on either MR, forum post or bug report. Forum post is
> preferred since I linked it to the MR and bug report (and also in source
> code comment)

No.

i18n decisions are made in i18n mailing list, not anywhere else that is more 
convenient for you but less convenient for all the rest of us.

Albert

> 
> Regards,
> Han