Fall back to language name for translations lookup if locale name fails

Authored by wbauer on Jan 17 2018, 8:55 PM.

Description

Fall back to language name for translations lookup if locale name fails

For locales like de_AT, the current code only looks in
share/locale/de_AT/ and share/locale/de-AT/ for translation catalogs,
but not in share/locale/de/ where they most likely are.
That's because bcp47Name() returns "de-AT" for de_AT (though in the
case of de_DE e.g. it does return "de").

This patch additionally tries to fall back to the general language by
taking the part of the locale name before the first '_'.

Differential Revision: https://phabricator.kde.org/D9793

Details

Committed
wbauerJan 17 2018, 8:55 PM
Differential Revision
D9793: Fall back to language name for translations lookup if locale name fails
Parents
R240:bf9840ade060: Android: Add more includes
Branches
Unknown
Tags
Unknown