Add missing language strings for the timeline/context bar

This commit is contained in:
Joshua Ogunyinka 2022-01-03 12:02:19 +04:00 committed by David Capello
parent d195561b7f
commit 3c815ac1bd
4 changed files with 158 additions and 62 deletions

View File

@ -6,6 +6,10 @@
title = Warning - Important title = Warning - Important
description = You are going to enter in "Advanced Mode". description = You are going to enter in "Advanced Mode".
[ani_controls]
shortcut = Shortcut:
right_click = Right-click: Show playback options
[ask_for_color_profile] [ask_for_color_profile]
title = Color Profile title = Color Profile
sprite_with_profile = The sprite contains a color profile. sprite_with_profile = The sprite contains a color profile.
@ -200,6 +204,11 @@ ink_opacity = Opacity
extras = Extras: extras = Extras:
shade = Shade shade = Shade
pixel_perfect = Pixel-Perfect pixel_perfect = Pixel-Perfect
save_brush = Save Brush Here
locked = Locked
delete = Delete
delete_all = Delete All
saved_parameters = Saved Parameters
[cel_movement_popup_menu] [cel_movement_popup_menu]
move = &Move move = &Move
@ -585,6 +594,63 @@ title = Color Mode
amount = Amount: amount = Amount:
flatten = Merge layers flatten = Merge layers
[context_bar]
center = Center
fit_screen = Fit Screen
back = Back
pattern_aligned_to_src = Pattern aligned to source
pattern_aligned_to_dest = Pattern aligned to destination
paint_brush = Paint brush
contiguous = Contiguous
stop_at_grid = Stop at Grid
refer_active_layer = Refer only active layer
refer_visible_layer = Refer visible layer
pixel_connectivity = Pixel Connectivity:
select_palette_color = Select colors in the palette
reverse_shade = Reverse Shade
save_shade = Save Shade
transparent_color = Transparent Color
transparent_color_options = Transparent Color Options
opaque = Opaque
transparent = Transparent
auto_adjust_layer = Adjust automatically depending on layer type
default_display_pivot = Display pivot by default
fast_rotation = Fast Rotation
rotsprite = RotSprite
pixel_perfect = Pixel-perfect
linear_gradient = Linear Gradient
radial_gradient = Radial Gradiant
drop_pixel = Drop pixels here (Enter)
cancel_drag = Cancel drag and drop (Esc)
auto_select_layer = Auto Select Layer
all = All
none = None
select_slices = Select All Slices
deselect_slices = Deselect Slices
slice_props = Slice Properties
delete_slice = Delete Slice
discard_brush = Discard Brush (Esc)
brush_type = Brush Type
brush_size = Brush Size (in pixels)
brush_angle = Brush Angle (in degrees)
ink = Ink
opacity = Opacity (paint intensity)
shades = Shades
spray_width = Spray Width
spray_speed = Spray Speed
rotation_pivot = Rotation Pivot
rotation_algorithm = Rotation Algorithm
dynamics = Dynamics
freehand_trace_algorithm = Freehand trace algorithm
contiguous_fill = Fill contiguous areas color
paint_bucket_option = Extra paint bucket options
best_fit_index = Best fit Index
all_layers = All Layers
current_layer = Current Layer
first_ref_layer = First Reference Layer
pick = Pick:
sample = Sample:
[convolution_matrix] [convolution_matrix]
reload_stock = &Reload Stock reload_stock = &Reload Stock

View File

@ -15,6 +15,7 @@
#include "app/brush_slot.h" #include "app/brush_slot.h"
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/commands/commands.h" #include "app/commands/commands.h"
#include "app/i18n/strings.h"
#include "app/modules/gui.h" #include "app/modules/gui.h"
#include "app/modules/palettes.h" #include "app/modules/palettes.h"
#include "app/pref/preferences.h" #include "app/pref/preferences.h"
@ -160,10 +161,10 @@ private:
void onClick() override { void onClick() override {
Menu menu; Menu menu;
AppMenuItem save("Save Brush Here"); AppMenuItem save(Strings::brush_slot_params_save_brush());
AppMenuItem lockItem("Locked"); AppMenuItem lockItem(Strings::brush_slot_params_locked());
AppMenuItem deleteItem("Delete"); AppMenuItem deleteItem(Strings::brush_slot_params_delete());
AppMenuItem deleteAllItem("Delete All"); AppMenuItem deleteAllItem(Strings::brush_slot_params_delete_all());
lockItem.setSelected(m_brushes.isBrushSlotLocked(m_slot)); lockItem.setSelected(m_brushes.isBrushSlotLocked(m_slot));
@ -179,7 +180,8 @@ private:
menu.addChild(new MenuSeparator); menu.addChild(new MenuSeparator);
menu.addChild(&deleteAllItem); menu.addChild(&deleteAllItem);
menu.addChild(new Label("")); menu.addChild(new Label(""));
menu.addChild(new Separator("Saved Parameters", HORIZONTAL)); menu.addChild(
new Separator(Strings::brush_slot_params_saved_parameters(), HORIZONTAL));
app::gen::BrushSlotParams params; app::gen::BrushSlotParams params;
menu.addChild(&params); menu.addChild(&params);
@ -263,7 +265,7 @@ private:
class NewCustomBrushItem : public ButtonSet::Item { class NewCustomBrushItem : public ButtonSet::Item {
public: public:
NewCustomBrushItem() { NewCustomBrushItem() {
setText("Save Brush"); setText(Strings::brush_slot_params_save_brush());
} }
private: private:

View File

@ -97,8 +97,8 @@ public:
ZoomButtons() ZoomButtons()
: ButtonSet(3) { : ButtonSet(3) {
addItem("100%"); addItem("100%");
addItem("Center"); addItem(Strings::context_bar_center());
addItem("Fit Screen"); addItem(Strings::context_bar_fit_screen());
} }
private: private:
@ -142,7 +142,7 @@ class ContextBar::BrushBackField : public ButtonSet {
public: public:
BrushBackField() BrushBackField()
: ButtonSet(1) { : ButtonSet(1) {
addItem("Back"); addItem(Strings::context_bar_back());
} }
protected: protected:
@ -294,9 +294,9 @@ public:
// brush when we call ComboBox::addItem() (because the first // brush when we call ComboBox::addItem() (because the first
// addItem() generates an onChange() event). // addItem() generates an onChange() event).
m_lock = true; m_lock = true;
addItem("Pattern aligned to source"); addItem(Strings::context_bar_pattern_aligned_to_src());
addItem("Pattern aligned to destination"); addItem(Strings::context_bar_pattern_aligned_to_dest());
addItem("Paint brush"); addItem(Strings::context_bar_paint_brush());
m_lock = false; m_lock = false;
setSelectedItemIndex((int)Preferences::instance().brush.pattern()); setSelectedItemIndex((int)Preferences::instance().brush.pattern());
@ -356,7 +356,8 @@ protected:
class ContextBar::ContiguousField : public CheckBox { class ContextBar::ContiguousField : public CheckBox {
public: public:
ContiguousField() : CheckBox("Contiguous") { ContiguousField()
: CheckBox(Strings::context_bar_contiguous()) {
initTheme(); initTheme();
} }
@ -393,16 +394,16 @@ protected:
Menu menu; Menu menu;
MenuItem MenuItem
stopAtGrid("Stop at Grid"), stopAtGrid(Strings::context_bar_stop_at_grid()),
activeLayer("Refer only active layer"), activeLayer(Strings::context_bar_refer_active_layer()),
allLayers("Refer visible layers"); allLayers(Strings::context_bar_refer_visible_layer());
menu.addChild(&stopAtGrid); menu.addChild(&stopAtGrid);
menu.addChild(new MenuSeparator()); menu.addChild(new MenuSeparator());
menu.addChild(&activeLayer); menu.addChild(&activeLayer);
menu.addChild(&allLayers); menu.addChild(&allLayers);
menu.addChild(new MenuSeparator); menu.addChild(new MenuSeparator);
menu.addChild(new Label("Pixel Connectivity:")); menu.addChild(new Label(Strings::context_bar_pixel_connectivity()));
HBox box; HBox box;
ButtonSet buttonset(2); ButtonSet buttonset(2);
@ -525,7 +526,7 @@ public:
addChild(&m_button); addChild(&m_button);
addChild(&m_shade); addChild(&m_shade);
m_shade.setText("Select colors in the palette"); m_shade.setText(Strings::context_bar_select_palette_color());
m_shade.setMinColors(2); m_shade.setMinColors(2);
m_conn = colorBar->ChangeSelection.connect( m_conn = colorBar->ChangeSelection.connect(
[this]{ onChangeColorBarSelection(); }); [this]{ onChangeColorBarSelection(); });
@ -582,8 +583,8 @@ private:
Menu menu; Menu menu;
MenuItem MenuItem
reverse("Reverse Shade"), reverse(Strings::context_bar_reverse_shade()),
save("Save Shade"); save(Strings::context_bar_save_shade());
menu.addChild(&reverse); menu.addChild(&reverse);
menu.addChild(&save); menu.addChild(&save);
@ -786,8 +787,10 @@ public:
onOpaqueChange(); onOpaqueChange();
tooltipManager->addTooltipFor(m_icon.at(0), "Transparent Color Options", BOTTOM); tooltipManager->addTooltipFor(
tooltipManager->addTooltipFor(&m_maskColor, "Transparent Color", BOTTOM); m_icon.at(0), Strings::context_bar_transparent_color_options(), BOTTOM);
tooltipManager->addTooltipFor(
&m_maskColor, Strings::context_bar_transparent_color(), BOTTOM);
} }
private: private:
@ -797,9 +800,9 @@ private:
Menu menu; Menu menu;
MenuItem MenuItem
opaque("Opaque"), opaque(Strings::context_bar_opaque()),
masked("Transparent"), masked(Strings::context_bar_transparent()),
automatic("Adjust automatically depending on layer type"); automatic(Strings::context_bar_auto_adjust_layer());
menu.addChild(&opaque); menu.addChild(&opaque);
menu.addChild(&masked); menu.addChild(&masked);
menu.addChild(new MenuSeparator); menu.addChild(new MenuSeparator);
@ -878,7 +881,7 @@ private:
gfx::Rect bounds = this->bounds(); gfx::Rect bounds = this->bounds();
Menu menu; Menu menu;
CheckBox visible("Display pivot by default"); CheckBox visible(Strings::context_bar_default_display_pivot());
HBox box; HBox box;
ButtonSet buttonset(3); ButtonSet buttonset(3);
buttonset.addItem(theme->parts.pivotNorthwest()); buttonset.addItem(theme->parts.pivotNorthwest());
@ -945,8 +948,10 @@ public:
// algorithm when we call ComboBox::addItem() (because the first // algorithm when we call ComboBox::addItem() (because the first
// addItem() generates an onChange() event). // addItem() generates an onChange() event).
m_lockChange = true; m_lockChange = true;
addItem(new Item("Fast Rotation", tools::RotationAlgorithm::FAST)); addItem(
addItem(new Item("RotSprite", tools::RotationAlgorithm::ROTSPRITE)); new Item(Strings::context_bar_fast_rotation(), tools::RotationAlgorithm::FAST));
addItem(
new Item(Strings::context_bar_rotsprite(), tools::RotationAlgorithm::ROTSPRITE));
m_lockChange = false; m_lockChange = false;
setSelectedItemIndex((int)Preferences::instance().selection.rotationAlgorithm()); setSelectedItemIndex((int)Preferences::instance().selection.rotationAlgorithm());
@ -1219,7 +1224,9 @@ private:
class ContextBar::FreehandAlgorithmField : public CheckBox { class ContextBar::FreehandAlgorithmField : public CheckBox {
public: public:
FreehandAlgorithmField() : CheckBox("Pixel-perfect") { FreehandAlgorithmField()
: CheckBox(Strings::context_bar_pixel_perfect())
{
initTheme(); initTheme();
} }
@ -1277,8 +1284,10 @@ public:
} }
void setupTooltips(TooltipManager* tooltipManager) { void setupTooltips(TooltipManager* tooltipManager) {
tooltipManager->addTooltipFor(at(0), "Linear Gradient", BOTTOM); tooltipManager->addTooltipFor(
tooltipManager->addTooltipFor(at(1), "Radial Gradient", BOTTOM); at(0), Strings::context_bar_linear_gradient(), BOTTOM);
tooltipManager->addTooltipFor(
at(1), Strings::context_bar_radial_gradient(), BOTTOM);
} }
render::GradientType gradientType() const { render::GradientType gradientType() const {
@ -1298,8 +1307,8 @@ public:
void setupTooltips(TooltipManager* tooltipManager) { void setupTooltips(TooltipManager* tooltipManager) {
// TODO Enter and Esc should be configurable keys // TODO Enter and Esc should be configurable keys
tooltipManager->addTooltipFor(at(0), "Drop pixels here (Enter)", BOTTOM); tooltipManager->addTooltipFor(at(0), Strings::context_bar_drop_pixel(), BOTTOM);
tooltipManager->addTooltipFor(at(1), "Cancel drag and drop (Esc)", BOTTOM); tooltipManager->addTooltipFor(at(1), Strings::context_bar_cancel_drag(), BOTTOM);
} }
obs::signal<void(ContextBarObserver::DropAction)> DropPixels; obs::signal<void(ContextBarObserver::DropAction)> DropPixels;
@ -1329,15 +1338,15 @@ public:
m_channel.addItem("HSL"); m_channel.addItem("HSL");
m_channel.addItem("Gray+Alpha"); m_channel.addItem("Gray+Alpha");
m_channel.addItem("Gray"); m_channel.addItem("Gray");
m_channel.addItem("Best fit Index"); m_channel.addItem(Strings::context_bar_best_fit_index());
m_sample.addItem("All Layers"); m_sample.addItem(Strings::context_bar_all_layers());
m_sample.addItem("Current Layer"); m_sample.addItem(Strings::context_bar_current_layer());
m_sample.addItem("First Reference Layer"); m_sample.addItem(Strings::context_bar_first_ref_layer());
addChild(new Label("Pick:")); addChild(new Label(Strings::context_bar_pick()));
addChild(&m_channel); addChild(&m_channel);
addChild(new Label("Sample:")); addChild(new Label(Strings::context_bar_sample()));
addChild(&m_sample); addChild(&m_sample);
m_channel.Change.connect([this]{ onChannelChange(); }); m_channel.Change.connect([this]{ onChannelChange(); });
@ -1366,7 +1375,9 @@ private:
class ContextBar::AutoSelectLayerField : public CheckBox { class ContextBar::AutoSelectLayerField : public CheckBox {
public: public:
AutoSelectLayerField() : CheckBox("Auto Select Layer") { AutoSelectLayerField()
: CheckBox(Strings::context_bar_auto_select_layer())
{
initTheme(); initTheme();
} }
@ -1521,8 +1532,8 @@ public:
{ {
auto theme = SkinTheme::get(this); auto theme = SkinTheme::get(this);
m_sel.addItem("All"); m_sel.addItem(Strings::context_bar_all());
m_sel.addItem("None"); m_sel.addItem(Strings::context_bar_none());
m_sel.ItemChange.connect( m_sel.ItemChange.connect(
[this](ButtonSet::Item* item){ [this](ButtonSet::Item* item){
onSelAction(m_sel.selectedItem()); onSelAction(m_sel.selectedItem());
@ -1548,10 +1559,14 @@ public:
} }
void setupTooltips(TooltipManager* tooltipManager) { void setupTooltips(TooltipManager* tooltipManager) {
tooltipManager->addTooltipFor(m_sel.at(0), "Select All Slices", BOTTOM); tooltipManager->addTooltipFor(
tooltipManager->addTooltipFor(m_sel.at(1), "Deselect Slices", BOTTOM); m_sel.at(0), Strings::context_bar_select_slices(), BOTTOM);
tooltipManager->addTooltipFor(m_action.at(0), "Slice Properties", BOTTOM); tooltipManager->addTooltipFor(
tooltipManager->addTooltipFor(m_action.at(1), "Delete Slice", BOTTOM); m_sel.at(1), Strings::context_bar_deselect_slices(), BOTTOM);
tooltipManager->addTooltipFor(
m_action.at(0), Strings::context_bar_slice_props(), BOTTOM);
tooltipManager->addTooltipFor(
m_action.at(1), Strings::context_bar_delete_slice(), BOTTOM);
} }
void setDoc(Doc* doc) { void setDoc(Doc* doc) {
@ -2448,26 +2463,38 @@ const tools::DynamicsOptions& ContextBar::getDynamics() const
void ContextBar::setupTooltips(TooltipManager* tooltipManager) void ContextBar::setupTooltips(TooltipManager* tooltipManager)
{ {
tooltipManager->addTooltipFor(m_brushBack->at(0), "Discard Brush (Esc)", BOTTOM); tooltipManager->addTooltipFor(
tooltipManager->addTooltipFor(m_brushType->at(0), "Brush Type", BOTTOM); m_brushBack->at(0), Strings::context_bar_discard_brush(), BOTTOM);
tooltipManager->addTooltipFor(m_brushSize, "Brush Size (in pixels)", BOTTOM); tooltipManager->addTooltipFor(
tooltipManager->addTooltipFor(m_brushAngle, "Brush Angle (in degrees)", BOTTOM); m_brushType->at(0), Strings::context_bar_brush_type(), BOTTOM);
tooltipManager->addTooltipFor(m_inkType->at(0), "Ink", BOTTOM); tooltipManager->addTooltipFor(
tooltipManager->addTooltipFor(m_inkOpacity, "Opacity (paint intensity)", BOTTOM); m_brushSize, Strings::context_bar_brush_size(), BOTTOM);
tooltipManager->addTooltipFor(m_inkShades->at(0), "Shades", BOTTOM); tooltipManager->addTooltipFor(
tooltipManager->addTooltipFor(m_sprayWidth, "Spray Width", BOTTOM); m_brushAngle, Strings::context_bar_brush_angle(), BOTTOM);
tooltipManager->addTooltipFor(m_spraySpeed, "Spray Speed", BOTTOM); tooltipManager->addTooltipFor(
tooltipManager->addTooltipFor(m_pivot->at(0), "Rotation Pivot", BOTTOM); m_inkType->at(0), Strings::context_bar_ink(), BOTTOM);
tooltipManager->addTooltipFor(m_rotAlgo, "Rotation Algorithm", BOTTOM); tooltipManager->addTooltipFor(
tooltipManager->addTooltipFor(m_dynamics->at(0), "Dynamics", BOTTOM); m_inkOpacity, Strings::context_bar_opacity(), BOTTOM);
tooltipManager->addTooltipFor(
m_inkShades->at(0), Strings::context_bar_shades(), BOTTOM);
tooltipManager->addTooltipFor(
m_sprayWidth, Strings::context_bar_spray_width(), BOTTOM);
tooltipManager->addTooltipFor(
m_spraySpeed, Strings::context_bar_spray_speed(), BOTTOM);
tooltipManager->addTooltipFor(
m_pivot->at(0), Strings::context_bar_rotation_pivot(), BOTTOM);
tooltipManager->addTooltipFor(
m_rotAlgo, Strings::context_bar_rotation_algorithm(), BOTTOM);
tooltipManager->addTooltipFor(
m_dynamics->at(0), Strings::context_bar_dynamics(), BOTTOM);
tooltipManager->addTooltipFor(m_freehandAlgo, tooltipManager->addTooltipFor(m_freehandAlgo,
key_tooltip("Freehand trace algorithm", key_tooltip("Freehand trace algorithm",
CommandId::PixelPerfectMode()), BOTTOM); CommandId::PixelPerfectMode()), BOTTOM);
tooltipManager->addTooltipFor(m_contiguous, tooltipManager->addTooltipFor(m_contiguous,
key_tooltip("Fill contiguous areas color", key_tooltip("Fill contiguous areas color",
CommandId::ContiguousFill()), BOTTOM); CommandId::ContiguousFill()), BOTTOM);
tooltipManager->addTooltipFor(m_paintBucketSettings->at(0), tooltipManager->addTooltipFor(
"Extra paint bucket options", BOTTOM); m_paintBucketSettings->at(0), Strings::context_bar_paint_bucket_option(), BOTTOM);
m_selectionMode->setupTooltips(tooltipManager); m_selectionMode->setupTooltips(tooltipManager);
m_gradientType->setupTooltips(tooltipManager); m_gradientType->setupTooltips(tooltipManager);

View File

@ -13,6 +13,7 @@
#include "app/commands/command.h" #include "app/commands/command.h"
#include "app/commands/commands.h" #include "app/commands/commands.h"
#include "app/i18n/strings.h"
#include "app/modules/editors.h" #include "app/modules/editors.h"
#include "app/ui/editor/editor.h" #include "app/ui/editor/editor.h"
#include "app/ui/keyboard_shortcuts.h" #include "app/ui/keyboard_shortcuts.h"
@ -124,12 +125,12 @@ std::string AniControls::getTooltipFor(int index) const
Params(), Params(),
KeyContext::Normal); KeyContext::Normal);
if (key && !key->accels().empty()) { if (key && !key->accels().empty()) {
tooltip += "\n\nShortcut: "; tooltip += "\n\n" + Strings::ani_controls_shortcut() + " ";
tooltip += key->accels().front().toString(); tooltip += key->accels().front().toString();
} }
if (index == ACTION_PLAY) { if (index == ACTION_PLAY) {
tooltip += "\n\nRight-click: Show playback options"; tooltip += "\n\n" + Strings::ani_controls_right_click();
} }
} }