Ticket #7118: bmp-translator-localization-update.patch
File bmp-translator-localization-update.patch, 6.2 KB (added by , 14 years ago) |
---|
-
src/add-ons/translators/bmp/BMPMain.cpp
32 32 /*****************************************************************************/ 33 33 34 34 #include <Application.h> 35 #include <Catalog.h> 36 35 37 #include "BMPTranslator.h" 36 38 #include "TranslatorWindow.h" 37 39 40 #undef B_TRANSLATE_CONTEXT 41 #define B_TRANSLATE_CONTEXT "BMPMain" 42 43 38 44 // --------------------------------------------------------------- 39 45 // main 40 46 // … … 53 59 { 54 60 BApplication app("application/x-vnd.Haiku-BMPTranslator"); 55 61 status_t result; 62 56 63 result = LaunchTranslatorWindow(new BMPTranslator, 57 "BMP Settings", BRect(0, 0, 225, 175));64 B_TRANSLATE("BMP Settings"), BRect(0, 0, 225, 175)); 58 65 if (result == B_OK) { 59 66 app.Run(); 60 67 return 0; -
src/add-ons/translators/bmp/Jamfile
14 14 : true 15 15 ; 16 16 17 DoCatalogs BMPTranslator : 18 x-vnd.Haiku-BMPTranslator 19 : 20 BMPMain.cpp 21 BMPTranslator.cpp 22 BMPView.cpp 23 ; 24 17 25 Package haiku-translationkit-cvs : 18 26 BMPTranslator : 19 27 boot home config add-ons Translators ; 20 28 21 -
src/add-ons/translators/bmp/BMPTranslator.cpp
10 10 #include "BMPView.h" 11 11 12 12 #include <algorithm> 13 #include <Catalog.h> 13 14 #include <new> 14 15 #include <stdio.h> 15 16 #include <stdlib.h> … … 24 25 //#define ERROR(x) printf(x); 25 26 #define ERROR(x) 26 27 28 #undef B_TRANSLATE_CONTEXT 29 #define B_TRANSLATE_CONTEXT "BMPTranslator" 30 31 27 32 // The input formats that this translator supports. 28 33 translation_format gInputFormats[] = { 29 34 { … … 116 121 // Returns: 117 122 // --------------------------------------------------------------- 118 123 BMPTranslator::BMPTranslator() 119 : BaseTranslator("BMP images", "BMP image translator", 124 : BaseTranslator(B_TRANSLATE("BMP images"), 125 B_TRANSLATE("BMP image translator"), 120 126 BMP_TRANSLATOR_VERSION, 121 127 gInputFormats, sizeof(gInputFormats) / sizeof(translation_format), 122 128 gOutputFormats, sizeof(gOutputFormats) / sizeof(translation_format), 123 "BMPTranslator_Settings",129 B_TRANSLATE("BMPTranslator_Settings"), 124 130 gDefaultSettings, sizeof(gDefaultSettings) / sizeof(TranSetting), 125 131 B_TRANSLATOR_BITMAP, B_BMP_FORMAT) 126 132 { … … 357 363 outInfo->group = B_TRANSLATOR_BITMAP; 358 364 outInfo->quality = BMP_IN_QUALITY; 359 365 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"), 361 369 msheader.bitsperpixel); 362 370 if (msheader.compression) 363 371 strcat(outInfo->name, ", RLE)"); … … 426 434 outInfo->group = B_TRANSLATOR_BITMAP; 427 435 outInfo->quality = BMP_IN_QUALITY; 428 436 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); 431 439 strcpy(outInfo->MIME, "image/x-bmp"); 432 440 } 433 441 if (pfileheader && pmsheader) { … … 1884 1892 BView * 1885 1893 BMPTranslator::NewConfigView(TranslatorSettings *settings) 1886 1894 { 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); 1889 1898 } -
src/add-ons/translators/bmp/BMPView.cpp
13 13 #include "BMPView.h" 14 14 #include "BMPTranslator.h" 15 15 16 #include <Catalog.h> 16 17 #include <StringView.h> 17 18 18 19 #include <stdio.h> 19 20 21 #undef B_TRANSLATE_CONTEXT 22 #define B_TRANSLATE_CONTEXT "BMPView" 20 23 24 21 25 BMPView::BMPView(const BRect &frame, const char *name, uint32 resizeMode, 22 26 uint32 flags, TranslatorSettings *settings) 23 27 : BView(frame, name, resizeMode, flags) … … 30 34 float height = fontHeight.descent + fontHeight.ascent + fontHeight.leading; 31 35 32 36 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")); 34 39 stringView->SetFont(be_bold_font); 35 40 stringView->ResizeToPreferred(); 36 41 AddChild(stringView); … … 39 44 40 45 rect.OffsetBy(0, height + 10); 41 46 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"), 43 48 int(B_TRANSLATION_MAJOR_VERSION(BMP_TRANSLATOR_VERSION)), 44 49 int(B_TRANSLATION_MINOR_VERSION(BMP_TRANSLATOR_VERSION)), 45 50 int(B_TRANSLATION_REVISION_VERSION(BMP_TRANSLATOR_VERSION)), … … 55 60 height = fontHeight.descent + fontHeight.ascent + fontHeight.leading; 56 61 57 62 rect.OffsetBy(0, height + 5); 58 stringView = new BStringView(rect, "Copyright", B_UTF8_COPYRIGHT "2002-20 06Haiku Inc.");63 stringView = new BStringView(rect, "Copyright", B_UTF8_COPYRIGHT "2002-2010 Haiku Inc."); 59 64 stringView->ResizeToPreferred(); 60 65 AddChild(stringView); 61 66 -
src/add-ons/translators/bmp/BMPTranslator.h
29 29 #ifndef BMP_TRANSLATOR_H 30 30 #define BMP_TRANSLATOR_H 31 31 32 #include <ByteOrder.h> 33 #include <Catalog.h> 34 #include <DataIO.h> 35 #include <GraphicsDefs.h> 36 #include <InterfaceDefs.h> 37 #include <Locale.h> 32 38 #include <Translator.h> 33 39 #include <TranslatorFormats.h> 34 40 #include <TranslationDefs.h> 35 #include <GraphicsDefs.h> 36 #include <InterfaceDefs.h> 37 #include <DataIO.h> 38 #include <ByteOrder.h> 41 39 42 #include "BaseTranslator.h" 40 43 41 44 #define BMP_NO_COMPRESS 0