Ticket #7139: rtftranslator-localization.patch
File rtftranslator-localization.patch, 6.3 KB (added by , 13 years ago) |
---|
-
src/add-ons/translators/rtf/ConfigView.cpp
7 7 #include "ConfigView.h" 8 8 #include "RTFTranslator.h" 9 9 10 #include <Catalog.h> 10 11 #include <StringView.h> 11 12 12 13 #include <stdio.h> 13 14 15 #undef B_TRANSLATE_CONTEXT 16 #define B_TRANSLATE_CONTEXT "ConfigView" 14 17 18 15 19 ConfigView::ConfigView(const BRect &frame, uint32 resize, uint32 flags) 16 : BView(frame, "RTF-Translator Settings", resize, flags)20 : BView(frame, B_TRANSLATE("RTF-Translator Settings"), resize, flags) 17 21 { 18 22 SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); 19 23 … … 22 26 float height = fontHeight.descent + fontHeight.ascent + fontHeight.leading; 23 27 24 28 BRect rect(10, 10, 200, 10 + height); 25 BStringView *stringView = new BStringView(rect, "title", "Rich Text Format (RTF) files"); 29 BStringView *stringView = new BStringView(rect, "title", 30 B_TRANSLATE("Rich Text Format (RTF) files")); 26 31 stringView->SetFont(be_bold_font); 27 32 stringView->ResizeToPreferred(); 28 33 AddChild(stringView); … … 31 36 32 37 rect.OffsetBy(0, height + 10); 33 38 char version[256]; 34 snprintf(version, sizeof(version), "Version %d.%d.%d, %s",35 int(B_TRANSLATION_MAJOR_VERSION(RTF_TRANSLATOR_VERSION)),36 int(B_TRANSLATION_MINOR_VERSION(RTF_TRANSLATOR_VERSION)),37 int(B_TRANSLATION_REVISION_VERSION(RTF_TRANSLATOR_VERSION)),38 __DATE__);39 snprintf(version, sizeof(version), B_TRANSLATE("Version %d.%d.%d, %s"), 40 static_cast<int>(B_TRANSLATION_MAJOR_VERSION(RTF_TRANSLATOR_VERSION)), 41 static_cast<int>(B_TRANSLATION_MINOR_VERSION(RTF_TRANSLATOR_VERSION)), 42 static_cast<int>(B_TRANSLATION_REVISION_VERSION( 43 RTF_TRANSLATOR_VERSION)), __DATE__); 39 44 stringView = new BStringView(rect, "version", version); 40 45 stringView->ResizeToPreferred(); 41 46 AddChild(stringView); … … 47 52 height = fontHeight.descent + fontHeight.ascent + fontHeight.leading; 48 53 49 54 rect.OffsetBy(0, height + 5); 50 stringView = new BStringView(rect, "Copyright", B_UTF8_COPYRIGHT "2004-2006 Haiku Inc."); 55 stringView = new BStringView(rect, 56 "Copyright", B_UTF8_COPYRIGHT "2004-2006 Haiku Inc."); 51 57 stringView->ResizeToPreferred(); 52 58 AddChild(stringView); 53 59 -
src/add-ons/translators/rtf/main.cpp
8 8 #include <string.h> 9 9 10 10 #include <Application.h> 11 #include <Catalog.h> 11 12 #include <FileIO.h> 12 13 #include <TranslatorRoster.h> 13 14 … … 17 18 #include "RTF.h" 18 19 #include "RTFTranslator.h" 19 20 21 #undef B_TRANSLATE_CONTEXT 22 #define B_TRANSLATE_CONTEXT "main" 20 23 24 21 25 int 22 26 main(int argc, char** argv) 23 27 { … … 30 34 BFile input; 31 35 status_t status = input.SetTo(argv[i], B_READ_ONLY); 32 36 if (status != B_OK) { 33 fprintf(stderr, "Could not open file \"%s\": %s\n", argv[i], 37 fprintf(stderr, 38 B_TRANSLATE("Could not open file \"%s\": %s\n"), argv[i], 34 39 strerror(status)); 35 40 result = 1; 36 41 continue; … … 41 46 42 47 status = parser.Parse(header); 43 48 if (status != B_OK) { 44 fprintf(stderr, "Could not convert file \"%s\": %s\n", argv[i], 45 strerror(status)); 49 fprintf(stderr, 50 B_TRANSLATE("Could not convert file \"%s\": %s\n"), 51 argv[i], strerror(status)); 46 52 result = 1; 47 53 continue; 48 54 } … … 56 62 BApplication app("application/x-vnd.Haiku-RTFTranslator"); 57 63 58 64 status_t result; 59 result = LaunchTranslatorWindow(new RTFTranslator, "RTF Settings",60 B Rect(0, 0, 225, 175));65 result = LaunchTranslatorWindow(new RTFTranslator, 66 B_TRANSLATE("RTF Settings"), BRect(0, 0, 225, 175)); 61 67 if (result != B_OK) 62 68 return 1; 63 69 -
src/add-ons/translators/rtf/RTFTranslator.cpp
9 9 #include "RTF.h" 10 10 #include "convert.h" 11 11 12 #include <Catalog.h> 12 13 #include <stdlib.h> 13 14 #include <stdio.h> 14 15 #include <string.h> 15 16 17 #undef B_TRANSLATE_CONTEXT 18 #define B_TRANSLATE_CONTEXT "RTFTranslator" 16 19 17 20 #define READ_BUFFER_SIZE 2048 18 21 #define DATA_BUFFER_SIZE 64 … … 54 57 RTFTranslator::RTFTranslator() 55 58 { 56 59 char info[256]; 57 sprintf(info, "Rich Text Format translator v%d.%d.%d %s", 58 int(B_TRANSLATION_MAJOR_VERSION(RTF_TRANSLATOR_VERSION)), 59 int(B_TRANSLATION_MINOR_VERSION(RTF_TRANSLATOR_VERSION)), 60 int(B_TRANSLATION_REVISION_VERSION(RTF_TRANSLATOR_VERSION)), 60 sprintf(info, B_TRANSLATE("Rich Text Format translator v%d.%d.%d %s"), 61 static_cast<int>(B_TRANSLATION_MAJOR_VERSION(RTF_TRANSLATOR_VERSION)), 62 static_cast<int>(B_TRANSLATION_MINOR_VERSION(RTF_TRANSLATOR_VERSION)), 63 static_cast<int>(B_TRANSLATION_REVISION_VERSION( 64 RTF_TRANSLATOR_VERSION)), 61 65 __DATE__); 62 66 63 67 fInfo = strdup(info); … … 73 77 const char * 74 78 RTFTranslator::TranslatorName() const 75 79 { 76 return "RTF text files";80 return B_TRANSLATE("RTF text files"); 77 81 } 78 82 79 83 80 84 const char * 81 85 RTFTranslator::TranslatorInfo() const 82 86 { 83 return "Rich Text Format Translator";87 return B_TRANSLATE("Rich Text Format Translator"); 84 88 } 85 89 86 90 … … 131 135 info->group = B_TRANSLATOR_TEXT; 132 136 info->quality = RTF_IN_QUALITY; 133 137 info->capability = RTF_IN_CAPABILITY; 134 strcpy(info->name, "RichTextFormat file");138 strcpy(info->name, B_TRANSLATE("RichTextFormat file")); 135 139 strcpy(info->MIME, "text/rtf"); 136 140 137 141 return B_OK; … … 168 172 169 173 170 174 status_t 171 RTFTranslator::MakeConfigurationView(BMessage *ioExtension, BView **_view, BRect *_extent) 175 RTFTranslator::MakeConfigurationView(BMessage *ioExtension, BView **_view, 176 BRect *_extent) 172 177 { 173 178 if (_view == NULL || _extent == NULL) 174 179 return B_BAD_VALUE; -
src/add-ons/translators/rtf/Jamfile
16 16 RTF.cpp 17 17 RTFTranslator.cpp 18 18 19 : be translation libtranslatorsutils.a $(TARGET_LIBSUPC++) 19 : be translation libtranslatorsutils.a $(TARGET_LIBSUPC++) 20 $(HAIKU_LOCALE_LIBS) 20 21 $(HAIKU_LOCALE_LIBS) 21 22 : true 22 23 ; 24 25 DoCatalogs RTF-Translator : 26 x-vnd.Haiku-RTFTranslator 27 : 28 main.cpp 29 RTFTranslator.cpp 30 ConfigView.cpp 31 ;