Patch by taos : localize TGA and STX translator. Fixes #7229.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43001 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2009, Haiku, Inc. All rights reserved.
|
* Copyright 2002-2011, Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT license.
|
* Distributed under the terms of the MIT license.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -13,11 +13,16 @@
|
|||||||
#include "STXTView.h"
|
#include "STXTView.h"
|
||||||
#include "STXTTranslator.h"
|
#include "STXTTranslator.h"
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <StringView.h>
|
#include <StringView.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "STXTView"
|
||||||
|
|
||||||
|
|
||||||
STXTView::STXTView(const BRect &frame, const char *name, uint32 resizeMode,
|
STXTView::STXTView(const BRect &frame, const char *name, uint32 resizeMode,
|
||||||
uint32 flags, TranslatorSettings *settings)
|
uint32 flags, TranslatorSettings *settings)
|
||||||
: BView(frame, name, resizeMode, flags)
|
: BView(frame, name, resizeMode, flags)
|
||||||
@@ -30,7 +35,8 @@ STXTView::STXTView(const BRect &frame, const char *name, uint32 resizeMode,
|
|||||||
float height = fontHeight.descent + fontHeight.ascent + fontHeight.leading;
|
float height = fontHeight.descent + fontHeight.ascent + fontHeight.leading;
|
||||||
|
|
||||||
BRect rect(10, 10, 200, 10 + height);
|
BRect rect(10, 10, 200, 10 + height);
|
||||||
BStringView *stringView = new BStringView(rect, "title", "StyledEdit files translator");
|
BStringView *stringView = new BStringView(rect, "title",
|
||||||
|
B_TRANSLATE("StyledEdit files translator"));
|
||||||
stringView->SetFont(be_bold_font);
|
stringView->SetFont(be_bold_font);
|
||||||
stringView->ResizeToPreferred();
|
stringView->ResizeToPreferred();
|
||||||
AddChild(stringView);
|
AddChild(stringView);
|
||||||
@@ -55,7 +61,8 @@ STXTView::STXTView(const BRect &frame, const char *name, uint32 resizeMode,
|
|||||||
height = fontHeight.descent + fontHeight.ascent + fontHeight.leading;
|
height = fontHeight.descent + fontHeight.ascent + fontHeight.leading;
|
||||||
|
|
||||||
rect.OffsetBy(0, height + 5);
|
rect.OffsetBy(0, height + 5);
|
||||||
stringView = new BStringView(rect, "Copyright", B_UTF8_COPYRIGHT "2002-2006 Haiku Inc.");
|
stringView = new BStringView(rect, "Copyright",
|
||||||
|
B_UTF8_COPYRIGHT "2002-2006 Haiku Inc.");
|
||||||
stringView->ResizeToPreferred();
|
stringView->ResizeToPreferred();
|
||||||
AddChild(stringView);
|
AddChild(stringView);
|
||||||
|
|
||||||
|
|||||||
@@ -52,9 +52,9 @@ TGAView::TGAView(const char *name, uint32 flags, TranslatorSettings *settings)
|
|||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
SetLowColor(ViewColor());
|
SetLowColor(ViewColor());
|
||||||
|
|
||||||
fTitle = new BStringView("title", "TGA Image Translator");
|
fTitle = new BStringView("title", B_TRANSLATE("TGA Image Translator"));
|
||||||
fTitle->SetFont(be_bold_font);
|
fTitle->SetFont(be_bold_font);
|
||||||
|
|
||||||
char detail[100];
|
char detail[100];
|
||||||
sprintf(detail, B_TRANSLATE("Version %d.%d.%d %s"),
|
sprintf(detail, B_TRANSLATE("Version %d.%d.%d %s"),
|
||||||
static_cast<int>(B_TRANSLATION_MAJOR_VERSION(TGA_TRANSLATOR_VERSION)),
|
static_cast<int>(B_TRANSLATION_MAJOR_VERSION(TGA_TRANSLATOR_VERSION)),
|
||||||
@@ -64,22 +64,22 @@ TGAView::TGAView(const char *name, uint32 flags, TranslatorSettings *settings)
|
|||||||
fDetail = new BStringView("detail", detail);
|
fDetail = new BStringView("detail", detail);
|
||||||
fWrittenBy = new BStringView("writtenby",
|
fWrittenBy = new BStringView("writtenby",
|
||||||
B_TRANSLATE("Written by the Haiku Translation Kit Team"));
|
B_TRANSLATE("Written by the Haiku Translation Kit Team"));
|
||||||
|
|
||||||
fpchkIgnoreAlpha = new BCheckBox(B_TRANSLATE("Ignore TGA alpha channel"),
|
fpchkIgnoreAlpha = new BCheckBox(B_TRANSLATE("Ignore TGA alpha channel"),
|
||||||
new BMessage(CHANGE_IGNORE_ALPHA));
|
new BMessage(CHANGE_IGNORE_ALPHA));
|
||||||
int32 val = (fSettings->SetGetBool(TGA_SETTING_IGNORE_ALPHA)) ? 1 : 0;
|
int32 val = (fSettings->SetGetBool(TGA_SETTING_IGNORE_ALPHA)) ? 1 : 0;
|
||||||
fpchkIgnoreAlpha->SetValue(val);
|
fpchkIgnoreAlpha->SetValue(val);
|
||||||
fpchkIgnoreAlpha->SetViewColor(ViewColor());
|
fpchkIgnoreAlpha->SetViewColor(ViewColor());
|
||||||
|
|
||||||
fpchkRLE = new BCheckBox(B_TRANSLATE("Save with RLE Compression"),
|
fpchkRLE = new BCheckBox(B_TRANSLATE("Save with RLE Compression"),
|
||||||
new BMessage(CHANGE_RLE));
|
new BMessage(CHANGE_RLE));
|
||||||
val = (fSettings->SetGetBool(TGA_SETTING_RLE)) ? 1 : 0;
|
val = (fSettings->SetGetBool(TGA_SETTING_RLE)) ? 1 : 0;
|
||||||
fpchkRLE->SetValue(val);
|
fpchkRLE->SetValue(val);
|
||||||
fpchkRLE->SetViewColor(ViewColor());
|
fpchkRLE->SetViewColor(ViewColor());
|
||||||
|
|
||||||
// Build the layout
|
// Build the layout
|
||||||
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
||||||
|
|
||||||
AddChild(BGroupLayoutBuilder(B_VERTICAL, 7)
|
AddChild(BGroupLayoutBuilder(B_VERTICAL, 7)
|
||||||
.Add(fTitle)
|
.Add(fTitle)
|
||||||
.Add(fDetail)
|
.Add(fDetail)
|
||||||
@@ -91,10 +91,11 @@ TGAView::TGAView(const char *name, uint32 flags, TranslatorSettings *settings)
|
|||||||
.AddGlue()
|
.AddGlue()
|
||||||
.SetInsets(5, 5, 5, 5)
|
.SetInsets(5, 5, 5, 5)
|
||||||
);
|
);
|
||||||
|
|
||||||
BFont font;
|
BFont font;
|
||||||
GetFont(&font);
|
GetFont(&font);
|
||||||
SetExplicitPreferredSize(BSize((font.Size() * 333)/12, (font.Size() * 200)/12));
|
SetExplicitPreferredSize(BSize((font.Size() * 333)/12,
|
||||||
|
(font.Size() * 200)/12));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user