mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 19:20:09 +00:00
Simplify strings for PaletteEditor command removing leading blanks
This issue was brought up here: https://github.com/aseprite/aseprite/pull/4207#issuecomment-1845334373
This commit is contained in:
parent
f7c830d984
commit
84187ad1ec
@ -368,11 +368,11 @@ OpenInFolder = Open In Folder
|
||||
OpenScriptFolder = Open Script Folder
|
||||
OpenWithApp = Open With Associated Application
|
||||
Options = Preferences
|
||||
PaletteEditor = Switch{0}{1}{2}
|
||||
PaletteEditor_Edit = \ Edit Palette Mode
|
||||
PaletteEditor_And = \ and
|
||||
PaletteEditor_FgPopup = \ Foreground Color Popup
|
||||
PaletteEditor_BgPopup = \ Background Color Popup
|
||||
PaletteEditor = Switch {0} {1} {2}
|
||||
PaletteEditor_Edit = Edit Palette Mode
|
||||
PaletteEditor_And = and
|
||||
PaletteEditor_FgPopup = Foreground Color Popup
|
||||
PaletteEditor_BgPopup = Background Color Popup
|
||||
PaletteSize = Palette Size
|
||||
Paste = Paste
|
||||
PasteText = Insert Text
|
||||
|
@ -1,4 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2023 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2017 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
@ -12,6 +13,8 @@
|
||||
#include "app/commands/params.h"
|
||||
#include "app/i18n/strings.h"
|
||||
#include "app/ui/color_bar.h"
|
||||
#include "base/replace_string.h"
|
||||
#include "base/trim_string.h"
|
||||
#include "fmt/format.h"
|
||||
|
||||
namespace app {
|
||||
@ -103,7 +106,13 @@ std::string PaletteEditorCommand::onGetFriendlyName() const
|
||||
else
|
||||
popup = Strings::commands_PaletteEditor_FgPopup();
|
||||
}
|
||||
return fmt::format(getBaseFriendlyName(), edit, plus, popup);
|
||||
|
||||
std::string result = fmt::format(getBaseFriendlyName(), edit, plus, popup);
|
||||
// TODO create a new function to remove duplicate whitespaces
|
||||
base::replace_string(result, " ", " ");
|
||||
base::replace_string(result, " ", " ");
|
||||
base::trim_string(result, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
Command* CommandFactory::createPaletteEditorCommand()
|
||||
|
@ -162,7 +162,6 @@ void Strings::loadStringsFromFile(const std::string& fn)
|
||||
|
||||
value = cfg.getValue(section.c_str(), key.c_str(), "");
|
||||
base::replace_string(value, "\\n", "\n");
|
||||
base::replace_string(value, "\\ ", " "); // Mainly used for leading blanks
|
||||
m_strings[textId] = value;
|
||||
|
||||
//TRACE("I18N: Reading string %s -> %s\n", textId.c_str(), m_strings[textId].c_str());
|
||||
|
Loading…
x
Reference in New Issue
Block a user