system language: first try to find the complete string, if not found use only first two letters instead
This commit is contained in:
parent
1e57b7b0d5
commit
e6a6c8a79e
2 changed files with 18 additions and 14 deletions
|
@ -13,6 +13,8 @@
|
|||
|
||||
- support sorting faders by channel group
|
||||
|
||||
- add support to change the GUI language (#297)
|
||||
|
||||
- add special server list filter for filtering occupied servers by using "#" (#397)
|
||||
|
||||
- scale channel instrument picture in Compact skin mode
|
||||
|
@ -20,11 +22,6 @@
|
|||
- bug fix: grouping faders in the client should be proportional (see discussion in #202, #419)
|
||||
|
||||
|
||||
TODO add support to change language (#297)
|
||||
TODO search in the code for "TODO maybe first try to find the complete string, if not found use only first two letters instead"
|
||||
|
||||
TODO bug fix: incorrect selection of UI language (#408) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
-> note that for the 3.5.8 bug fix release we went back to the original translation code (e.g. no pt_BR!)
|
||||
|
||||
TODO add new register message which contains version and, e.g., max number of clients
|
||||
|
||||
|
|
17
src/util.cpp
17
src/util.cpp
|
@ -1468,21 +1468,28 @@ QPair<QString, QString> CLocale::FindSysLangTransFileName ( const QMap<QString,
|
|||
QStringList slUiLang = QLocale().uiLanguages();
|
||||
|
||||
if ( !slUiLang.isEmpty() )
|
||||
{
|
||||
QString strUiLang = QLocale().uiLanguages().at ( 0 );
|
||||
strUiLang.replace ( "-", "_" );
|
||||
|
||||
// first try to find the complete language string
|
||||
if ( TranslMap.constFind ( strUiLang ) != TranslMap.constEnd() )
|
||||
{
|
||||
PairSysLang.first = strUiLang;
|
||||
PairSysLang.second = TranslMap[PairSysLang.first];
|
||||
}
|
||||
else
|
||||
{
|
||||
// only extract two first characters to identify language (ignoring
|
||||
// location for getting a simpler implementation -> if the language
|
||||
// is not correct, the user can change it in the GUI anyway)
|
||||
const QString strUiLang = QLocale().uiLanguages().at ( 0 );
|
||||
|
||||
if ( strUiLang.length() >= 2 )
|
||||
{
|
||||
|
||||
// TODO maybe first try to find the complete string, if not found use only first two letters instead
|
||||
|
||||
PairSysLang.first = strUiLang.left ( 2 );
|
||||
PairSysLang.second = TranslMap[PairSysLang.first];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return PairSysLang;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue