diff --git a/data/strings/en.ini b/data/strings/en.ini index 4395e0dc5..c508a37c9 100644 --- a/data/strings/en.ini +++ b/data/strings/en.ini @@ -23,6 +23,23 @@ sprite_without_profile = The sprite doesn't contain a color profile. [statusbar_tips] all_layers_are_locked = All selected layers are locked layer_locked = Layer '{0}' is locked +disable_snap_grid = Disable Snap to Grid +frame = Frame: +current_frame = Current Frame +zoom_level = Zoom Level +new_frame = New Frame +locked_layers = There are locked layers +no_active_layers = There is no active layer +layer_x_is_hidden = Layer '{}' is hidden +unmodifiable_reference_layer = Layer '{}' is reference, cannot be modified +filter_no_unlocked_layer = No unlocked layers to apply filter +cannot_move_bg_layer = The background layer cannot be moved +nothing_to_move = Nothing to move +recovery_task_using_sprite = Sprite is used by a backup/data recovery task +non_transformable_reference_layer = Layer '{}' is reference, cannot be transformed +sprite_locked_somewhere = The sprite is locked in other editor +not_enough_transform_memory = Not enough memory to transform the selection +not_enough_rotsprite_memory = Not enough memory for RotSprite [alerts] applying_filter = FX<showTip(1000, - "There are locked layers"); + Strings::statusbar_tips_locked_layers()); update_screen_for_document(document); } diff --git a/src/app/commands/cmd_export_sprite_sheet.cpp b/src/app/commands/cmd_export_sprite_sheet.cpp index a20b73379..68fef75fb 100644 --- a/src/app/commands/cmd_export_sprite_sheet.cpp +++ b/src/app/commands/cmd_export_sprite_sheet.cpp @@ -1335,7 +1335,7 @@ void ExportSpriteSheetCommand::onExecute(Context* context) StatusBar* statusbar = StatusBar::instance(); if (statusbar) - statusbar->showTip(1000, "Sprite Sheet Generated"); + statusbar->showTip(1000, Strings::export_sprite_sheet_generated()); // Save the exported sprite sheet as a recent file if (newDocument->isAssociatedToFile()) diff --git a/src/app/commands/cmd_link_cels.cpp b/src/app/commands/cmd_link_cels.cpp index 48c5700b6..a466add56 100644 --- a/src/app/commands/cmd_link_cels.cpp +++ b/src/app/commands/cmd_link_cels.cpp @@ -12,6 +12,7 @@ #include "app/cmd/copy_cel.h" #include "app/commands/command.h" #include "app/context_access.h" +#include "app/i18n/strings.h" #include "app/modules/gui.h" #include "app/tx.h" #include "app/ui/status_bar.h" @@ -91,7 +92,7 @@ void LinkCelsCommand::onExecute(Context* context) if (nonEditableLayers) StatusBar::instance()->showTip(1000, - "There are locked layers"); + Strings::statusbar_tips_locked_layers()); update_screen_for_document(document); } diff --git a/src/app/commands/cmd_remove_layer.cpp b/src/app/commands/cmd_remove_layer.cpp index 0ee577521..6e4944fc0 100644 --- a/src/app/commands/cmd_remove_layer.cpp +++ b/src/app/commands/cmd_remove_layer.cpp @@ -97,9 +97,11 @@ void RemoveLayerCommand::onExecute(Context* context) StatusBar::instance()->invalidate(); if (!layerName.empty()) - StatusBar::instance()->showTip(1000, fmt::format("Layer '{}' removed", layerName)); + StatusBar::instance()->showTip( + 1000, fmt::format(Strings::remove_layer_x_removed(), layerName)); else - StatusBar::instance()->showTip(1000, "Layers removed"); + StatusBar::instance()->showTip(1000, + Strings::remove_layer_layers_removed()); } #endif } diff --git a/src/app/commands/cmd_remove_slice.cpp b/src/app/commands/cmd_remove_slice.cpp index 986444a3a..433e5dcb4 100644 --- a/src/app/commands/cmd_remove_slice.cpp +++ b/src/app/commands/cmd_remove_slice.cpp @@ -14,6 +14,7 @@ #include "app/cmd/set_slice_key.h" #include "app/commands/command.h" #include "app/context_access.h" +#include "app/i18n/strings.h" #include "app/modules/gui.h" #include "app/tx.h" #include "app/ui/status_bar.h" @@ -122,10 +123,12 @@ void RemoveSliceCommand::onExecute(Context* context) StatusBar::instance()->invalidate(); if (!sliceName.empty()) StatusBar::instance()->showTip( - 1000, fmt::format("Slice '{}' removed", sliceName)); + 1000, fmt::format(Strings::remove_slice_x_removed(), sliceName)); else StatusBar::instance()->showTip( - 1000, fmt::format("{} slice(s) removed", slicesToDelete.size())); + 1000, + fmt::format(Strings::remove_slice_n_slices_removed(), + slicesToDelete.size())); } Command* CommandFactory::createRemoveSliceCommand() diff --git a/src/app/commands/cmd_unlink_cel.cpp b/src/app/commands/cmd_unlink_cel.cpp index a57b6b135..6e544968b 100644 --- a/src/app/commands/cmd_unlink_cel.cpp +++ b/src/app/commands/cmd_unlink_cel.cpp @@ -12,6 +12,7 @@ #include "app/cmd/unlink_cel.h" #include "app/commands/command.h" #include "app/context_access.h" +#include "app/i18n/strings.h" #include "app/modules/gui.h" #include "app/tx.h" #include "app/ui/status_bar.h" @@ -84,7 +85,7 @@ void UnlinkCelCommand::onExecute(Context* context) if (nonEditableLayers) StatusBar::instance()->showTip(1000, - "There are locked layers"); + Strings::statusbar_tips_locked_layers()); update_screen_for_document(document); } diff --git a/src/app/commands/filters/filter_worker.cpp b/src/app/commands/filters/filter_worker.cpp index bd2e1fdbe..a378cee55 100644 --- a/src/app/commands/filters/filter_worker.cpp +++ b/src/app/commands/filters/filter_worker.cpp @@ -170,8 +170,8 @@ void FilterWorker::run() console.printf("A problem has occurred.\n\nDetails:\n%s", m_error.c_str()); } else if (m_cancelled && !m_filterMgr->isTransaction()) { - StatusBar::instance() - ->showTip(2500, "No unlocked layers to apply filter"); + StatusBar::instance()->showTip(2500, + Strings::statusbar_tips_filter_no_unlocked_layer()); } #endif // ENABLE_UI } diff --git a/src/app/ui/editor/pixels_movement.cpp b/src/app/ui/editor/pixels_movement.cpp index 6784aa122..7c6168dba 100644 --- a/src/app/ui/editor/pixels_movement.cpp +++ b/src/app/ui/editor/pixels_movement.cpp @@ -19,6 +19,7 @@ #include "app/console.h" #include "app/doc.h" #include "app/doc_api.h" +#include "app/i18n/strings.h" #include "app/modules/gui.h" #include "app/pref/preferences.h" #include "app/site.h" @@ -1170,8 +1171,9 @@ retry:; // In case that we don't have enough memory for RotSprite int(corners.leftBottom().y-leftTop.y)); } catch (const std::bad_alloc&) { - StatusBar::instance()->showTip(1000, - "Not enough memory for RotSprite"); + StatusBar::instance()->showTip( + 1000, + Strings::statusbar_tips_not_enough_rotsprite_memory()); rotAlgo = tools::RotationAlgorithm::FAST; goto retry; diff --git a/src/app/ui/editor/standby_state.cpp b/src/app/ui/editor/standby_state.cpp index 6ae1cc377..fbce4fb5c 100644 --- a/src/app/ui/editor/standby_state.cpp +++ b/src/app/ui/editor/standby_state.cpp @@ -180,12 +180,14 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg) if (layer) { // TODO we should be able to move the `Background' with tiled mode if (layer->isBackground()) { - StatusBar::instance()->showTip(1000, - "The background layer cannot be moved"); + StatusBar::instance()->showTip( + 1000, Strings::statusbar_tips_cannot_move_bg_layer()); } else if (!layer->isVisibleHierarchy()) { StatusBar::instance()->showTip( - 1000, fmt::format("Layer '{}' is hidden", layer->name())); + 1000, + fmt::format(Strings::statusbar_tips_layer_x_is_hidden(), + layer->name())); } else if (!layer->isMovable() || !layer->isEditableHierarchy()) { StatusBar::instance()->showTip( @@ -195,7 +197,7 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg) MovingCelCollect collect(editor, layer); if (collect.empty()) { StatusBar::instance()->showTip( - 1000, "Nothing to move"); + 1000, Strings::statusbar_tips_nothing_to_move()); } else { try { @@ -211,7 +213,7 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg) catch (const LockedDocException&) { // TODO break the background task that is locking this sprite StatusBar::instance()->showTip( - 1000, "Sprite is used by a backup/data recovery task"); + 1000, Strings::statusbar_tips_recovery_task_using_sprite()); } } } @@ -748,7 +750,8 @@ void StandbyState::transformSelection(Editor* editor, MouseMessage* msg, HandleT Layer* layer = editor->layer(); if (layer && layer->isReference()) { StatusBar::instance()->showTip( - 1000, fmt::format("Layer '{}' is reference, cannot be transformed", + 1000, + fmt::format(Strings::statusbar_tips_non_transformable_reference_layer(), layer->name())); return; } @@ -803,11 +806,13 @@ void StandbyState::transformSelection(Editor* editor, MouseMessage* msg, HandleT // Other editor is locking the document. // TODO steal the PixelsMovement of the other editor and use it for this one. - StatusBar::instance()->showTip(1000, "The sprite is locked in other editor"); + StatusBar::instance()->showTip( + 1000, Strings::statusbar_tips_sprite_locked_somewhere()); editor->showMouseCursor(kForbiddenCursor); } catch (const std::bad_alloc&) { - StatusBar::instance()->showTip(1000, "Not enough memory to transform the selection"); + StatusBar::instance()->showTip( + 1000, Strings::statusbar_tips_not_enough_transform_memory()); editor->showMouseCursor(kForbiddenCursor); } } diff --git a/src/app/ui/editor/tool_loop_impl.cpp b/src/app/ui/editor/tool_loop_impl.cpp index 539870085..85c843ffa 100644 --- a/src/app/ui/editor/tool_loop_impl.cpp +++ b/src/app/ui/editor/tool_loop_impl.cpp @@ -818,12 +818,14 @@ tools::ToolLoop* create_tool_loop( Layer* layer = site.layer(); if (!layer) { StatusBar::instance()->showTip( - 1000, "There is no active layer"); + 1000, Strings::statusbar_tips_no_active_layers()); return nullptr; } else if (!layer->isVisibleHierarchy()) { StatusBar::instance()->showTip( - 1000, fmt::format("Layer '{}' is hidden", layer->name())); + 1000, + fmt::format(Strings::statusbar_tips_layer_x_is_hidden(), + layer->name())); return nullptr; } // If the active layer is read-only. @@ -833,7 +835,9 @@ tools::ToolLoop* create_tool_loop( // If the active layer is reference. else if (layer->isReference()) { StatusBar::instance()->showTip( - 1000, fmt::format("Layer '{}' is reference, cannot be modified", layer->name())); + 1000, + fmt::format(Strings::statusbar_tips_unmodifiable_reference_layer(), + layer->name())); return nullptr; } } diff --git a/src/app/ui/status_bar.cpp b/src/app/ui/status_bar.cpp index 67f62f0bc..f557bf2a9 100644 --- a/src/app/ui/status_bar.cpp +++ b/src/app/ui/status_bar.cpp @@ -16,6 +16,7 @@ #include "app/doc_access.h" #include "app/doc_event.h" #include "app/doc_range.h" +#include "app/i18n/strings.h" #include "app/modules/editors.h" #include "app/modules/gfx.h" #include "app/modules/gui.h" @@ -587,7 +588,7 @@ class StatusBar::SnapToGridWindow : public ui::PopupWindow { public: SnapToGridWindow() : ui::PopupWindow("", ClickBehavior::DoNothingOnClick) - , m_button("Disable Snap to Grid") { + , m_button(Strings::statusbar_tips_disable_snap_grid()) { InitTheme.connect( [this]{ setBorder(gfx::Border(2 * guiscale())); @@ -692,7 +693,7 @@ StatusBar::StatusBar(TooltipManager* tooltipManager) Box* box1 = new Box(HORIZONTAL); Box* box4 = new Box(HORIZONTAL); - m_frameLabel = new Label("Frame:"); + m_frameLabel = new Label(Strings::statusbar_tips_frame()); m_currentFrame = new GotoFrameEntry(); m_newFrame = new Button("+"); m_newFrame->Click.connect([this]{ newFrame(); }); @@ -713,9 +714,12 @@ StatusBar::StatusBar(TooltipManager* tooltipManager) } // Tooltips - tooltipManager->addTooltipFor(m_currentFrame, "Current Frame", BOTTOM); - tooltipManager->addTooltipFor(m_zoomEntry, "Zoom Level", BOTTOM); - tooltipManager->addTooltipFor(m_newFrame, "New Frame", BOTTOM); + tooltipManager->addTooltipFor( + m_currentFrame, Strings::statusbar_tips_current_frame(), BOTTOM); + tooltipManager->addTooltipFor( + m_zoomEntry, Strings::statusbar_tips_zoom_level(), BOTTOM); + tooltipManager->addTooltipFor( + m_newFrame, Strings::statusbar_tips_new_frame(), BOTTOM); App::instance()->activeToolManager()->add_observer(this);