Ticket #7140: sgitranslator-localization.patch
File sgitranslator-localization.patch, 6.7 KB (added by , 13 years ago) |
---|
-
src/add-ons/translators/sgi/Jamfile
9 9 SGIMain.cpp 10 10 SGITranslator.cpp 11 11 SGIView.cpp 12 13 : be translation libtranslatorsutils.a $(TARGET_LIBSUPC++) 14 $(HAIKU_LOCALE_LIBS) 12 : be translation libtranslatorsutils.a $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS) 15 13 : true 16 14 ; 17 15 16 DoCatalogs SGITranslator : 17 x-vnd.Haiku-SGITranslator 18 : 19 SGIMain.cpp 20 SGITranslator.cpp 21 SGIView.cpp 22 ; 23 18 24 Package haiku-translationkit-cvs : 19 25 SGITranslator : 20 26 boot home config add-ons Translators ; -
src/add-ons/translators/sgi/SGIMain.cpp
35 35 /*****************************************************************************/ 36 36 37 37 #include <Application.h> 38 #include <Catalog.h> 38 39 #include "SGITranslator.h" 39 40 #include "TranslatorWindow.h" 40 41 42 #undef B_TRANSLATE_CONTEXT 43 #define B_TRANSLATE_CONTEXT "SGIMain" 44 41 45 // --------------------------------------------------------------- 42 46 // main 43 47 // … … 57 61 BApplication app("application/x-vnd.Haiku-SGITranslator"); 58 62 status_t result; 59 63 result = LaunchTranslatorWindow(new SGITranslator, 60 "SGI Settings", BRect(0, 0, 225, 175));64 B_TRANSLATE("SGI Settings"), BRect(0, 0, 225, 175)); 61 65 if (result == B_OK) { 62 66 app.Run(); 63 67 return 0; -
src/add-ons/translators/sgi/SGITranslator.cpp
44 44 #include <stdio.h> 45 45 #include <string.h> 46 46 47 #include <Catalog.h> 47 48 #include <OS.h> 48 49 49 50 #include "SGIImage.h" … … 52 53 53 54 using std::nothrow; 54 55 56 #undef B_TRANSLATE_CONTEXT 57 #define B_TRANSLATE_CONTEXT "SGITranslator" 58 59 55 60 // The input formats that this translator supports. 56 61 static const translation_format sInputFormats[] = { 57 62 { … … 152 157 // --------------------------------------------------------------- 153 158 SGITranslator::SGITranslator() 154 159 : 155 BaseTranslator("SGI images", "SGI image translator", 160 BaseTranslator(B_TRANSLATE("SGI images"), 161 B_TRANSLATE("SGI image translator"), 156 162 SGI_TRANSLATOR_VERSION, 157 163 sInputFormats, kNumInputFormats, 158 164 sOutputFormats, kNumOutputFormats, … … 196 202 outInfo->quality = SGI_IN_QUALITY; 197 203 outInfo->capability = SGI_IN_CAPABILITY; 198 204 strcpy(outInfo->MIME, "image/sgi"); 199 strcpy(outInfo->name, "SGI image");205 strcpy(outInfo->name, B_TRANSLATE("SGI image")); 200 206 } 201 207 } else { 202 208 delete sgiImage; … … 412 418 for (uint32 z = 0; z < channelCount; z++) { 413 419 ret = sgiImage->WriteRow(rows[z], y, z); 414 420 if (ret < B_OK) { 415 printf("WriteRow() returned %s!\n", strerror(ret)); 421 printf(B_TRANSLATE("WriteRow() returned %s!\n"), 422 strerror(ret)); 416 423 break; 417 424 } 418 425 } … … 498 505 sizeof(TranslatorBitmap), B_SWAP_HOST_TO_BENDIAN)) < B_OK) { 499 506 return ret; 500 507 } else 501 ret = outDestination->Write(&bitsHeader, sizeof(TranslatorBitmap)); 508 ret = outDestination->Write(&bitsHeader, 509 sizeof(TranslatorBitmap)); 502 510 } 503 if (ret < B_OK) 504 printf("error writing bits header: %s\n", strerror(ret)); 511 if (ret < B_OK) 512 printf(B_TRANSLATE("error writing bits header: %s\n"), 513 strerror(ret)); 505 514 if (ret >= B_OK && !bheaderonly) { 506 515 // read one row at a time, 507 516 // convert to the correct format … … 738 747 BView * 739 748 SGITranslator::NewConfigView(TranslatorSettings *settings) 740 749 { 741 return new SGIView("SGITranslator Settings", B_WILL_DRAW, settings); 750 return new SGIView(B_TRANSLATE("SGITranslator Settings"), B_WILL_DRAW, 751 settings); 742 752 } -
src/add-ons/translators/sgi/SGIView.cpp
33 33 #include <stdio.h> 34 34 #include <string.h> 35 35 36 #include <Catalog.h> 36 37 #include <GroupLayoutBuilder.h> 37 38 #include <MenuBar.h> 38 39 #include <MenuField.h> … … 49 50 50 51 const char* author = "Stephan Aßmus, <stippi@yellowbites.com>"; 51 52 53 #undef B_TRANSLATE_CONTEXT 54 #define B_TRANSLATE_CONTEXT "SGIView" 55 52 56 // add_menu_item 53 57 void 54 58 add_menu_item(BMenu* menu, … … 83 87 { 84 88 BPopUpMenu* menu = new BPopUpMenu("pick compression"); 85 89 86 uint32 currentCompression = fSettings->SetGetInt32(SGI_SETTING_COMPRESSION); 90 uint32 currentCompression = 91 fSettings->SetGetInt32(SGI_SETTING_COMPRESSION); 87 92 // create the menu items with the various compression methods 88 add_menu_item(menu, SGI_COMP_NONE, "None", currentCompression); 93 add_menu_item(menu, SGI_COMP_NONE, B_TRANSLATE("None"), 94 currentCompression); 89 95 // menu->AddSeparatorItem(); 90 add_menu_item(menu, SGI_COMP_RLE, "RLE", currentCompression);96 add_menu_item(menu, SGI_COMP_RLE, B_TRANSLATE("RLE"), currentCompression); 91 97 92 98 // DON'T turn this on, it's so slow that I didn't wait long enough 93 99 // the one time I tested this. So I don't know if the code even works. … … 97 103 98 104 // add_menu_item(menu, SGI_COMP_ARLE, "Agressive RLE", currentCompression); 99 105 100 fCompressionMF = new BMenuField("compression", "Use compression:", menu); 106 fCompressionMF = new BMenuField("compression", 107 B_TRANSLATE("Use compression:"), menu); 101 108 102 109 BAlignment labelAlignment(B_ALIGN_LEFT, B_ALIGN_NO_VERTICAL); 103 110 104 BStringView* titleView = new BStringView("title", "SGI image translator"); 111 BStringView* titleView = new BStringView("title", 112 B_TRANSLATE("SGI image translator")); 105 113 titleView->SetFont(be_bold_font); 106 114 titleView->SetExplicitAlignment(labelAlignment); 107 115 108 116 char detail[100]; 109 sprintf(detail, "Version %d.%d.%d %s",117 sprintf(detail, B_TRANSLATE("Version %d.%d.%d %s"), 110 118 static_cast<int>(B_TRANSLATION_MAJOR_VERSION(SGI_TRANSLATOR_VERSION)), 111 119 static_cast<int>(B_TRANSLATION_MINOR_VERSION(SGI_TRANSLATOR_VERSION)), 112 static_cast<int>(B_TRANSLATION_REVISION_VERSION( SGI_TRANSLATOR_VERSION)),113 __DATE__);120 static_cast<int>(B_TRANSLATION_REVISION_VERSION( 121 SGI_TRANSLATOR_VERSION)), __DATE__); 114 122 BStringView* detailView = new BStringView("details", detail); 115 123 detailView->SetExplicitAlignment(labelAlignment); 116 124 117 125 BTextView* infoView = new BTextView("info"); 118 infoView->SetText(BString( "written by:\n")126 infoView->SetText(BString(B_TRANSLATE("written by:\n")) 119 127 .Append(author) 120 .Append( "\n\nbased on GIMP SGI plugin v1.5:\n")128 .Append(B_TRANSLATE("\n\nbased on GIMP SGI plugin v1.5:\n")) 121 129 .Append(kSGICopyright).String()); 122 130 infoView->SetExplicitAlignment(labelAlignment); 123 131 infoView->SetWordWrap(false);