Localized the (modified) profile indicator
This commit is contained in:
parent
40b55a3818
commit
dd088ba0cc
7 changed files with 3867 additions and 2185 deletions
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -250,6 +250,7 @@ bool select_language(wxArrayString & names,
|
|||
g_wxLocale->AddCatalogLookupPathPrefix(wxPathOnly(localization_dir()));
|
||||
g_wxLocale->AddCatalog(g_wxApp->GetAppName());
|
||||
wxSetlocale(LC_NUMERIC, "C");
|
||||
Preset::update_suffix_modified();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -275,6 +276,7 @@ bool load_language()
|
|||
g_wxLocale->AddCatalogLookupPathPrefix(wxPathOnly(localization_dir()));
|
||||
g_wxLocale->AddCatalog(g_wxApp->GetAppName());
|
||||
wxSetlocale(LC_NUMERIC, "C");
|
||||
Preset::update_suffix_modified();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,6 +146,11 @@ const std::string& Preset::suffix_modified()
|
|||
{
|
||||
return g_suffix_modified;
|
||||
}
|
||||
|
||||
void Preset::update_suffix_modified()
|
||||
{
|
||||
g_suffix_modified = (" (" + _(L("modified")) + ")").ToUTF8().data();
|
||||
}
|
||||
// Remove an optional "(modified)" suffix from a name.
|
||||
// This converts a UI name to a unique preset identifier.
|
||||
std::string Preset::remove_suffix_modified(const std::string &name)
|
||||
|
|
|
@ -167,6 +167,7 @@ public:
|
|||
static const std::vector<std::string>& printer_options();
|
||||
// Nozzle options of the printer options.
|
||||
static const std::vector<std::string>& nozzle_options();
|
||||
static void update_suffix_modified();
|
||||
|
||||
protected:
|
||||
friend class PresetCollection;
|
||||
|
@ -260,7 +261,7 @@ public:
|
|||
// used to update preset_choice from Tab
|
||||
const std::deque<Preset>& get_presets() { return m_presets; }
|
||||
int get_idx_selected() { return m_idx_selected; }
|
||||
const std::string& get_suffix_modified();
|
||||
static const std::string& get_suffix_modified();
|
||||
|
||||
// Return a preset possibly with modifications.
|
||||
Preset& default_preset() { return m_presets.front(); }
|
||||
|
|
|
@ -2728,7 +2728,7 @@ void SavePresetWindow::accept()
|
|||
const char* unusable_symbols = "<>:/\\|?*\"";
|
||||
bool is_unusable_symbol = false;
|
||||
bool is_unusable_postfix = false;
|
||||
const std::string unusable_postfix = "(modified)";
|
||||
const std::string unusable_postfix = PresetCollection::get_suffix_modified();//"(modified)";
|
||||
for (size_t i = 0; i < std::strlen(unusable_symbols); i++){
|
||||
if (m_chosen_name.find_first_of(unusable_symbols[i]) != std::string::npos){
|
||||
is_unusable_symbol = true;
|
||||
|
@ -2743,8 +2743,9 @@ void SavePresetWindow::accept()
|
|||
_(L("the following characters are not allowed:")) + " <>:/\\|?*\"");
|
||||
}
|
||||
else if (is_unusable_postfix){
|
||||
show_error(this, _(L("The supplied name is not valid;")) + "\n" +
|
||||
_(L("the following postfix are not allowed:")) + "\n\t" + unusable_postfix);
|
||||
show_error(this,_(L("The supplied name is not valid;")) + "\n" +
|
||||
_(L("the following postfix are not allowed:")) + "\n\t" + //unusable_postfix);
|
||||
wxString::FromUTF8(unusable_postfix.c_str()));
|
||||
}
|
||||
else if (m_chosen_name.compare("- default -") == 0) {
|
||||
show_error(this, _(L("The supplied name is not available.")));
|
||||
|
|
Loading…
Reference in a new issue