diff options
author | Ira Rice <irarice@gmail.com> | 2009-01-06 10:20:36 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-06 10:20:36 -0700 |
commit | 2a065b5ef24441b0df2c06fbcae6dcf6fd5f5251 (patch) | |
tree | d4bee5fa8cb866618995e666ce1fdf37ca174f3b /src/gui/item_amount.cpp | |
parent | a570ee66c7cf6ddff7b0c124ad4b633b4651bdb3 (diff) | |
download | mana-2a065b5ef24441b0df2c06fbcae6dcf6fd5f5251.tar.gz mana-2a065b5ef24441b0df2c06fbcae6dcf6fd5f5251.tar.bz2 mana-2a065b5ef24441b0df2c06fbcae6dcf6fd5f5251.tar.xz mana-2a065b5ef24441b0df2c06fbcae6dcf6fd5f5251.zip |
Added support for internationalization
Merged from the mainline client. Originally implemented by Guillaume
Melquiond, starting with commit 1828eee6a6d91fd385ad1e69d93044516493aa91.
Conflicts:
INSTALL
configure.ac
src/Makefile.am
src/gui/buy.cpp
src/gui/confirm_dialog.cpp
src/gui/inventorywindow.cpp
src/gui/login.cpp
src/gui/menuwindow.cpp
src/gui/minimap.cpp
src/gui/ok_dialog.cpp
src/gui/popupmenu.cpp
src/gui/register.cpp
src/gui/sell.cpp
src/gui/setup.cpp
src/gui/setup_video.cpp
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/item_amount.cpp')
-rw-r--r-- | src/gui/item_amount.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/gui/item_amount.cpp b/src/gui/item_amount.cpp index 4ce8ac6c..191c7b8b 100644 --- a/src/gui/item_amount.cpp +++ b/src/gui/item_amount.cpp @@ -28,31 +28,33 @@ #include "../item.h" #include "../localplayer.h" +#include "../utils/gettext.h" + ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item): - Window("Select amount of items to drop.", true, parent), + Window("", true, parent), mItem(item) { - // New labels + // Integer field mItemAmountTextBox = new IntTextBox(1); - - // New buttons - Button *minusButton = new Button("-", "Minus", this); - Button *plusButton = new Button("+", "Plus", this); - Button *okButton = new Button("Okay", "Drop", this); - Button *cancelButton = new Button("Cancel", "Cancel", this); - mItemAmountSlide = new Slider(1.0, mItem->getQuantity()); - mItemAmountTextBox->setRange(1, mItem->getQuantity()); - mItemAmountSlide->setDimension(gcn::Rectangle(5, 120, 180, 10)); - // Set button events Id + // Slider + mItemAmountSlide = new Slider(1.0, mItem->getQuantity()); mItemAmountSlide->setActionEventId("Slide"); + mItemAmountSlide->addActionListener(this); + + // Buttons + Button *minusButton = new Button("-", "Minus", this); + Button *plusButton = new Button("+", "Plus", this); + Button *okButton = new Button(_("Ok"), "Drop", this); + Button *cancelButton = new Button(_("Cancel"), "Cancel", this); - // Set position + // Set positions mItemAmountTextBox->setPosition(35, 10); mItemAmountTextBox->setSize(24, 16); plusButton->setPosition(60, 5); minusButton->setPosition(10, 5); + mItemAmountSlide->setDimension(gcn::Rectangle(5, 120, 180, 10)); mItemAmountSlide->setPosition(10, 35); okButton->setPosition(10, 50); cancelButton->setPosition(60, 50); @@ -65,17 +67,15 @@ ItemAmountWindow::ItemAmountWindow(int usage, Window *parent, Item *item): add(okButton); add(cancelButton); - mItemAmountSlide->addActionListener(this); - resetAmount(); switch (usage) { case AMOUNT_TRADE_ADD: - setCaption("Select amount of items to trade."); + setCaption(_("Select amount of items to trade.")); okButton->setActionEventId("AddTrade"); break; case AMOUNT_ITEM_DROP: - setCaption("Select amount of items to drop."); + setCaption(_("Select amount of items to drop.")); okButton->setActionEventId("Drop"); break; default: |