mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-21 16:37:12 +01:00
Utilities to get current app language & reset it to default...
... Renaming "InitLang" to "SetLang", then reusing the name "InitLang"
This commit is contained in:
@@ -991,7 +991,22 @@ wxLanguageInfo userLangs[] =
|
||||
};
|
||||
#endif
|
||||
|
||||
wxString AudacityApp::InitLang( const wxString & lang )
|
||||
wxString AudacityApp::InitLang( wxString langCode )
|
||||
{
|
||||
if ( langCode.empty() )
|
||||
langCode = gPrefs->Read(wxT("/Locale/Language"), wxEmptyString);
|
||||
|
||||
// Use the system default language if one wasn't specified or if the user selected System.
|
||||
if (langCode.empty())
|
||||
{
|
||||
langCode = GetSystemLanguageCode();
|
||||
}
|
||||
|
||||
// Initialize the language
|
||||
return SetLang(langCode);
|
||||
}
|
||||
|
||||
wxString AudacityApp::SetLang( const wxString & lang )
|
||||
{
|
||||
wxString result = lang;
|
||||
|
||||
@@ -1059,6 +1074,14 @@ wxString AudacityApp::InitLang( const wxString & lang )
|
||||
return result;
|
||||
}
|
||||
|
||||
wxString AudacityApp::GetLang() const
|
||||
{
|
||||
if (mLocale)
|
||||
return mLocale->GetSysName();
|
||||
else
|
||||
return {};
|
||||
}
|
||||
|
||||
void AudacityApp::OnFatalException()
|
||||
{
|
||||
#if defined(EXPERIMENTAL_CRASH_REPORT)
|
||||
|
||||
Reference in New Issue
Block a user