ENH: Login Language use Bambu Config

JIRA: none
Change-Id: I3c12441af0daad6a92843226886b0f15c60aa16a
This commit is contained in:
zorro.zhang 2025-03-14 20:30:34 +08:00 committed by lane.wei
parent cbaf4d9a12
commit d415d8e728
2 changed files with 11 additions and 2 deletions

View File

@ -79,9 +79,8 @@ ZUserLogin::ZUserLogin() : wxDialog((wxWindow *) (wxGetApp().mainframe), wxID_AN
TargetUrl = host_url + "/sign-in"; TargetUrl = host_url + "/sign-in";
m_networkOk = false; m_networkOk = false;
wxString strlang = wxGetApp().current_language_code_safe(); wxString strlang = wxString::FromUTF8(GetStudioLanguage()).BeforeFirst('_');
if (strlang != "") { if (strlang != "") {
strlang.Replace("_", "-");
TargetUrl = host_url + "/" + strlang + "/sign-in"; TargetUrl = host_url + "/" + strlang + "/sign-in";
} }
@ -411,4 +410,12 @@ bool ZUserLogin::ShowErrorPage()
} }
std::string ZUserLogin::GetStudioLanguage()
{
std::string strLanguage = wxGetApp().app_config->get("language");
if (strLanguage.empty()) strLanguage = "en";
return strLanguage;
}
}} // namespace Slic3r::GUI }} // namespace Slic3r::GUI

View File

@ -61,6 +61,8 @@ public:
bool run(); bool run();
std::string GetStudioLanguage();
static int web_sequence_id; static int web_sequence_id;
private: private:
wxTimer *m_timer { nullptr }; wxTimer *m_timer { nullptr };