From 63652401db212eb08962518acff955bbd93ed53b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Tue, 18 Jan 2011 19:24:07 +0000 Subject: [PATCH] * Applied patch from Karvjorm #7119: EXRTranslator localization * minor style cleanup git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40244 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/translators/exr/ConfigView.cpp | 17 +++++++++++------ src/add-ons/translators/exr/EXRTranslator.cpp | 10 ++++++++-- src/add-ons/translators/exr/Jamfile | 8 ++++++++ src/add-ons/translators/exr/main.cpp | 6 +++++- 4 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/add-ons/translators/exr/ConfigView.cpp b/src/add-ons/translators/exr/ConfigView.cpp index 8ff7f3f53e..c2310cf36b 100644 --- a/src/add-ons/translators/exr/ConfigView.cpp +++ b/src/add-ons/translators/exr/ConfigView.cpp @@ -9,26 +9,30 @@ #include "ConfigView.h" #include "EXRTranslator.h" -#include +#include #include #include #include #include +#include #include #include +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "ConfigView" + ConfigView::ConfigView(uint32 flags) : BView("EXRTranslator Settings", flags) { SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); - BStringView *fTitle = new BStringView("title", "EXR Images"); + BStringView *fTitle = new BStringView("title", B_TRANSLATE("EXR Images")); fTitle->SetFont(be_bold_font); char version[256]; - sprintf(version, "Version %d.%d.%d, %s", + sprintf(version, B_TRANSLATE("Version %d.%d.%d, %s"), int(B_TRANSLATION_MAJOR_VERSION(EXR_TRANSLATOR_VERSION)), int(B_TRANSLATION_MINOR_VERSION(EXR_TRANSLATOR_VERSION)), int(B_TRANSLATION_REVISION_VERSION(EXR_TRANSLATOR_VERSION)), @@ -39,13 +43,13 @@ ConfigView::ConfigView(uint32 flags) B_UTF8_COPYRIGHT "2008 Haiku Inc."); BStringView *fCopyright2 = new BStringView("copyright2", - "Based on OpenEXR (http://www.openexr.com)"); + B_TRANSLATE("Based on OpenEXR (http://www.openexr.com)")); BStringView *fCopyright3 = new BStringView("copyright3", B_UTF8_COPYRIGHT "2006, Industrial Light & Magic,"); BStringView *fCopyright4 = new BStringView("copyright4", - "a division of Lucasfilm Entertainment Company Ltd"); + B_TRANSLATE("a division of Lucasfilm Entertainment Company Ltd")); // Build the layout SetLayout(new BGroupLayout(B_HORIZONTAL)); @@ -65,7 +69,8 @@ ConfigView::ConfigView(uint32 flags) BFont font; GetFont(&font); - SetExplicitPreferredSize(BSize((font.Size() * 400)/12, (font.Size() * 200)/12)); + SetExplicitPreferredSize(BSize(font.Size() * 400 / 12, + font.Size() * 200 / 12)); } diff --git a/src/add-ons/translators/exr/EXRTranslator.cpp b/src/add-ons/translators/exr/EXRTranslator.cpp index 75632de07d..ddc509383e 100644 --- a/src/add-ons/translators/exr/EXRTranslator.cpp +++ b/src/add-ons/translators/exr/EXRTranslator.cpp @@ -5,6 +5,8 @@ * Distributed under the terms of the MIT License. */ +#include + #include "ConfigView.h" #include "EXRGamma.h" #include "EXRTranslator.h" @@ -14,6 +16,9 @@ #include "ImfRgbaFile.h" #include "IStreamWrapper.h" +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "EXRTranslator" + // The input formats that this translator supports. translation_format sInputFormats[] = { @@ -56,7 +61,8 @@ const uint32 kNumDefaultSettings = sizeof(sDefaultSettings) / sizeof(TranSetting EXRTranslator::EXRTranslator() - : BaseTranslator("EXR Images", "EXR image translator", + : BaseTranslator(B_TRANSLATE("EXR Images"), + B_TRANSLATE("EXR image translator"), EXR_TRANSLATOR_VERSION, sInputFormats, kNumInputFormats, sOutputFormats, kNumOutputFormats, @@ -92,7 +98,7 @@ EXRTranslator::DerivedIdentify(BPositionIO *stream, outInfo->quality = EXR_IN_QUALITY; outInfo->capability = EXR_IN_CAPABILITY; strcpy(outInfo->MIME, "image/exr"); - strcpy(outInfo->name, "EXR image"); + strcpy(outInfo->name, B_TRANSLATE("EXR image")); } } catch (const std::exception &e) { return B_NO_TRANSLATOR; diff --git a/src/add-ons/translators/exr/Jamfile b/src/add-ons/translators/exr/Jamfile index 67d968d765..5c6fcabf49 100644 --- a/src/add-ons/translators/exr/Jamfile +++ b/src/add-ons/translators/exr/Jamfile @@ -18,6 +18,14 @@ Translator EXRTranslator : : true ; +DoCatalogs EXRTranslator : + x-vnd.Haiku-EXRTranslator + : + ConfigView.cpp + EXRTranslator.cpp + main.cpp +; + Package haiku-translationkit-cvs : EXRTranslator : boot home config add-ons Translators ; diff --git a/src/add-ons/translators/exr/main.cpp b/src/add-ons/translators/exr/main.cpp index 03c3d71fd0..a943f4e12d 100644 --- a/src/add-ons/translators/exr/main.cpp +++ b/src/add-ons/translators/exr/main.cpp @@ -8,7 +8,10 @@ #include "TranslatorWindow.h" #include +#include +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "main" int main(int /*argc*/, char **/*argv*/) @@ -16,7 +19,8 @@ main(int /*argc*/, char **/*argv*/) BApplication app("application/x-vnd.Haiku-EXRTranslator"); status_t result; - result = LaunchTranslatorWindow(new EXRTranslator, "EXR Settings"); + result = LaunchTranslatorWindow(new EXRTranslator, + B_TRANSLATE("EXR Settings")); if (result != B_OK) return 1;