Fixing localization of JPEG and JPEG2000 translation add-ons.

Partially fixing #7229.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40565 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Siarzhuk Zharski 2011-02-19 22:28:42 +00:00
parent dcdbb901e4
commit 2e49ff35c5
4 changed files with 42 additions and 73 deletions

View File

@ -59,22 +59,21 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define B_TRANSLATOR_BITMAP_DESCRIPTION "Be Bitmap Format (JPEGTranslator)"
// Translation Kit required globals
static char sTranslatorName[] = "JPEG images";
static char sTranslatorInfo[] =
"©2002-2003, Marcin Konicki\n"
static const int32 sTranslatorVersion = B_TRANSLATION_MAKE_VERSION(1, 2, 0);
static const char* sTranslatorName = B_TRANSLATE_MARK("JPEG images");
static const char* sTranslatorInfo
= B_TRANSLATE_MARK("©2002-2003, Marcin Konicki\n"
"©2005-2007, Haiku\n"
"\n"
"Based on IJG library © 1994-2009, Thomas G. Lane, Guido Vollbeding.\n"
" http://www.ijg.org/files/\n"
"\thttp://www.ijg.org/files/\n"
"\n"
"with \"lossless\" encoding support patch by Ken Murchison\n"
" http://www.oceana.com/ftp/ljpeg/\n"
"\thttp://www.oceana.com/ftp/ljpeg/\n"
"\n"
"With some colorspace conversion routines by Magnus Hellman\n"
" http://www.bebits.com/app/802\n";
static const int32 sTranslatorVersion = B_TRANSLATION_MAKE_VERSION(1, 2, 0);
"\thttp://www.bebits.com/app/802\n");
// Define the formats we know how to read
static const translation_format sInputFormats[] = {
@ -420,17 +419,20 @@ TranslatorReadView::TranslatorReadView(const char* name,
fSettings(settings)
// settings should already be Acquired()
{
fAlwaysRGB32 = new BCheckBox("alwaysrgb32", VIEW_LABEL_ALWAYSRGB32,
fAlwaysRGB32 = new BCheckBox("alwaysrgb32",
B_TRANSLATE("Read greyscale images as RGB32"),
new BMessage(VIEW_MSG_SET_ALWAYSRGB32));
if (fSettings->SetGetBool(JPEG_SET_ALWAYS_RGB32, NULL))
fAlwaysRGB32->SetValue(B_CONTROL_ON);
fPhotoshopCMYK = new BCheckBox("photoshopCMYK", VIEW_LABEL_PHOTOSHOPCMYK,
fPhotoshopCMYK = new BCheckBox("photoshopCMYK",
B_TRANSLATE("Use CMYK code with 0 for 100% ink coverage"),
new BMessage(VIEW_MSG_SET_PHOTOSHOPCMYK));
if (fSettings->SetGetBool(JPEG_SET_PHOTOSHOP_CMYK, NULL))
fPhotoshopCMYK->SetValue(B_CONTROL_ON);
fShowErrorBox = new BCheckBox("error", VIEW_LABEL_SHOWREADERRORBOX,
fShowErrorBox = new BCheckBox("error",
B_TRANSLATE("Show warning messages"),
new BMessage(VIEW_MSG_SET_SHOWREADERRORBOX));
if (fSettings->SetGetBool(JPEG_SET_SHOWREADWARNING, NULL))
fShowErrorBox->SetValue(B_CONTROL_ON);
@ -515,14 +517,15 @@ TranslatorWriteView::TranslatorWriteView(const char* name,
fSettings(settings)
// settings should already be Acquired()
{
fQualitySlider = new SSlider("quality", VIEW_LABEL_QUALITY,
fQualitySlider = new SSlider("quality", B_TRANSLATE("Output quality"),
new BMessage(VIEW_MSG_SET_QUALITY), 0, 100);
fQualitySlider->SetHashMarks(B_HASH_MARKS_BOTTOM);
fQualitySlider->SetHashMarkCount(10);
fQualitySlider->SetLimitLabels(B_TRANSLATE("Low"), B_TRANSLATE("High"));
fQualitySlider->SetValue(fSettings->SetGetInt32(JPEG_SET_QUALITY, NULL));
fSmoothingSlider = new SSlider("smoothing", VIEW_LABEL_SMOOTHING,
fSmoothingSlider = new SSlider("smoothing",
B_TRANSLATE("Output smoothing strength"),
new BMessage(VIEW_MSG_SET_SMOOTHING), 0, 100);
fSmoothingSlider->SetHashMarks(B_HASH_MARKS_BOTTOM);
fSmoothingSlider->SetHashMarkCount(10);
@ -530,24 +533,28 @@ TranslatorWriteView::TranslatorWriteView(const char* name,
fSmoothingSlider->SetValue(
fSettings->SetGetInt32(JPEG_SET_SMOOTHING, NULL));
fProgress = new BCheckBox("progress", VIEW_LABEL_PROGRESSIVE,
fProgress = new BCheckBox("progress",
B_TRANSLATE("Use progressive compression"),
new BMessage(VIEW_MSG_SET_PROGRESSIVE));
if (fSettings->SetGetBool(JPEG_SET_PROGRESSIVE, NULL))
fProgress->SetValue(B_CONTROL_ON);
fSmallerFile = new BCheckBox("smallerfile", VIEW_LABEL_SMALLERFILE,
fSmallerFile = new BCheckBox("smallerfile",
B_TRANSLATE("Make file smaller (sligthtly worse quality)"),
new BMessage(VIEW_MSG_SET_SMALLERFILE));
if (fSettings->SetGetBool(JPEG_SET_SMALL_FILES))
fSmallerFile->SetValue(B_CONTROL_ON);
fOptimizeColors = new BCheckBox("optimizecolors", VIEW_LABEL_OPTIMIZECOLORS,
fOptimizeColors = new BCheckBox("optimizecolors",
B_TRANSLATE("Prevent colors 'washing out'"),
new BMessage(VIEW_MSG_SET_OPTIMIZECOLORS));
if (fSettings->SetGetBool(JPEG_SET_OPT_COLORS, NULL))
fOptimizeColors->SetValue(B_CONTROL_ON);
else
fSmallerFile->SetEnabled(false);
fGrayAsRGB24 = new BCheckBox("gray1asrgb24", VIEW_LABEL_GRAY1ASRGB24,
fGrayAsRGB24 = new BCheckBox("gray1asrgb24",
B_TRANSLATE("Write black-and-white images as RGB24"),
new BMessage(VIEW_MSG_SET_GRAY1ASRGB24));
if (fSettings->SetGetBool(JPEG_SET_GRAY1_AS_RGB24))
fGrayAsRGB24->SetValue(B_CONTROL_ON);
@ -678,17 +685,7 @@ TranslatorAboutView::TranslatorAboutView(const char* name)
version->SetExplicitAlignment(labelAlignment);
BTextView* infoView = new BTextView("info");
BString str2(sTranslatorInfo);
str2.ReplaceFirst("Based on IJG library © 1994-2009, Thomas G. Lane, "
"Guido Vollbeding.\n", B_TRANSLATE("Based on IJG library © 1994-2009, "
"Thomas G. Lane, Guido Vollbeding.\n"));
str2.ReplaceFirst("with \"lossless\" encoding support patch by Ken "
"Murchison\n", B_TRANSLATE("with \"lossless\" encoding support patch "
"by Ken Murchison\n"));
str2.ReplaceFirst("With some colorspace conversion routines by Magnus "
"Hellman\n", B_TRANSLATE("With some colorspace conversion routines by "
"Magnus Hellman\n"));
infoView->SetText(str2.String());
infoView->SetText(sTranslatorInfo);
infoView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
infoView->MakeEditable(false);

View File

@ -70,17 +70,6 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define VIEW_MSG_SET_PHOTOSHOPCMYK 'JSPC'
#define VIEW_MSG_SET_SHOWREADERRORBOX 'JSEB'
// View labels
#define VIEW_LABEL_QUALITY B_TRANSLATE_MARK("Output quality")
#define VIEW_LABEL_SMOOTHING B_TRANSLATE_MARK("Output smoothing strength")
#define VIEW_LABEL_PROGRESSIVE B_TRANSLATE_MARK("Use progressive compression")
#define VIEW_LABEL_OPTIMIZECOLORS B_TRANSLATE_MARK("Prevent colors 'washing out'")
#define VIEW_LABEL_SMALLERFILE B_TRANSLATE_MARK("Make file smaller (sligthtly worse quality)")
#define VIEW_LABEL_GRAY1ASRGB24 B_TRANSLATE_MARK("Write black-and-white images as RGB24")
#define VIEW_LABEL_ALWAYSRGB32 B_TRANSLATE_MARK("Read greyscale images as RGB32")
#define VIEW_LABEL_PHOTOSHOPCMYK B_TRANSLATE_MARK("Use CMYK code with 0 for 100% ink coverage")
#define VIEW_LABEL_SHOWREADERRORBOX B_TRANSLATE_MARK("Show warning messages")
// strings for use in TranslatorSettings
#define JPEG_SET_SMOOTHING "smoothing"
#define JPEG_SET_QUALITY "quality"
@ -93,7 +82,6 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define JPEG_SET_SHOWREADWARNING "readWarning"
/*!
Slider used in TranslatorView
With status showing actual value
@ -214,3 +202,4 @@ EXTERN(struct jpeg_error_mgr *) be_jpeg_std_error (struct jpeg_error_mgr * err,
// implemented in "be_jerror.cpp"
#endif // _JPEGTRANSLATOR_H_

View File

@ -55,20 +55,20 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define B_TRANSLATOR_BITMAP_MIME_STRING "image/x-be-bitmap"
#define B_TRANSLATOR_BITMAP_DESCRIPTION "Be Bitmap Format (JPEG2000Translator)"
static const char sTranslatorName[] = "JPEG2000 images";
static const char sTranslatorInfo[] = "©2002-2003, Shard\n"
static int32 sTranslatorVersion = B_TRANSLATION_MAKE_VERSION(1, 0, 0);
static const char* sTranslatorName = B_TRANSLATE_MARK("JPEG2000 images");
static const char* sTranslatorInfo = B_TRANSLATE_MARK("©2002-2003, Shard\n"
"©2005-2006, Haiku\n"
"\n"
"Based on JasPer library:\n"
"© 1999-2000, Image Power, Inc. and\n"
"the University of British Columbia, Canada.\n"
"© 2001-2003 Michael David Adams.\n"
" http://www.ece.uvic.ca/~mdadams/jasper/\n"
"\thttp://www.ece.uvic.ca/~mdadams/jasper/\n"
"\n"
"ImageMagick's jp2 codec was used as \"tutorial\".\n"
" http://www.imagemagick.org/\n";
static int32 sTranslatorVersion = B_TRANSLATION_MAKE_VERSION(1, 0, 0);
"\thttp://www.imagemagick.org/\n");
static const translation_format sInputFormats[] = {
{ JP2_FORMAT, B_TRANSLATOR_BITMAP, 0.5, 0.5,
@ -559,7 +559,8 @@ TranslatorReadView::TranslatorReadView(const char* name,
BView(name, 0, new BGroupLayout(B_VERTICAL)),
fSettings(settings)
{
fGrayAsRGB32 = new BCheckBox("grayasrgb32", VIEW_LABEL_GRAYASRGB32,
fGrayAsRGB32 = new BCheckBox("grayasrgb32",
B_TRANSLATE("Read greyscale images as RGB32"),
new BMessage(VIEW_MSG_SET_GRAYASRGB32));
if (fSettings->SetGetBool(JP2_SET_GRAY8_AS_B_RGB32))
fGrayAsRGB32->SetValue(B_CONTROL_ON);
@ -616,19 +617,21 @@ TranslatorWriteView::TranslatorWriteView(const char* name,
BView(name, 0, new BGroupLayout(B_VERTICAL)),
fSettings(settings)
{
fQualitySlider = new SSlider("quality", VIEW_LABEL_QUALITY,
fQualitySlider = new SSlider("quality", B_TRANSLATE("Output quality"),
new BMessage(VIEW_MSG_SET_QUALITY), 0, 100);
fQualitySlider->SetHashMarks(B_HASH_MARKS_BOTTOM);
fQualitySlider->SetHashMarkCount(10);
fQualitySlider->SetLimitLabels(B_TRANSLATE("Low"), B_TRANSLATE("High"));
fQualitySlider->SetValue(fSettings->SetGetInt32(JP2_SET_QUALITY));
fGrayAsRGB24 = new BCheckBox("gray1asrgb24", VIEW_LABEL_GRAY1ASRGB24,
fGrayAsRGB24 = new BCheckBox("gray1asrgb24",
B_TRANSLATE("Write black-and-white images as RGB24"),
new BMessage(VIEW_MSG_SET_GRAY1ASRGB24));
if (fSettings->SetGetBool(JP2_SET_GRAY1_AS_B_RGB24))
fGrayAsRGB24->SetValue(B_CONTROL_ON);
fCodeStreamOnly = new BCheckBox("codestreamonly", VIEW_LABEL_JPC,
fCodeStreamOnly = new BCheckBox("codestreamonly",
B_TRANSLATE("Output only codestream (.jpc)"),
new BMessage(VIEW_MSG_SET_JPC));
if (fSettings->SetGetBool(JP2_SET_JPC))
fCodeStreamOnly->SetValue(B_CONTROL_ON);
@ -707,9 +710,7 @@ TranslatorAboutView::TranslatorAboutView(const char* name)
BView(name, 0, new BGroupLayout(B_VERTICAL))
{
BAlignment labelAlignment = BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP);
BString str1(sTranslatorName);
str1.ReplaceFirst("JPEG2000 images", B_TRANSLATE("JPEG2000 images"));
BStringView* title = new BStringView("Title", str1.String());
BStringView* title = new BStringView("Title", sTranslatorName);
title->SetFont(be_bold_font);
title->SetExplicitAlignment(labelAlignment);
@ -723,17 +724,7 @@ TranslatorAboutView::TranslatorAboutView(const char* name)
version->SetExplicitAlignment(labelAlignment);
BTextView* infoView = new BTextView("info");
BString translationInfo(sTranslatorInfo);
translationInfo.ReplaceFirst("Based on JasPer library:",
B_TRANSLATE("Based on JasPer library:"));
translationInfo.ReplaceFirst("1999-2000, Image Power, Inc. and",
B_TRANSLATE("1999-2000, Image Power, Inc. and"));
translationInfo.ReplaceFirst("the University of British Columbia, Canada.",
B_TRANSLATE("the University of British Columbia, Canada."));
translationInfo.ReplaceFirst("ImageMagick's jp2 codec was used as "
"\"tutorial\".", B_TRANSLATE("ImageMagick's jp2 codec was used as "
"\"tutorial\"."));
infoView->SetText(translationInfo.String());
infoView->SetText(sTranslatorInfo);
infoView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
infoView->MakeEditable(false);

View File

@ -70,14 +70,6 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define VIEW_MSG_SET_JPC 'JSJC'
#define VIEW_MSG_SET_GRAYASRGB32 'JSAC'
// View labels
#define VIEW_LABEL_QUALITY B_TRANSLATE("Output quality")
#define VIEW_LABEL_JPC B_TRANSLATE("Output only codestream (.jpc)")
#define VIEW_LABEL_GRAY1ASRGB24 \
B_TRANSLATE("Write black-and-white images as RGB24")
#define VIEW_LABEL_GRAYASRGB32 \
B_TRANSLATE("Read greyscale images as RGB32")
/*!
Slider used in TranslatorView