Ticket #7118: bmp-translator-localization-update.patch

File bmp-translator-localization-update.patch, 6.2 KB (added by Karvjorm, 14 years ago)

A BMPTranslator localization patch

  • src/add-ons/translators/bmp/BMPMain.cpp

     
    3232/*****************************************************************************/
    3333
    3434#include <Application.h>
     35#include <Catalog.h>
     36
    3537#include "BMPTranslator.h"
    3638#include "TranslatorWindow.h"
    3739
     40#undef B_TRANSLATE_CONTEXT
     41#define B_TRANSLATE_CONTEXT "BMPMain"
     42
     43
    3844// ---------------------------------------------------------------
    3945// main
    4046//
     
    5359{
    5460    BApplication app("application/x-vnd.Haiku-BMPTranslator");
    5561    status_t result;
     62
    5663    result = LaunchTranslatorWindow(new BMPTranslator,
    57         "BMP Settings", BRect(0, 0, 225, 175));
     64        B_TRANSLATE("BMP Settings"), BRect(0, 0, 225, 175));
    5865    if (result == B_OK) {
    5966        app.Run();
    6067        return 0;
  • src/add-ons/translators/bmp/Jamfile

     
    1414    : true
    1515;
    1616
     17DoCatalogs BMPTranslator :
     18    x-vnd.Haiku-BMPTranslator
     19    :
     20    BMPMain.cpp
     21    BMPTranslator.cpp
     22    BMPView.cpp
     23;
     24
    1725Package haiku-translationkit-cvs :
    1826    BMPTranslator :
    1927    boot home config add-ons Translators ;
    2028
    21 
  • src/add-ons/translators/bmp/BMPTranslator.cpp

     
    1010#include "BMPView.h"
    1111
    1212#include <algorithm>
     13#include <Catalog.h>
    1314#include <new>
    1415#include <stdio.h>
    1516#include <stdlib.h>
     
    2425//#define ERROR(x) printf(x);
    2526#define ERROR(x)
    2627
     28#undef B_TRANSLATE_CONTEXT
     29#define B_TRANSLATE_CONTEXT "BMPTranslator"
     30
     31
    2732// The input formats that this translator supports.
    2833translation_format gInputFormats[] = {
    2934    {
     
    116121// Returns:
    117122// ---------------------------------------------------------------
    118123BMPTranslator::BMPTranslator()
    119     : BaseTranslator("BMP images", "BMP image translator",
     124    : BaseTranslator(B_TRANSLATE("BMP images"),
     125        B_TRANSLATE("BMP image translator"),
    120126        BMP_TRANSLATOR_VERSION,
    121127        gInputFormats, sizeof(gInputFormats) / sizeof(translation_format),
    122128        gOutputFormats, sizeof(gOutputFormats) / sizeof(translation_format),
    123         "BMPTranslator_Settings",
     129        B_TRANSLATE("BMPTranslator_Settings"),
    124130        gDefaultSettings, sizeof(gDefaultSettings) / sizeof(TranSetting),
    125131        B_TRANSLATOR_BITMAP, B_BMP_FORMAT)
    126132{
     
    357363            outInfo->group = B_TRANSLATOR_BITMAP;
    358364            outInfo->quality = BMP_IN_QUALITY;
    359365            outInfo->capability = BMP_IN_CAPABILITY;
    360             sprintf(outInfo->name, "BMP image (MS format, %d bits",
     366            sprintf(outInfo->name,
     367                B_TRANSLATE_COMMENT("BMP image (MS format, %d bits",
     368                "Ignore missing closing round bracket"),
    361369                msheader.bitsperpixel);
    362370            if (msheader.compression)
    363371                strcat(outInfo->name, ", RLE)");
     
    426434            outInfo->group = B_TRANSLATOR_BITMAP;
    427435            outInfo->quality = BMP_IN_QUALITY;
    428436            outInfo->capability = BMP_IN_CAPABILITY;
    429             sprintf(outInfo->name, "BMP image (OS/2 format, %d bits)",
    430                 os2header.bitsperpixel);
     437            sprintf(outInfo->name, B_TRANSLATE("BMP image (OS/2 format, "
     438                "%d bits)"), os2header.bitsperpixel);
    431439            strcpy(outInfo->MIME, "image/x-bmp");
    432440        }
    433441        if (pfileheader && pmsheader) {
     
    18841892BView *
    18851893BMPTranslator::NewConfigView(TranslatorSettings *settings)
    18861894{
    1887     return new BMPView(BRect(0, 0, 225, 175), "BMPTranslator Settings",
    1888         B_FOLLOW_ALL, B_WILL_DRAW, settings);
     1895    return new BMPView(BRect(0, 0, 225, 175),
     1896        B_TRANSLATE("BMPTranslator Settings"), B_FOLLOW_ALL, B_WILL_DRAW,
     1897        settings);
    18891898}
  • src/add-ons/translators/bmp/BMPView.cpp

     
    1313#include "BMPView.h"
    1414#include "BMPTranslator.h"
    1515
     16#include <Catalog.h>
    1617#include <StringView.h>
    1718
    1819#include <stdio.h>
    1920
     21#undef B_TRANSLATE_CONTEXT
     22#define B_TRANSLATE_CONTEXT "BMPView"
    2023
     24
    2125BMPView::BMPView(const BRect &frame, const char *name, uint32 resizeMode,
    2226        uint32 flags, TranslatorSettings *settings)
    2327    : BView(frame, name, resizeMode, flags)
     
    3034    float height = fontHeight.descent + fontHeight.ascent + fontHeight.leading;
    3135
    3236    BRect rect(10, 10, 200, 10 + height);
    33     BStringView *stringView = new BStringView(rect, "title", "BMP image translator");
     37    BStringView *stringView = new BStringView(rect, "title",
     38        B_TRANSLATE("BMP image translator"));
    3439    stringView->SetFont(be_bold_font);
    3540    stringView->ResizeToPreferred();
    3641    AddChild(stringView);
     
    3944
    4045    rect.OffsetBy(0, height + 10);
    4146    char version[256];
    42     snprintf(version, sizeof(version), "Version %d.%d.%d, %s",
     47    snprintf(version, sizeof(version), B_TRANSLATE("Version %d.%d.%d, %s"),
    4348        int(B_TRANSLATION_MAJOR_VERSION(BMP_TRANSLATOR_VERSION)),
    4449        int(B_TRANSLATION_MINOR_VERSION(BMP_TRANSLATOR_VERSION)),
    4550        int(B_TRANSLATION_REVISION_VERSION(BMP_TRANSLATOR_VERSION)),
     
    5560    height = fontHeight.descent + fontHeight.ascent + fontHeight.leading;
    5661
    5762    rect.OffsetBy(0, height + 5);
    58     stringView = new BStringView(rect, "Copyright", B_UTF8_COPYRIGHT "2002-2006 Haiku Inc.");
     63    stringView = new BStringView(rect, "Copyright", B_UTF8_COPYRIGHT "2002-2010 Haiku Inc.");
    5964    stringView->ResizeToPreferred();
    6065    AddChild(stringView);
    6166
  • src/add-ons/translators/bmp/BMPTranslator.h

     
    2929#ifndef BMP_TRANSLATOR_H
    3030#define BMP_TRANSLATOR_H
    3131
     32#include <ByteOrder.h>
     33#include <Catalog.h>
     34#include <DataIO.h>
     35#include <GraphicsDefs.h>
     36#include <InterfaceDefs.h>
     37#include <Locale.h>
    3238#include <Translator.h>
    3339#include <TranslatorFormats.h>
    3440#include <TranslationDefs.h>
    35 #include <GraphicsDefs.h>
    36 #include <InterfaceDefs.h>
    37 #include <DataIO.h>
    38 #include <ByteOrder.h>
     41
    3942#include "BaseTranslator.h"
    4043
    4144#define BMP_NO_COMPRESS 0