Navigation Menu

Skip to content

Commit

Permalink
Translate all alerts to the en.ini file (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
dacap committed Oct 17, 2017
1 parent 36a44e6 commit a9b1837
Show file tree
Hide file tree
Showing 30 changed files with 320 additions and 181 deletions.
131 changes: 131 additions & 0 deletions data/strings/en.ini
Expand Up @@ -6,6 +6,137 @@ title = Warning - Important
description = You are going to enter in "Advanced Mode".
dont_show_again = Don't show this again
[alerts]
applying_filter = FX<<Applying effect...||&Cancel
auto_remap = <<<END
Automatic Remap
<<The remap operation cannot be perfectly done for more than 256 colors.
<<Do you want to continue anyway?
||&OK||&Cancel"
END
cannot_delete_all_layers = Error<<You cannot delete all layers.||&OK
cannot_file_overwrite_on_export = <<<END
Overwrite Warning
<<You cannot Export with the same name (overwrite the original file).
<<Use File > Save As menu option in that case.
||&OK
END
cannot_open_file = Problem<<Cannot open file:<<{0}||&OK
cannot_open_folder = Problem<<Cannot open folder:<<{0}||&OK
cannot_save_in_read_only_file = Problem<<The selected file is read-only. Try with other file.||&Go back
clipboard_access_locked = Error<<Cannot access to the clipboard.<<Maybe other application is using it.||&OK
clipboard_image_format_not_supported = Error<<The current clipboard image format is not supported.||&OK
delete_selected_backups = <<<END
Warning
<<Do you really want to delete the selected {0} backup(s)?
||&Yes||&No
END
delete_shortcut = <<<END
Warning
<<Do you really want to delete '{0}' keyboard shortcut?
||&Yes||&No
END
empty_rect_importing_sprite_sheet = <<<END
Import Sprite Sheet
<<The specified rectangle does not create any tile.
<<Select a rectangle inside the sprite region.
||&OK
END
error_loading_file = Error<<Error loading file: {0}||&OK
error_saving_file = Error<<Error saving file: {0}||&OK
export_animation_in_sequence = <<<END
Notice
<<Do you want to export the animation in {0} files?
<<{1}, {2}...
||&Agree||&Cancel
END
file_format_doesnt_support_error = <<<END
Error
<<File format ".{0}" doesn't support:
{1}
<<You must select other format.
<<Use ".ase" to keep all the sprite information.
||&OK
END
file_format_doesnt_support_warning = <<<END
Warning
<<File format ".{0}" doesn't support:
{1}
<<You can use ".ase" format to keep all this information.
<<Do you want continue with ".{0}" anyway?
||&Yes||&No
END
file_format_alpha_channel = Alpha channel
file_format_frame_tags = Frame tags
file_format_frames = Frames
file_format_grayscale_mode = Grayscale mode
file_format_indexed_mode = Indexed mode
file_format_layers = Layers
file_format_palette_changes = Palette changes between frames
file_format_rgb_mode = RGB mode
invalid_chars_in_filename = <<<END
Error
<<The file name cannot contain the following character(s):
<< {0}
||&OK
END
invalid_fg_or_bg_colors = <<<END
Aseprite
<<The current selected foreground and/or background color
<<is out of range. Select a valid color in the palette.
||&OK
END
job_working = {0}<<Working...||&Cancel
nothing_to_report = Crash Report<<Nothing to report||&OK
uninstall_extension_warning = <<<END
Warning
<<Do you really want to uninstall '{0}' extension?
||&Yes||&No
END
update_screen_ui_scaling_with_theme_values = <<<END
Update Screen/UI Scaling
<<The new theme '{0}' wants to adjust some values for you:
<< Screen Scaling: {1}% -> {2}%
<< UI Scaling: {3}% -> {4}%
<<Allow these changes?
||&Adjust Scaling||&Don't Adjust Scaling
END
update_extension = <<<END
Update Extension
<<The extension '{0}' already exists.
<<Do you want to {1} from v{2} to v{3}?
||&Yes||&No
END
update_extension_downgrade = downgrade
update_extension_upgrade = upgrade
restart_by_preferences = <<<END
Aseprite
<<You must restart the program to see your changes to:{0}
||&OK
END
restart_by_preferences_save_recovery_data_period = Automatically save recovery data every X minutes
restore_all_shortcuts = <<<END
Warning
<<Do you want to restore all keyboard shortcuts
<<to their original default settings?
||&Yes||&No
END
save_sprite_changes = <<<END
Warning
<<Saving changes to the sprite
<<"{0}" before {1}?
||&Save||Do&n't Save||&Cancel
END
save_sprite_changes_quitting = quitting
save_sprite_changes_closing = closing
overwrite_existent_file = Warning<<File exists, overwrite it?<<{0}||&Yes||&No||&Cancel
overwrite_files_on_export_sprite_sheet = <<<END
Export Sprite Sheet Warning
<<Do you want to overwrite the following file(s)?
{0}
||&Yes||&No
END
[brush_slot_params]
brush = Brush:
brush_type = Type
Expand Down
8 changes: 5 additions & 3 deletions src/app/commands/cmd_export_sprite_sheet.cpp
Expand Up @@ -16,6 +16,7 @@
#include "app/document_exporter.h"
#include "app/file/file.h"
#include "app/file_selector.h"
#include "app/i18n/strings.h"
#include "app/modules/editors.h"
#include "app/pref/preferences.h"
#include "app/restore_visible_layers.h"
Expand All @@ -29,6 +30,7 @@
#include "base/string.h"
#include "doc/frame_tag.h"
#include "doc/layer.h"
#include "fmt/format.h"

#include "export_sprite_sheet.xml.h"

Expand Down Expand Up @@ -138,16 +140,16 @@ namespace {
!dataname.empty() &&
base::is_file(dataname))) {
std::stringstream text;
text << "Export Sprite Sheet Warning<<Do you want to overwrite the following file(s)?";

if (base::is_file(filename))
text << "<<" << base::get_file_name(filename).c_str();

if (base::is_file(dataname))
text << "<<" << base::get_file_name(dataname).c_str();

text << "||&Yes||&No";
if (Alert::show(text.str().c_str()) != 1)
if (ui::Alert::show(
fmt::format(Strings::alerts_overwrite_files_on_export_sprite_sheet(),
text.str())) != 1)
return false;
}
return true;
Expand Down
8 changes: 3 additions & 5 deletions src/app/commands/cmd_import_sprite_sheet.cpp
@@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2001-2016 David Capello
// Copyright (C) 2001-2017 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
Expand All @@ -16,6 +16,7 @@
#include "app/context_access.h"
#include "app/document_access.h"
#include "app/document_api.h"
#include "app/i18n/strings.h"
#include "app/modules/editors.h"
#include "app/modules/gui.h"
#include "app/modules/palettes.h"
Expand Down Expand Up @@ -379,10 +380,7 @@ void ImportSpriteSheetCommand::onExecute(Context* context)
}

