Skip to content

Commit

Permalink
Merge branch 'fix_language' into TT_Ours4
Browse files Browse the repository at this point in the history
  • Loading branch information
CoBC committed Aug 16, 2024
2 parents a54610b + 372fd5f commit 4f8bcd2
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 30 deletions.
1 change: 1 addition & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Version 5.17.1, unreleased
Default Qt Client
- Option to use TeamTalk Sound Output device for default sound event playback mode
- Support "{username}" variable for majority of TTS and status events related to user action
- Fixed language not set at first start
Android Client
-
iOS Client
Expand Down
2 changes: 1 addition & 1 deletion Client/qtTeamTalk/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ void MainWindow::loadSettings()
migrateSettings();

// Ask to set language at first start
if (!ttSettings->contains(SETTINGS_DISPLAY_LANGUAGE))
if (ttSettings->value(SETTINGS_GENERAL_FIRSTSTART, SETTINGS_GENERAL_FIRSTSTART_DEFAULT).toBool())
{
QLocale locale = QLocale::system();
QString languageCode = locale.name();
Expand Down
61 changes: 32 additions & 29 deletions Client/qtTeamTalk/utilui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,35 +103,38 @@ void migrateSettings()
#endif

// Language files was renamed in 5.4 format
QString lc_code;
QString lang = ttSettings->value(SETTINGS_DISPLAY_LANGUAGE, SETTINGS_DISPLAY_LANGUAGE_DEFAULT).toString();
if (lang == "Bulgarian") lc_code = "bg";
else if (lang == "Chinese_Simplified") lc_code = "zh_CN";
else if (lang == "Chinese_Traditional") lc_code = "zh_TW";
else if (lang == "Croatian") lc_code = "hr";
else if (lang == "Czech") lc_code = "cs";
else if (lang == "Danish") lc_code = "da";
else if (lang == "Dutch") lc_code = "nl";
else if (lang == "English") lc_code = "en";
else if (lang == "French") lc_code = "fr";
else if (lang == "German") lc_code = "de";
else if (lang == "Hebrew") lc_code = "he";
else if (lang == "Hungarian") lc_code = "hu";
else if (lang == "Indonesian") lc_code = "id";
else if (lang == "Italian") lc_code = "it";
else if (lang == "Korean") lc_code = "ko";
else if (lang == "Persian") lc_code = "fa";
else if (lang == "Polish") lc_code = "pl";
else if (lang == "Portuguese_BR") lc_code = "pt_BR";
else if (lang == "Portuguese_EU") lc_code = "pt_PT";
else if (lang == "Russian") lc_code = "ru";
else if (lang == "Slovak") lc_code = "sk";
else if (lang == "Slovenian") lc_code = "sl";
else if (lang == "Spanish") lc_code = "es";
else if (lang == "Thai") lc_code = "th";
else if (lang == "Turkish") lc_code = "tr";
else if (lang == "Vietnamese") lc_code = "vi";
ttSettings->setValue(SETTINGS_DISPLAY_LANGUAGE, lc_code);
if (ttSettings->contains(SETTINGS_DISPLAY_LANGUAGE))
{
QString lc_code;
QString lang = ttSettings->value(SETTINGS_DISPLAY_LANGUAGE, SETTINGS_DISPLAY_LANGUAGE_DEFAULT).toString();
if (lang == "Bulgarian") lc_code = "bg";
else if (lang == "Chinese_Simplified") lc_code = "zh_CN";
else if (lang == "Chinese_Traditional") lc_code = "zh_TW";
else if (lang == "Croatian") lc_code = "hr";
else if (lang == "Czech") lc_code = "cs";
else if (lang == "Danish") lc_code = "da";
else if (lang == "Dutch") lc_code = "nl";
else if (lang == "English") lc_code = "en";
else if (lang == "French") lc_code = "fr";
else if (lang == "German") lc_code = "de";
else if (lang == "Hebrew") lc_code = "he";
else if (lang == "Hungarian") lc_code = "hu";
else if (lang == "Indonesian") lc_code = "id";
else if (lang == "Italian") lc_code = "it";
else if (lang == "Korean") lc_code = "ko";
else if (lang == "Persian") lc_code = "fa";
else if (lang == "Polish") lc_code = "pl";
else if (lang == "Portuguese_BR") lc_code = "pt_BR";
else if (lang == "Portuguese_EU") lc_code = "pt_PT";
else if (lang == "Russian") lc_code = "ru";
else if (lang == "Slovak") lc_code = "sk";
else if (lang == "Slovenian") lc_code = "sl";
else if (lang == "Spanish") lc_code = "es";
else if (lang == "Thai") lc_code = "th";
else if (lang == "Turkish") lc_code = "tr";
else if (lang == "Vietnamese") lc_code = "vi";
ttSettings->setValue(SETTINGS_DISPLAY_LANGUAGE, lc_code);
}

// Shortcuts changed in 5.4 format
Hotkeys hks = HOTKEY_NONE;
Expand Down

0 comments on commit 4f8bcd2

Please sign in to comment.