Ticket #7147: tifftranslator-localization.patch
File tifftranslator-localization.patch, 7.5 KB (added by , 13 years ago) |
---|
-
src/add-ons/translators/tiff/TIFFTranslator.cpp
13 13 14 14 #include "tiffio.h" 15 15 16 #include <Catalog.h> 16 17 #include <stdio.h> 17 18 #include <string.h> 18 19 20 #undef B_TRANSLATE_CONTEXT 21 #define B_TRANSLATE_CONTEXT "TIFFTranslator" 19 22 20 23 /*! 21 24 How this works: … … 202 205 203 206 if (documentIndex < 1 || documentIndex > documentCount) { 204 207 // document index is invalid 205 fprintf(stderr, "identify_tiff_header: invalid document index\n"); 208 fprintf(stderr, B_TRANSLATE("identify_tiff_header: invalid " 209 "document index\n")); 206 210 return B_NO_TRANSLATOR; 207 211 } 208 212 } … … 210 214 // identify the document the user specified or the first document 211 215 // if the user did not specify which document they wanted to identify 212 216 if (!TIFFSetDirectory(tif, documentIndex - 1)) { 213 fprintf(stderr, "identify_tiff_header: couldn't set directory\n"); 217 fprintf(stderr, B_TRANSLATE("identify_tiff_header: couldn't set " 218 "directory\n")); 214 219 return B_NO_TRANSLATOR; 215 220 } 216 221 … … 226 231 outInfo->quality = TIFF_IN_QUALITY; 227 232 outInfo->capability = TIFF_IN_CAPABILITY; 228 233 strcpy(outInfo->MIME, "image/tiff"); 229 sprintf(outInfo->name, "TIFF image");234 sprintf(outInfo->name, B_TRANSLATE("TIFF image")); 230 235 } 231 236 232 237 if (!poutTIFF) { … … 337 342 // convert_buffers_bgrX_rgb 338 343 inline void 339 344 convert_buffers_bgrX_rgb(uint8* inBuffer, uint8* outBuffer, 340 uint32 rows, uint32 width, uint32 bytesPerRow, uint32 samplesPerPixel) 345 uint32 rows, uint32 width, uint32 bytesPerRow, 346 uint32 samplesPerPixel) 341 347 { 342 348 for (uint32 y = 0; y < rows; y++) { 343 349 uint8* inHandle = inBuffer; … … 360 366 // convert_buffers_rgbX_rgb 361 367 inline void 362 368 convert_buffers_rgbX_rgb(uint8* inBuffer, uint8* outBuffer, 363 uint32 rows, uint32 width, uint32 bytesPerRow, uint32 samplesPerPixel) 369 uint32 rows, uint32 width, uint32 bytesPerRow, 370 uint32 samplesPerPixel) 364 371 { 365 372 for (uint32 y = 0; y < rows; y++) { 366 373 uint8* inHandle = inBuffer; … … 596 603 597 604 598 605 TIFFTranslator::TIFFTranslator() 599 : BaseTranslator("TIFF images", "TIFF image translator", 606 : BaseTranslator(B_TRANSLATE("TIFF images"), 607 B_TRANSLATE("TIFF image translator"), 600 608 TIFF_TRANSLATOR_VERSION, 601 609 sInputFormats, kNumInputFormats, 602 610 sOutputFormats, kNumOutputFormats, … … 950 958 BView * 951 959 TIFFTranslator::NewConfigView(TranslatorSettings *settings) 952 960 { 953 return new TIFFView("TIFFTranslator Settings", B_WILL_DRAW, settings); 961 return new TIFFView(B_TRANSLATE("TIFFTranslator Settings"), 962 B_WILL_DRAW, settings); 954 963 } -
src/add-ons/translators/tiff/TIFFView.cpp
33 33 #include <stdio.h> 34 34 #include <string.h> 35 35 36 #include <Catalog.h> 36 37 #include <GridLayoutBuilder.h> 37 38 #include <GroupLayout.h> 38 39 #include <GroupLayoutBuilder.h> … … 49 50 50 51 #include "TIFFView.h" 51 52 53 #undef B_TRANSLATE_CONTEXT 54 #define B_TRANSLATE_CONTEXT "TIFFView" 55 52 56 // add_menu_item 53 57 void 54 58 add_menu_item(BMenu* menu, … … 77 81 // 78 82 // Returns: 79 83 // --------------------------------------------------------------- 80 TIFFView::TIFFView(const char *name, uint32 flags, TranslatorSettings *settings) 84 TIFFView::TIFFView(const char *name, uint32 flags, 85 TranslatorSettings *settings) 81 86 : BView(name, flags) 82 87 { 83 88 fSettings = settings; … … 85 90 SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); 86 91 SetLowColor(ViewColor()); 87 92 88 fTitle = new BStringView("title", "TIFF Image Translator");93 fTitle = new BStringView("title", B_TRANSLATE("TIFF Image Translator")); 89 94 fTitle->SetFont(be_bold_font); 90 95 91 96 char detail[100]; 92 sprintf(detail, "Version %d.%d.%d %s",97 sprintf(detail, B_TRANSLATE("Version %d.%d.%d %s"), 93 98 static_cast<int>(B_TRANSLATION_MAJOR_VERSION(TIFF_TRANSLATOR_VERSION)), 94 99 static_cast<int>(B_TRANSLATION_MINOR_VERSION(TIFF_TRANSLATOR_VERSION)), 95 static_cast<int>(B_TRANSLATION_REVISION_VERSION( TIFF_TRANSLATOR_VERSION)),96 __DATE__);100 static_cast<int>(B_TRANSLATION_REVISION_VERSION( 101 TIFF_TRANSLATOR_VERSION)), __DATE__); 97 102 fDetail = new BStringView("detail", detail); 98 103 99 104 int16 i = 1; 100 fLibTIFF[0] = new BStringView(NULL, "TIFF Library:");105 fLibTIFF[0] = new BStringView(NULL, B_TRANSLATE("TIFF Library:")); 101 106 char libtiff[] = TIFFLIB_VERSION_STR; 102 107 char *tok = strtok(libtiff, "\n"); 103 108 while (i < 5 && tok) { … … 110 115 111 116 uint32 currentCompression = fSettings->SetGetInt32(TIFF_SETTING_COMPRESSION); 112 117 // create the menu items with the various compression methods 113 add_menu_item(menu, COMPRESSION_NONE, "None", currentCompression); 118 add_menu_item(menu, COMPRESSION_NONE, B_TRANSLATE("None"), 119 currentCompression); 114 120 menu->AddSeparatorItem(); 115 add_menu_item(menu, COMPRESSION_PACKBITS, "RLE (Packbits)", currentCompression); 116 add_menu_item(menu, COMPRESSION_DEFLATE, "ZIP (Deflate)", currentCompression); 117 add_menu_item(menu, COMPRESSION_LZW, "LZW", currentCompression); 121 add_menu_item(menu, COMPRESSION_PACKBITS, B_TRANSLATE("RLE (Packbits)"), 122 currentCompression); 123 add_menu_item(menu, COMPRESSION_DEFLATE, B_TRANSLATE("ZIP (Deflate)"), 124 currentCompression); 125 add_menu_item(menu, COMPRESSION_LZW, B_TRANSLATE("LZW"), 126 currentCompression); 118 127 119 128 // TODO: the disabled compression modes are not configured in libTIFF 120 129 // menu->AddSeparatorItem(); … … 122 131 // TODO ? - strip encoding is not implemented in libTIFF for this compression 123 132 // add_menu_item(menu, COMPRESSION_JP2000, "JPEG2000", currentCompression); 124 133 125 fCompressionMF = new BMenuField("Use Compression:", menu, NULL); 134 fCompressionMF = new BMenuField(B_TRANSLATE("Use Compression:"), 135 menu, NULL); 126 136 127 137 // Build the layout 128 138 SetLayout(new BGroupLayout(B_VERTICAL)); -
src/add-ons/translators/tiff/Jamfile
14 14 TIFFTranslator.cpp 15 15 TIFFView.cpp 16 16 17 : be libtiff.so translation libtranslatorsutils.a $(TARGET_LIBSUPC++) 18 $(HAIKU_LOCALE_LIBS) 17 : be libtiff.so translation libtranslatorsutils.a $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS) 19 18 : true 20 19 ; 21 20 21 DoCatalogs TIFFTranslator : 22 x-vnd.Haiku-TIFFTranslator 23 : 24 TIFFMain.cpp 25 TIFFTranslator.cpp 26 TIFFView.cpp 27 ; 28 22 29 Package haiku-translationkit-cvs : 23 30 TIFFTranslator : 24 31 boot home config add-ons Translators ; -
src/add-ons/translators/tiff/TIFFMain.cpp
33 33 /*****************************************************************************/ 34 34 35 35 #include <Application.h> 36 #include <Catalog.h> 36 37 #include "TIFFTranslator.h" 37 38 #include "TranslatorWindow.h" 38 39 40 #undef B_TRANSLATE_CONTEXT 41 #define B_TRANSLATE_CONTEXT "TIFFMain" 42 39 43 // --------------------------------------------------------------- 40 44 // main 41 45 // … … 54 58 { 55 59 BApplication app("application/x-vnd.Haiku-TIFFTranslator"); 56 60 status_t result; 57 result = LaunchTranslatorWindow(new TIFFTranslator, "TIFF Settings"); 61 result = LaunchTranslatorWindow(new TIFFTranslator, 62 B_TRANSLATE("TIFF Settings")); 58 63 if (result == B_OK) { 59 64 app.Run(); 60 65 return 0;