Fix for #11254 - Link from brim to a non-existent page on the Prusa Help.

* For unsupported languages help link is redirected to the EN page.
+ "uk", "zh" and "ru" languages are removed from current_language_code_safe().
  Because those languages aren't supported by Prusa Help.
This commit is contained in:
YuSanka 2023-09-08 11:49:03 +02:00
parent 3a00a50ee5
commit 8cdda54d5a
2 changed files with 4 additions and 4 deletions

View File

@ -3015,9 +3015,9 @@ wxString GUI_App::current_language_code_safe() const
{ "ja", "ja_JP", },
{ "ko", "ko_KR", },
{ "pl", "pl_PL", },
{ "uk", "uk_UA", },
{ "zh", "zh_CN", },
{ "ru", "ru_RU", },
//{ "uk", "uk_UA", },
//{ "zh", "zh_CN", },
//{ "ru", "ru_RU", },
};
wxString language_code = this->current_language_code().BeforeFirst('_');
auto it = mapping.find(language_code);

View File

@ -1024,7 +1024,7 @@ wxString OptionsGroup::get_url(const std::string& path_end)
if (path_end.empty())
return wxEmptyString;
wxString language = get_app_config()->get("translation_language");
wxString language = wxGetApp().current_language_code_safe();
wxString lang_marker = language.IsEmpty() ? "en" : language.BeforeFirst('_');
return wxString("https://help.prusa3d.com/") + lang_marker + wxString("/article/" + path_end);