Ticket #7138: rawtranslator-localization.patch
File rawtranslator-localization.patch, 6.7 KB (added by , 13 years ago) |
---|
-
src/add-ons/translators/raw/ConfigView.cpp
8 8 #include "ConfigView.h" 9 9 #include "RAWTranslator.h" 10 10 11 #include < StringView.h>11 #include <Catalog.h> 12 12 #include <CheckBox.h> 13 13 #include <GroupLayout.h> 14 14 #include <GroupLayoutBuilder.h> 15 #include <StringView.h> 15 16 16 17 #include <stdio.h> 17 18 #include <string.h> 18 19 20 #undef B_TRANSLATE_CONTEXT 21 #define B_TRANSLATE_CONTEXT "ConfigView" 19 22 23 const char* kShortName2 = B_TRANSLATE_MARK("RAWTranslator Settings"); 24 25 20 26 ConfigView::ConfigView(uint32 flags) 21 : BView( "RAWTranslator Settings", flags)27 : BView(kShortName2, flags) 22 28 { 23 29 SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); 24 30 25 BStringView *fTitle = new BStringView("title", "RAW Images");31 BStringView *fTitle = new BStringView("title", B_TRANSLATE("RAW Images")); 26 32 fTitle->SetFont(be_bold_font); 27 33 28 34 char version[256]; 29 sprintf(version, "Version %d.%d.%d, %s",35 sprintf(version, B_TRANSLATE("Version %d.%d.%d, %s"), 30 36 int(B_TRANSLATION_MAJOR_VERSION(RAW_TRANSLATOR_VERSION)), 31 37 int(B_TRANSLATION_MINOR_VERSION(RAW_TRANSLATOR_VERSION)), 32 38 int(B_TRANSLATION_REVISION_VERSION(RAW_TRANSLATOR_VERSION)), … … 37 43 B_UTF8_COPYRIGHT "2007-2009 Haiku Inc."); 38 44 39 45 BStringView *fCopyright2 = new BStringView("copyright2", 40 "Based on Dave Coffin's dcraw 8.63");46 B_TRANSLATE("Based on Dave Coffin's dcraw 8.63")); 41 47 42 48 BStringView *fCopyright3 = new BStringView("copyright3", 43 49 B_UTF8_COPYRIGHT "1997-2007 Dave Coffin"); -
src/add-ons/translators/raw/RAWTranslator.cpp
8 8 #include "ConfigView.h" 9 9 #include "RAW.h" 10 10 11 #include <Catalog.h> 11 12 #include <BufferIO.h> 12 13 #include <Messenger.h> 13 14 #include <TranslatorRoster.h> … … 16 17 #include <stdio.h> 17 18 #include <string.h> 18 19 20 #undef B_TRANSLATE_CONTEXT 21 #define B_TRANSLATE_CONTEXT "RAWTranslator" 19 22 23 20 24 class FreeAllocation { 21 25 public: 22 26 FreeAllocation(void* buffer) … … 45 49 const char* kProgressMonitor = "/progressMonitor"; 46 50 const char* kProgressMessage = "/progressMessage"; 47 51 52 48 53 // The input formats that this translator supports. 49 54 static const translation_format sInputFormats[] = { 50 55 { … … 87 92 const uint32 kNumOutputFormats = sizeof(sOutputFormats) / sizeof(translation_format); 88 93 const uint32 kNumDefaultSettings = sizeof(sDefaultSettings) / sizeof(TranSetting); 89 94 95 const char* kShortName1 = B_TRANSLATE_MARK("RAW images"); 96 const char* kShortInfo1 = B_TRANSLATE_MARK("RAW image translator"); 90 97 98 91 99 // #pragma mark - 92 100 93 101 94 102 RAWTranslator::RAWTranslator() 95 : BaseTranslator( "RAW images", "RAW image translator",103 : BaseTranslator(kShortName1, kShortInfo1, 96 104 RAW_TRANSLATOR_VERSION, 97 105 sInputFormats, kNumInputFormats, 98 106 sOutputFormats, kNumOutputFormats, … … 156 164 info->group = B_TRANSLATOR_BITMAP; 157 165 info->quality = RAW_IN_QUALITY; 158 166 info->capability = RAW_IN_CAPABILITY; 159 snprintf(info->name, sizeof(info->name), "%s RAW image", meta.manufacturer); 167 snprintf(info->name, sizeof(info->name), 168 B_TRANSLATE_COMMENT("%s RAW image", "Parameter (%s) is the name of " 169 "the manufacturer (like \"Canon\")"), meta.manufacturer); 160 170 strcpy(info->MIME, "image/x-vnd.photo-raw"); 161 171 162 172 return B_OK; -
src/add-ons/translators/raw/main.cpp
9 9 #include "TranslatorWindow.h" 10 10 11 11 #include <Application.h> 12 #include <Catalog.h> 12 13 13 14 #define TEST_MODE 0 14 15 #define SHOW_MODE 1 … … 24 25 #include <stdio.h> 25 26 #include <string.h> 26 27 28 #undef B_TRANSLATE_CONTEXT 29 #define B_TRANSLATE_CONTEXT "RAWTranslator main" 27 30 28 31 int 29 32 main(int argc, char **argv) … … 63 66 printf("software: %s\n", meta.software); 64 67 printf("flash used: %g\n", meta.flash_used); 65 68 printf("ISO speed: %g\n", meta.iso_speed); 66 printf("shutter: ");67 69 if (meta.shutter >= 1) 68 printf(" %g sec\n", meta.shutter);70 printf("shutter: %g sec\n", meta.shutter); 69 71 else 70 printf(" 1/%g sec\n", 1 / meta.shutter);72 printf("shutter: 1/%g sec\n", 1 / meta.shutter); 71 73 printf("aperture: %g\n", meta.aperture); 72 74 printf("focal length: %g mm\n", meta.focal_length); 73 75 printf("pixel aspect: %g\n", meta.pixel_aspect); … … 116 118 status = output.DetachBitmap(&bitmap); 117 119 if (status == B_OK) { 118 120 BWindow* window = new BWindow(BRect(0, 0, 1, 1), 119 "RAW", B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS 120 | B_NOT_RESIZABLE | B_AUTO_UPDATE_SIZE_LIMITS); 121 B_TRANSLATE("RAW"), B_TITLED_WINDOW, 122 B_ASYNCHRONOUS_CONTROLS | B_NOT_RESIZABLE | 123 B_AUTO_UPDATE_SIZE_LIMITS); 121 124 BView* view = new BView(window->Bounds(), NULL, 122 125 B_WILL_DRAW, B_FOLLOW_NONE); 123 126 window->AddChild(view); … … 140 143 } 141 144 #endif 142 145 143 status_t status = LaunchTranslatorWindow(new RAWTranslator, "RAW Settings"); 146 status_t status = LaunchTranslatorWindow(new RAWTranslator, 147 B_TRANSLATE("RAW Settings")); 144 148 if (status != B_OK) 145 149 return 1; 146 150 -
src/add-ons/translators/raw/Jamfile
10 10 RAWTranslator.cpp 11 11 ConfigView.cpp 12 12 RAW.cpp 13 : be translation libtranslatorsutils.a $(TARGET_LIBSUPC++) 13 : be locale translation libtranslatorsutils.a 14 $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS) 14 15 $(HAIKU_LOCALE_LIBS) 15 16 : true 16 17 ; 17 18 19 DoCatalogs RAWTranslator : 20 x-vnd.Haiku-RAWTranslator 21 : 22 RAWTranslator.cpp 23 ConfigView.cpp 24 main.cpp 25 : 26 english.catkeys 27 ; 28 18 29 Package haiku-translationkit-cvs : 19 30 RAWTranslator 20 31 : boot home config add-ons Translators -
src/add-ons/translators/raw/RAWTranslator.h
8 8 9 9 #include "BaseTranslator.h" 10 10 11 #include <ByteOrder.h> 12 #include <DataIO.h> 13 #include <File.h> 14 #include <GraphicsDefs.h> 15 #include <InterfaceDefs.h> 16 #include <TranslationDefs.h> 11 17 #include <Translator.h> 12 18 #include <TranslatorFormats.h> 13 #include <TranslationDefs.h>14 #include <GraphicsDefs.h>15 #include <InterfaceDefs.h>16 #include <DataIO.h>17 #include <File.h>18 #include <ByteOrder.h>19 19 20 20 21 21 #define RAW_TRANSLATOR_VERSION B_TRANSLATION_MAKE_VERSION(0, 5, 0)