if (animation.size() == 0) {
Alert::show("Import Sprite Sheet"
"<<The specified rectangle does not create any tile."
"<<Select a rectangle inside the sprite region."
"||&OK");
Alert::show(Strings::alerts_empty_rect_importing_sprite_sheet());
return;
}

Expand Down
16 changes: 7 additions & 9 deletions src/app/commands/cmd_keyboard_shortcuts.cpp
Expand Up @@ -13,6 +13,7 @@
#include "app/commands/command.h"
#include "app/context.h"
#include "app/file_selector.h"
#include "app/i18n/strings.h"
#include "app/match_words.h"
#include "app/resource_finder.h"
#include "app/tools/tool.h"
Expand All @@ -28,6 +29,7 @@
#include "base/scoped_value.h"
#include "base/split_string.h"
#include "base/string.h"
#include "fmt/format.h"
#include "ui/graphics.h"
#include "ui/listitem.h"
#include "ui/paint_event.h"
Expand Down Expand Up @@ -144,11 +146,10 @@ class KeyItem : public ListItem {
// Key::disableAccel() will modify the accels() collection itself.
ui::Accelerator accel = m_key->accels()[index];

if (Alert::show(
"Warning"
"<<Do you really want to delete '%s' keyboard shortcut?"
"||&Yes||&No",
accel.toString().c_str()) != 1)
if (ui::Alert::show(
fmt::format(
Strings::alerts_delete_shortcut(),
accel.toString())) != 1)
return;

m_key->disableAccel(accel);
Expand Down Expand Up @@ -586,10 +587,7 @@ class KeyboardShortcutsWindow : public app::gen::KeyboardShortcuts {
}

void onReset() {
if (Alert::show("Warning"
"<<Do you want to restore all keyboard shortcuts"
"<<to their original default settings?"
"||&Yes||&No") == 1) {
if (ui::Alert::show(Strings::alerts_restore_all_shortcuts()) == 1) {
app::KeyboardShortcuts::instance()->reset();
layout();
}
Expand Down
9 changes: 6 additions & 3 deletions src/app/commands/cmd_load_mask.cpp
Expand Up @@ -13,11 +13,13 @@
#include "app/commands/params.h"
#include "app/context_access.h"
#include "app/file_selector.h"
#include "app/i18n/strings.h"
#include "app/modules/gui.h"
#include "app/transaction.h"
#include "app/util/msk_file.h"
#include "doc/mask.h"
#include "doc/sprite.h"
#include "fmt/format.h"
#include "ui/alert.h"

namespace app {
Expand Down Expand Up @@ -68,9 +70,10 @@ void LoadMaskCommand::onExecute(Context* context)
}

base::UniquePtr<Mask> mask(load_msk_file(m_filename.c_str()));
if (!mask)
throw base::Exception("Error loading .msk file: %s",
static_cast<const char*>(m_filename.c_str()));
if (!mask) {
ui::Alert::show(fmt::format(Strings::alerts_error_loading_file(), m_filename));
return;
}

{
ContextWriter writer(reader);
Expand Down
4 changes: 3 additions & 1 deletion src/app/commands/cmd_load_palette.cpp
Expand Up @@ -14,10 +14,12 @@
#include "app/context.h"
#include "app/file/palette_file.h"
#include "app/file_selector.h"
#include "app/i18n/strings.h"
#include "app/modules/palettes.h"
#include "base/fs.h"
#include "base/unique_ptr.h"
#include "doc/palette.h"
#include "fmt/format.h"
#include "ui/alert.h"

namespace app {
Expand Down Expand Up @@ -80,7 +82,7 @@ void LoadPaletteCommand::onExecute(Context* context)
base::UniquePtr<doc::Palette> palette(load_palette(filename.c_str()));
if (!palette) {
if (context->isUIAvailable())
Alert::show("Error<<Loading palette file||&Close");
ui::Alert::show(fmt::format(Strings::alerts_error_loading_file(), filename));
return;
}

Expand Down
50 changes: 23 additions & 27 deletions src/app/commands/cmd_options.cpp
Expand Up @@ -14,6 +14,7 @@
#include "app/context.h"
#include "app/extensions.h"
#include "app/file_selector.h"
#include "app/i18n/strings.h"
#include "app/ini_file.h"
#include "app/launcher.h"
#include "app/pref/preferences.h"
Expand All @@ -28,6 +29,7 @@
#include "base/string.h"
#include "base/version.h"
#include "doc/image.h"
#include "fmt/format.h"
#include "render/render.h"
#include "she/display.h"
#include "she/system.h"
Expand Down Expand Up @@ -371,7 +373,7 @@ class OptionsWindow : public app::gen::Options {
m_pref.general.dataRecovery(enableDataRecovery()->isSelected());
m_pref.general.dataRecoveryPeriod(newPeriod);

warnings += "<<- Automatically save recovery data every";
warnings += "<<- " + Strings::alerts_restart_by_preferences_save_recovery_data_period();
}

m_pref.editor.zoomFromCenterWithWheel(zoomFromCenterWithWheel()->isSelected());
Expand Down Expand Up @@ -463,9 +465,9 @@ class OptionsWindow : public app::gen::Options {
m_pref.save();

if (!warnings.empty()) {
ui::Alert::show(PACKAGE
"<<You must restart the program to see your changes to:%s"
"||&OK", warnings.c_str());
ui::Alert::show(
fmt::format(Strings::alerts_restart_by_preferences(),
warnings));
}

if (reset_screen)
Expand Down Expand Up @@ -778,17 +780,13 @@ class OptionsWindow : public app::gen::Options {
// Ask if the user want to adjust the Screen/UI Scaling
const int result =
ui::Alert::show(
"Update Screen/UI Scaling"
"<<The new theme '%s' wants to adjust some values for you:"
"<< Screen Scaling: %d%% -> %d%%"
"<< UI Scaling: %d%% -> %d%%"
"<<Allow these changes?"
"||&Adjust Scaling||&Don't Adjust Scaling",
themeName.c_str(),
100 * m_pref.general.screenScale(),
100 * (newScreenScale > 0 ? newScreenScale: m_pref.general.screenScale()),
100 * m_pref.general.uiScale(),
100 * (newUIScale > 0 ? newUIScale: m_pref.general.uiScale()));
fmt::format(
Strings::alerts_update_screen_ui_scaling_with_theme_values(),
themeName,
100 * m_pref.general.screenScale(),
100 * (newScreenScale > 0 ? newScreenScale: m_pref.general.screenScale()),
100 * m_pref.general.uiScale(),
100 * (newUIScale > 0 ? newUIScale: m_pref.general.uiScale())));

if (result == 1) {
// Preferred UI Scaling factor
Expand Down Expand Up @@ -865,14 +863,13 @@ class OptionsWindow : public app::gen::Options {

// Uninstall?
if (ui::Alert::show(
"Update Extension"
"<<The extension '%s' already exists."
"<<Do you want to %s from v%s to v%s?"
"||&Yes||&No",
ext->name().c_str(),
(isDowngrade ? "downgrade": "upgrade"),
ext->version().c_str(),
info.version.c_str()) != 1)
fmt::format(
Strings::alerts_update_extension(),
ext->name(),
(isDowngrade ? Strings::alerts_update_extension_downgrade():
Strings::alerts_update_extension_upgrade()),
ext->version(),
info.version)) != 1)
return;

// Uninstall old version
Expand Down Expand Up @@ -917,10 +914,9 @@ class OptionsWindow : public app::gen::Options {
return;

if (ui::Alert::show(
"Warning"
"<<Do you really want to uninstall '%s' extension?"
"||&Yes||&No",
item->text().c_str()) != 1)
fmt::format(
Strings::alerts_uninstall_extension_warning(),
item->text())) != 1)
return;

try {
Expand Down

0 comments on commit a9b1837

Please sign in to comment.