Ticket #7149: wonderbrushtranslator-localization.patch

File wonderbrushtranslator-localization.patch, 6.1 KB (added by Karvjorm, 10 years ago)

A WonderBrushTranslator localization patch.

  • src/add-ons/translators/wonderbrush/Jamfile

     
    2121    blending.cpp
    2222    lab_convert.cpp
    2323
    24     : be translation z libtranslatorsutils.a $(TARGET_LIBSUPC++)
     24    : be translation z libtranslatorsutils.a $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
    2525    $(HAIKU_LOCALE_LIBS)
    2626    : true
    2727;
    2828
     29DoCatalogs WonderBrushTranslator :
     30    x-vnd.Haiku-WonderBrushTranslator
     31    :
     32    Layer.cpp
     33    WonderBrushMain.cpp
     34    WonderBrushTranslator.cpp
     35    WonderBrushView.cpp
     36;
     37
    2938Package haiku-translationkit-cvs :
    3039    WonderBrushTranslator :
    3140    boot home config add-ons Translators ;
  • src/add-ons/translators/wonderbrush/WonderBrushMain.cpp

     
    77 */
    88
    99#include <Application.h>
     10#include <Catalog.h>
    1011
    1112#include "WonderBrushTranslator.h"
    1213#include "TranslatorWindow.h"
    1314
     15#undef B_TRANSLATE_CONTEXT
     16#define B_TRANSLATE_CONTEXT "WonderBrushMain"
     17
    1418int
    1519main()
    1620{
    1721    BApplication app("application/x-vnd.Haiku-WonderBrushTranslator");
    1822    status_t result;
    1923    result = LaunchTranslatorWindow(new WonderBrushTranslator,
    20         "WBI Settings", BRect(0, 0, 225, 175));
     24        B_TRANSLATE("WBI Settings"), BRect(0, 0, 225, 175));
    2125    if (result == B_OK) {
    2226        app.Run();
    2327        return 0;
  • src/add-ons/translators/wonderbrush/Layer.cpp

     
    1111
    1212#include <stdio.h>
    1313
     14#include <Catalog.h>
    1415#include <Bitmap.h>
    1516#include <Message.h>
    1617
     
    1920#include "lab_convert.h"
    2021#include "support.h"
    2122
     23#undef B_TRANSLATE_CONTEXT
     24#define B_TRANSLATE_CONTEXT "Layer"
    2225
    2326// constructor
    2427Layer::Layer()
     
    422425    delete fBitmap;
    423426    fBitmap = NULL;
    424427
    425     status_t status = extract_bitmap(&fBitmap, archive, "current bitmap");
     428    status_t status = extract_bitmap(&fBitmap, archive,
     429        B_TRANSLATE("current bitmap"));
    426430    if (status < B_OK)
    427431        return status;
    428432
  • src/add-ons/translators/wonderbrush/WonderBrushTranslator.cpp

     
    1212#include <stdio.h>
    1313#include <string.h>
    1414
     15#include <Catalog.h>
    1516#include <Bitmap.h>
    1617#include <OS.h>
    1718
     
    2021#include "WonderBrushImage.h"
    2122#include "WonderBrushView.h"
    2223
     24#undef B_TRANSLATE_CONTEXT
     25#define B_TRANSLATE_CONTEXT "WonderBrushTranslator"
     26
    2327using std::nothrow;
    2428
    2529// The input formats that this translator supports.
     
    6973    { B_TRANSLATOR_EXT_DATA_ONLY, TRAN_SETTING_BOOL, false }
    7074};
    7175
    72 const uint32 kNumInputFormats = sizeof(sInputFormats) / sizeof(translation_format);
    73 const uint32 kNumOutputFormats = sizeof(sOutputFormats) / sizeof(translation_format);
    74 const uint32 kNumDefaultSettings = sizeof(sDefaultSettings) / sizeof(TranSetting);
     76const uint32 kNumInputFormats = sizeof(sInputFormats) /
     77    sizeof(translation_format);
     78const uint32 kNumOutputFormats = sizeof(sOutputFormats) /
     79    sizeof(translation_format);
     80const uint32 kNumDefaultSettings = sizeof(sDefaultSettings) /
     81    sizeof(TranSetting);
    7582
    7683
    7784BTranslator*
     
    8592
    8693
    8794WonderBrushTranslator::WonderBrushTranslator()
    88     : BaseTranslator("WonderBrush images", "WonderBrush image translator",
     95    : BaseTranslator(B_TRANSLATE("WonderBrush images"),
     96        B_TRANSLATE("WonderBrush image translator"),
    8997        WBI_TRANSLATOR_VERSION,
    9098        sInputFormats, kNumInputFormats,
    9199        sOutputFormats, kNumOutputFormats,
     
    124132            outInfo->quality = WBI_IN_QUALITY;
    125133            outInfo->capability = WBI_IN_CAPABILITY;
    126134            strcpy(outInfo->MIME, "image/x-wonderbrush");
    127             strcpy(outInfo->name, "WonderBrush image");
     135            strcpy(outInfo->name, B_TRANSLATE("WonderBrush image"));
    128136        }
    129137    } else {
    130138        delete wbImage;
     
    170178BView*
    171179WonderBrushTranslator::NewConfigView(TranslatorSettings* settings)
    172180{
    173     return new WonderBrushView(BRect(0, 0, 225, 175), "WBI Settings",
    174         B_FOLLOW_ALL, B_WILL_DRAW, settings);
     181    return new WonderBrushView(BRect(0, 0, 225, 175),
     182        B_TRANSLATE("WBI Settings"), B_FOLLOW_ALL, B_WILL_DRAW, settings);
    175183}
    176184
    177185
  • src/add-ons/translators/wonderbrush/WonderBrushView.cpp

     
    1111#include <stdio.h>
    1212#include <string.h>
    1313
     14#include <Catalog.h>
    1415#include <MenuBar.h>
    1516#include <MenuField.h>
    1617#include <MenuItem.h>
     
    2021#include "WonderBrushImage.h"
    2122#include "WonderBrushTranslator.h"
    2223
     24#undef B_TRANSLATE_CONTEXT
     25#define B_TRANSLATE_CONTEXT "WonderBrushView"
     26
    2327const char* kAuthor = "Stephan Aßmus, <superstippi@gmx.de>";
    2428const char* kWBICopyright = "Copyright "B_UTF8_COPYRIGHT" 2006 Haiku Inc.";
    2529
     
    129133
    130134    BPoint offset(xbold, ybold);
    131135
    132     const char* text = "WonderBrush image translator";
     136    const char* text = B_TRANSLATE("WonderBrush image translator");
    133137    DrawString(text, offset);
    134138
    135139    SetFont(be_plain_font);
     
    140144    offset.y += yplain;
    141145
    142146    char detail[100];
    143     sprintf(detail, "Version %d.%d.%d %s",
     147    sprintf(detail, B_TRANSLATE("Version %d.%d.%d %s"),
    144148        static_cast<int>(B_TRANSLATION_MAJOR_VERSION(WBI_TRANSLATOR_VERSION)),
    145149        static_cast<int>(B_TRANSLATION_MINOR_VERSION(WBI_TRANSLATOR_VERSION)),
    146         static_cast<int>(B_TRANSLATION_REVISION_VERSION(WBI_TRANSLATOR_VERSION)),
    147         __DATE__);
     150        static_cast<int>(B_TRANSLATION_REVISION_VERSION(
     151            WBI_TRANSLATOR_VERSION)), __DATE__);
    148152    DrawString(detail, offset);
    149153
    150154    offset.y += 2 * ybold;
    151155
    152     text = "written by:";
     156    text = B_TRANSLATE("written by:");
    153157    DrawString(text, offset);
    154158    offset.y += ybold;
    155159