* 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
This commit is contained in:
Jérôme Duval
2011-01-18 19:24:07 +00:00
parent 823a23829a
commit 63652401db
4 changed files with 32 additions and 9 deletions
+11 -6
View File
@@ -9,26 +9,30 @@
#include "ConfigView.h"
#include "EXRTranslator.h"
#include <StringView.h>
#include <Catalog.h>
#include <CheckBox.h>
#include <GroupLayout.h>
#include <GroupLayoutBuilder.h>
#include <SpaceLayoutItem.h>
#include <StringView.h>
#include <stdio.h>
#include <string.h>
#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));
}
@@ -5,6 +5,8 @@
* Distributed under the terms of the MIT License.
*/
#include <Catalog.h>
#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;
+8
View File
@@ -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 ;
+5 -1
View File
@@ -8,7 +8,10 @@
#include "TranslatorWindow.h"
#include <Application.h>
#include <Catalog.h>
#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;