D25530: Sonnet: Add locales that are missing in QLocale
Waqar Ahmed
noreply at phabricator.kde.org
Tue Nov 26 15:37:25 GMT 2019
waqar added inline comments.
INLINE COMMENTS
> aspotashev wrote in loader.cpp:255
> There may be different consistent approaches to capitalization:
>
> 1. Use the spelling like if the language name comes in the middle of a sentence. This implies all-lowercase spelling for many Cyrillic-based languages, e.g. "русский" for Russian.
> 2. Use the spelling like if the language name comes in the beginning of a sentence. In many languages that means that first letter is in uppercase, e.g. "Русский" for Russian.
>
> I don't know which of these approaches is taken by Qt, but we should follow the pattern. Until then, I can't say how to fix this patch.
>
> ---
>
> After having a look on the Qt source code (qlocale_unix.cpp, qlocale_win.cpp) I'm not sure where do these native language names from on Unix/Linux. QSystemLocale::query() as defined in qlocale_unix.cpp seems to returns an empty QVariant.
>
> I think it would be really helpful if we add unit tests for this Loader::languageNameForCode() method.
>
> ---
>
> I don't know these languages, however I can read Russian and at least detect capital letters in languages that mostly reuse the Russian alphabet.
>
> Now so sure about Chuvash language anymore because English Wikipedia says "Чӑвашла" while Russian
> Wikipedia and many other resources in Russian say "чӑвашла", e.g. https://en.wiktionary.org/wiki/чӑваш_чӗлхи
QLocale::nativeCountryName()
QLocale::nativeLanguageName()
Examples for cyrillic based using these two methods:
- **"українська" "Україна"** for `uk_UA` (Ukrainian)
- **"русский" "Россия"** for `ru_RU` (Russian)
- **српски" "Србија"** for `sr_SR` (Serbian)
--------------------------------------
The language names are coming from `qgetenv()` I believe. It returns empty in case there was no language name found. In that case, Sonnet just returns the 'isoCode' e.g `cv_RU`.
Great idea about the `languageNameForCode()` test. I will go ahead and write it. What should be the name for this test?
REPOSITORY
R246 Sonnet
REVISION DETAIL
https://phabricator.kde.org/D25530
To: waqar
Cc: aspotashev, aacid, yurchor, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20191126/3d58500d/attachment.html>
More information about the Kde-frameworks-devel
mailing list