Ticket #7145: tgatranslator-localization.patch
File tgatranslator-localization.patch, 6.5 KB (added by , 14 years ago) |
---|
-
src/add-ons/translators/tga/TGAMain.cpp
28 28 /*****************************************************************************/ 29 29 30 30 #include <Application.h> 31 #include <Catalog.h> 31 32 #include "TGATranslator.h" 32 33 #include "TranslatorWindow.h" 33 34 35 #undef B_TRANSLATE_CONTEXT 36 #define B_TRANSLATE_CONTEXT "TGAMain" 37 34 38 // --------------------------------------------------------------- 35 39 // main 36 40 // … … 49 53 { 50 54 BApplication app("application/x-vnd.Haiku-TGATranslator"); 51 55 status_t result; 52 result = LaunchTranslatorWindow(new TGATranslator, "TGA Settings"); 56 result = LaunchTranslatorWindow(new TGATranslator, 57 B_TRANSLATE("TGA Settings")); 53 58 if (result == B_OK) { 54 59 app.Run(); 55 60 return 0; -
src/add-ons/translators/tga/TGATranslator.cpp
28 28 // DEALINGS IN THE SOFTWARE. 29 29 /*****************************************************************************/ 30 30 31 #include <Catalog.h> 31 32 #include <string.h> 32 33 #include <stdio.h> 33 34 #include "TGATranslator.h" 34 35 #include "TGAView.h" 35 36 #include "StreamBuffer.h" 36 37 38 #undef B_TRANSLATE_CONTEXT 39 #define B_TRANSLATE_CONTEXT "TGATranslator" 40 37 41 // The input formats that this translator supports. 38 42 static const translation_format sInputFormats[] = { 39 43 { … … 136 140 // Returns: 137 141 // --------------------------------------------------------------- 138 142 TGATranslator::TGATranslator() 139 : BaseTranslator("TGA images", "TGA image translator", 143 : BaseTranslator(B_TRANSLATE("TGA images"), 144 B_TRANSLATE("TGA image translator"), 140 145 TGA_TRANSLATOR_VERSION, 141 146 sInputFormats, kNumInputFormats, 142 147 sOutputFormats, kNumOutputFormats, … … 385 390 outInfo->group = B_TRANSLATOR_BITMAP; 386 391 outInfo->quality = TGA_IN_QUALITY; 387 392 outInfo->capability = TGA_IN_CAPABILITY; 388 sprintf(outInfo->name, "Targa image (%d bits",389 imagespec.depth);390 393 switch (fileheader.imagetype) { 391 394 case TGA_NOCOMP_COLORMAP: 392 strcat(outInfo->name, " colormap"); 395 snprintf(outInfo->name, sizeof(outInfo->name), 396 B_TRANSLATE("Targa image (%d bits colormap)"), 397 imagespec.depth); 393 398 break; 394 399 case TGA_NOCOMP_TRUECOLOR: 395 strcat(outInfo->name, " truecolor"); 400 snprintf(outInfo->name, sizeof(outInfo->name), 401 B_TRANSLATE("Targa image (%d bits truecolor)"), 402 imagespec.depth); 396 403 break; 397 case TGA_NOCOMP_BW:398 strcat(outInfo->name, " gray");399 break;400 404 case TGA_RLE_COLORMAP: 401 strcat(outInfo->name, " RLE colormap"); 405 snprintf(outInfo->name, sizeof(outInfo->name), 406 B_TRANSLATE("Targa image (%d bits RLE colormap)"), 407 imagespec.depth); 402 408 break; 403 409 case TGA_RLE_TRUECOLOR: 404 strcat(outInfo->name, " RLE truecolor"); 410 snprintf(outInfo->name, sizeof(outInfo->name), 411 B_TRANSLATE("Targa image (%d bits RLE truecolor)"), 412 imagespec.depth); 405 413 break; 406 414 case TGA_RLE_BW: 407 strcat(outInfo->name, " RLE gray"); 415 snprintf(outInfo->name, sizeof(outInfo->name), 416 B_TRANSLATE("Targa image (%d bits RLE gray)"), 417 imagespec.depth); 408 418 break; 419 case TGA_NOCOMP_BW: 420 default: 421 snprintf(outInfo->name, sizeof(outInfo->name), 422 B_TRANSLATE("Targa image (%d bits gray)"), 423 imagespec.depth); 424 break; 425 409 426 } 410 strcat(outInfo->name, ")");411 427 strcpy(outInfo->MIME, "image/x-targa"); 412 428 } 413 429 … … 2196 2212 BView * 2197 2213 TGATranslator::NewConfigView(TranslatorSettings *settings) 2198 2214 { 2199 return new TGAView("TGATranslator Settings", B_WILL_DRAW, settings); 2215 return new TGAView(B_TRANSLATE("TGATranslator Settings"), 2216 B_WILL_DRAW, settings); 2200 2217 } 2201 2218 -
src/add-ons/translators/tga/Jamfile
8 8 TGAMain.cpp 9 9 TGATranslator.cpp 10 10 TGAView.cpp 11 : be translation libtranslatorsutils.a $(TARGET_LIBSUPC++) 12 $(HAIKU_LOCALE_LIBS) 11 : be translation libtranslatorsutils.a $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS) 13 12 : true 14 13 ; 15 14 15 DoCatalogs TGATranslator : 16 x-vnd.Haiku-TGATranslator 17 : 18 TGAMain.cpp 19 TGATranslator.cpp 20 TGAView.cpp 21 ; 22 16 23 Package haiku-translationkit-cvs : 17 24 TGATranslator : 18 25 boot home config add-ons Translators ; -
src/add-ons/translators/tga/TGAView.cpp
29 29 // DEALINGS IN THE SOFTWARE. 30 30 /*****************************************************************************/ 31 31 32 #include <Catalog.h> 32 33 #include <GroupLayout.h> 33 34 #include <GroupLayoutBuilder.h> 34 35 #include <SpaceLayoutItem.h> … … 36 37 #include <stdio.h> 37 38 #include <string.h> 38 39 39 40 40 #include "TGAView.h" 41 41 #include "TGATranslator.h" 42 42 43 #undef B_TRANSLATE_CONTEXT 44 #define B_TRANSLATE_CONTEXT "TGAView" 43 45 46 44 47 TGAView::TGAView(const char *name, uint32 flags, TranslatorSettings *settings) 45 48 : 46 49 BView(name, flags), … … 53 56 fTitle->SetFont(be_bold_font); 54 57 55 58 char detail[100]; 56 sprintf(detail, "Version %d.%d.%d %s",59 sprintf(detail, B_TRANSLATE("Version %d.%d.%d %s"), 57 60 static_cast<int>(B_TRANSLATION_MAJOR_VERSION(TGA_TRANSLATOR_VERSION)), 58 61 static_cast<int>(B_TRANSLATION_MINOR_VERSION(TGA_TRANSLATOR_VERSION)), 59 static_cast<int>(B_TRANSLATION_REVISION_VERSION( TGA_TRANSLATOR_VERSION)),60 __DATE__);62 static_cast<int>(B_TRANSLATION_REVISION_VERSION( 63 TGA_TRANSLATOR_VERSION)), __DATE__); 61 64 fDetail = new BStringView("detail", detail); 62 65 fWrittenBy = new BStringView("writtenby", 63 "Written by the Haiku Translation Kit Team");66 B_TRANSLATE("Written by the Haiku Translation Kit Team")); 64 67 65 fpchkIgnoreAlpha = new BCheckBox( "Ignore TGA alpha channel",68 fpchkIgnoreAlpha = new BCheckBox(B_TRANSLATE("Ignore TGA alpha channel"), 66 69 new BMessage(CHANGE_IGNORE_ALPHA)); 67 70 int32 val = (fSettings->SetGetBool(TGA_SETTING_IGNORE_ALPHA)) ? 1 : 0; 68 71 fpchkIgnoreAlpha->SetValue(val); 69 72 fpchkIgnoreAlpha->SetViewColor(ViewColor()); 70 73 71 fpchkRLE = new BCheckBox( "Save with RLE Compression",74 fpchkRLE = new BCheckBox(B_TRANSLATE("Save with RLE Compression"), 72 75 new BMessage(CHANGE_RLE)); 73 76 val = (fSettings->SetGetBool(TGA_SETTING_RLE)) ? 1 : 0; 74 77 fpchkRLE->SetValue(val);