From ca42f31ccc2fb3a9c74fec2aeecda97ab006926e Mon Sep 17 00:00:00 2001 From: twanvl Date: Tue, 12 Dec 2006 16:09:05 +0000 Subject: [PATCH] Localisation, using Locale class git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@113 0fc631ac-6414-0410-93d0-97cfa31319b6 --- data/en.mse-locale/locale | 119 ++++++++++++++++++++++++++++++++ src/data/action/value.cpp | 2 +- src/data/locale.cpp | 49 +++++++++++++ src/data/locale.hpp | 51 ++++++++++++++ src/data/set.cpp | 6 +- src/data/settings.cpp | 2 + src/data/settings.hpp | 4 ++ src/gfx/blend_image.cpp | 4 +- src/gui/control/text_ctrl.cpp | 108 +++++++++++++++++++++++++++++ src/gui/control/text_ctrl.hpp | 60 ++++++++++++++++ src/gui/set/cards_panel.cpp | 16 ++--- src/gui/set/window.cpp | 2 +- src/gui/util.cpp | 6 +- src/main.cpp | 2 + src/mse.vcproj | 45 ++++++++++++ src/render/symbol/filter.cpp | 2 +- src/script/value.hpp | 6 +- src/util/error.hpp | 7 +- src/util/io/package.cpp | 12 ++-- src/util/io/package_manager.cpp | 3 +- src/util/io/reader.cpp | 7 +- src/util/io/reader.hpp | 2 +- src/util/locale.hpp | 64 +++++++++++++++++ src/util/prec.hpp | 1 + 24 files changed, 540 insertions(+), 40 deletions(-) create mode 100644 data/en.mse-locale/locale create mode 100644 src/data/locale.cpp create mode 100644 src/data/locale.hpp create mode 100644 src/gui/control/text_ctrl.cpp create mode 100644 src/gui/control/text_ctrl.hpp create mode 100644 src/util/locale.hpp diff --git a/data/en.mse-locale/locale b/data/en.mse-locale/locale new file mode 100644 index 00000000..c1fe269a --- /dev/null +++ b/data/en.mse-locale/locale @@ -0,0 +1,119 @@ +full name: English + +############################################################## Menu items +menu + file: &File + new: &New... Ctrl+N + open: &Open... Ctrl+O + save: &Save Ctrl+S + save as: Save &As... F12 + export: &Export + exit: &Exit Alt+F4 + + edit: &Edit + undo: &Undo Ctrl+Z + redo: &Redo Ctrl+Y + cut: Cu&t Ctrl+X + copy: &Copy Ctrl+C + paste: &Paste Ctrl+V + + cards: &Cards + rotate 270: Rotated 90° &Clockwise + + format: &Format + bold: &Bold Ctrl+B + italic: &Italic Ctrl+I + symbols: &Symbols Ctrl+M + reminder text: &Reminder Text Ctrl+R + + window: &Window + new window: &New Window + cards tab: &Cards + + help: &Help + +############################################################## Menu help texts +help: + new: Create a new set + bold: Makes the selected text bold + italic: Makes the selected text italic + +############################################################## Tooltips +tool: + remove card: Remove selected card + rotated card: Rotate card + +############################################################## Labels in the GUI +label: + card notes: Card notes: + +############################################################## Buttons in the GUI +button: + use for all cards: Use for &all cards + +############################################################## Action (undo/redo) names +action: + typing: Typing + backspace: Backspace + delete: Delete + change: Change %s + +############################################################## Error messages +error: + # General + internal error: + An internal error occured: + + %s + + Please save your work (use 'save as' to so you don't overwrite things) + and restart Magic Set Editor. + + You should leave a bug report on http://magicseteditor.sourceforge.net/ + + # File related + file not found: File not found: '%s' in package '%s' + file parse error: + Error while parsing file: '%s' + %s + package not found: Package not found: '%s' + unable to open output file: Error while saving, unable to open output file + unable to store file: Error while saving, unable to store file + + # Script stuff + collection has no member: Collection has no member '%s' + object has no member: Object has no member '%s' + + # Image stuff + coordinates for blending overlap: Coordinates for blending overlap + images used for blending must have the same size: Images used for blending must have the same size + + # Error from files + no game specified for the set: No game specified for the set + no stylesheet specified for the set: No stylesheet specified for the set + stylesheet and set refer to different game: + stylesheet and set don't refer to the same game, this is an error in the stylesheet file + unsupported fill type: Unsupported fill type: '%s' + unrecognized value: Unrecognized value: '%s' + newer version: + %s + This file is made with a newer version of Magic Set Editor (%s) + When you open it, some aspects of the file may be lost. + It is recommended that you upgrade to the latest version. + Visit http:://magicseteditor.sourceforge.net/ + +############################################################## Types used in scripts +type: + real: Real number + integer: Integer number + string: String + +############################################################## Magic +game: + magic: + name: Name + cc: CC + type: Type + p/t: P/T + rarity: Rarity + card name: Card Name diff --git a/src/data/action/value.cpp b/src/data/action/value.cpp index 175fea79..353cd524 100644 --- a/src/data/action/value.cpp +++ b/src/data/action/value.cpp @@ -19,7 +19,7 @@ // ----------------------------------------------------------------------------- : ValueAction String ValueAction::getName(bool to_undo) const { - return _("Change ") + valueP->fieldP->name; + return String::Format(_ACTION_("change"), valueP->fieldP->name); } // ----------------------------------------------------------------------------- : Simple diff --git a/src/data/locale.cpp b/src/data/locale.cpp new file mode 100644 index 00000000..acd065aa --- /dev/null +++ b/src/data/locale.cpp @@ -0,0 +1,49 @@ +//+----------------------------------------------------------------------------+ +//| Description: Magic Set Editor - Program to make Magic (tm) cards | +//| Copyright: (C) 2001 - 2006 Twan van Laarhoven | +//| License: GNU General Public License 2 or later (see file COPYING) | +//+----------------------------------------------------------------------------+ + +// ----------------------------------------------------------------------------- : Includes + +#include +#include +#include