From aaa69a3d81fc9cdc5a658a39476beadb434a37bb Mon Sep 17 00:00:00 2001 From: Joshua Ogunyinka Date: Mon, 10 Jan 2022 11:53:14 +0400 Subject: [PATCH] Add more missing language strings when importing/exporting sprite sheets --- data/strings/en.ini | 3 +++ src/app/commands/cmd_export_sprite_sheet.cpp | 9 ++++++--- src/app/commands/cmd_import_sprite_sheet.cpp | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/data/strings/en.ini b/data/strings/en.ini index 7bbd172f5..5908a0ddd 100644 --- a/data/strings/en.ini +++ b/data/strings/en.ini @@ -770,6 +770,8 @@ cancel = &Cancel [export_sprite_sheet] title = Export Sprite Sheet +save_title = Save Sprite Sheet +save_json_title = Save JSON Data sprite = Sprite sprite_tooltip = Source of sprite samples to export in the sprite sheet borders = Borders @@ -975,6 +977,7 @@ horizontal_padding = Horizontal: vertical_padding = Vertical: partial_tiles = Include partial tiles at bottom/right edges context_bar_help = Select bounds to identify sprite frames +layer_name = Sprite Sheet import = &Import cancel = &Cancel diff --git a/src/app/commands/cmd_export_sprite_sheet.cpp b/src/app/commands/cmd_export_sprite_sheet.cpp index 68fef75fb..84148eb89 100644 --- a/src/app/commands/cmd_export_sprite_sheet.cpp +++ b/src/app/commands/cmd_export_sprite_sheet.cpp @@ -854,7 +854,7 @@ private: void onImageFilename() { base::paths newFilename; if (!app::show_file_selector( - "Save Sprite Sheet", m_filename, + Strings::export_sprite_sheet_save_title(), m_filename, get_writable_extensions(), FileSelectorType::Save, newFilename)) return; @@ -879,8 +879,11 @@ private: base::paths exts = { "json" }; base::paths newFilename; if (!app::show_file_selector( - "Save JSON Data", m_dataFilename, exts, - FileSelectorType::Save, newFilename)) + Strings::export_sprite_sheet_save_json_title(), + m_dataFilename, + exts, + FileSelectorType::Save, + newFilename)) return; ASSERT(!newFilename.empty()); diff --git a/src/app/commands/cmd_import_sprite_sheet.cpp b/src/app/commands/cmd_import_sprite_sheet.cpp index a939c639d..f69e6dfb2 100644 --- a/src/app/commands/cmd_import_sprite_sheet.cpp +++ b/src/app/commands/cmd_import_sprite_sheet.cpp @@ -518,7 +518,8 @@ void ImportSpriteSheetCommand::onExecute(Context* context) DocApi api = document->getApi(tx); // Add the layer in the sprite. - LayerImage* resultLayer = api.newLayer(sprite->root(), "Sprite Sheet"); + LayerImage* resultLayer = + api.newLayer(sprite->root(), Strings::import_sprite_sheet_layer_name()); // Add all frames+cels to the new layer for (size_t i=0; i