Ticket #7229: jpeg-translators-add-ons-localization.patch

File jpeg-translators-add-ons-localization.patch, 7.0 KB (added by Karvjorm, 13 years ago)

Localization patch fixing duplicate about text (one was correct, another was not)

  • src/add-ons/translators/jpeg/JPEGTranslator.cpp

     
    662662    BView(name, 0, new BGroupLayout(B_VERTICAL))
    663663{
    664664    BAlignment labelAlignment = BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP);
    665     BStringView* title = new BStringView("Title", sTranslatorName);
     665    BString str1(sTranslatorName);
     666    str1.ReplaceFirst("JPEG images", B_TRANSLATE("JPEG images"));
     667    BStringView* title = new BStringView("Title", str1.String());
    666668    title->SetFont(be_bold_font);
    667669    title->SetExplicitAlignment(labelAlignment);
    668670
     
    674676    version->SetExplicitAlignment(labelAlignment);
    675677
    676678    BTextView* infoView = new BTextView("info");
    677     infoView->SetText(sTranslatorInfo);
     679    BString str2(sTranslatorInfo);
     680    str2.ReplaceFirst("Based on IJG library ©  1994-2009, Thomas G. Lane, "
     681        "Guido Vollbeding.\n", B_TRANSLATE("Based on IJG library ©  1994-2009, "
     682        "Thomas G. Lane, Guido Vollbeding.\n"));
     683    str2.ReplaceFirst("with \"lossless\" encoding support patch by Ken "
     684        "Murchison\n", B_TRANSLATE("with \"lossless\" encoding support patch "
     685        "by Ken Murchison\n"));
     686    str2.ReplaceFirst("With some colorspace conversion routines by Magnus "
     687        "Hellman\n", B_TRANSLATE("With some colorspace conversion routines by "
     688        "Magnus Hellman\n"));
     689    infoView->SetText(str2.String());
    678690    infoView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
    679691    infoView->MakeEditable(false);
    680692
     
    695707    :
    696708    BTabView(name)
    697709{
    698     AddTab(new TranslatorWriteView("Write", settings->Acquire()));
    699     AddTab(new TranslatorReadView("Read", settings->Acquire()));
    700     AddTab(new TranslatorAboutView("About"));
     710    AddTab(new TranslatorWriteView(B_TRANSLATE("Write"), settings->Acquire()));
     711    AddTab(new TranslatorReadView(B_TRANSLATE("Read"), settings->Acquire()));
     712    AddTab(new TranslatorAboutView(B_TRANSLATE("About")));
    701713
    702714    settings->Release();
    703715
     
    788800                &longJumpBuffer);
    789801        }
    790802    } catch (...) {
    791         fprintf(stderr, B_TRANSLATE("libjpeg encountered a critical error "
    792             "(caught C++ exception).\n"));
     803        fprintf(stderr, "libjpeg encountered a critical error (caught C++ "
     804            "exception).\n");
    793805        return B_ERROR;
    794806    }
    795807
     
    943955
    944956        default:
    945957            fprintf(stderr,
    946                 B_TRANSLATE("Wrong type: Color space not implemented.\n"));
     958                    "Wrong type: Color space not implemented.\n");
    947959            return B_ERROR;
    948960    }
    949961    out_row_bytes = jpg_input_components * width;
     
    10981110        switch (cinfo.out_color_space) {
    10991111            case JCS_UNKNOWN:       /* error/unspecified */
    11001112                fprintf(stderr,
    1101                     B_TRANSLATE("From Type: Jpeg uses unknown color type\n"));
     1113                    "From Type: Jpeg uses unknown color type\n");
    11021114                break;
    11031115            case JCS_GRAYSCALE:     /* monochrome */
    11041116                // Check if user wants to read only as RGB32 or not
     
    11311143                break;
    11321144            default:
    11331145                fprintf(stderr,
    1134                     B_TRANSLATE("From Type: Jpeg uses hmm... i don't know "
    1135                     "really :(\n"));
     1146                    "From Type: Jpeg uses hmm... i don't know really :(\n");
    11361147                break;
    11371148        }
    11381149    }
     
    12791290            info->group = formats[i].group;
    12801291            info->quality = formats[i].quality;
    12811292            info->capability = formats[i].capability;
    1282             strcpy(info->name, formats[i].name);
     1293            BString str1(formats[i].name);
     1294            str1.ReplaceFirst("Be Bitmap Format (JPEGTranslator)",
     1295                B_TRANSLATE("Be Bitmap Format (JPEGTranslator)"));
     1296            strncpy(info->name, str1.String(), sizeof(info->name));
    12831297            strcpy(info->MIME,  formats[i].MIME);
    12841298            return B_OK;
    12851299        }
  • src/add-ons/translators/jpeg/JPEGTranslator.h

     
    3434
    3535#include <Alert.h>
    3636#include <Application.h>
     37#include <Catalog.h>
    3738#include <CheckBox.h>
    3839#include <FindDirectory.h>
    3940#include <Path.h>
     
    5253
    5354#include "BaseTranslator.h"
    5455
     56#undef B_TRANSLATE_CONTEXT
     57#define B_TRANSLATE_CONTEXT "JPEGTranslator"
     58
    5559// Settings
    5660#define SETTINGS_FILE   "JPEGTranslator"
    5761
     
    6771#define VIEW_MSG_SET_SHOWREADERRORBOX 'JSEB'
    6872
    6973// View labels
    70 #define VIEW_LABEL_QUALITY "Output quality"
    71 #define VIEW_LABEL_SMOOTHING "Output smoothing strength"
    72 #define VIEW_LABEL_PROGRESSIVE "Use progressive compression"
    73 #define VIEW_LABEL_OPTIMIZECOLORS "Prevent colors 'washing out'"
    74 #define VIEW_LABEL_SMALLERFILE "Make file smaller (sligthtly worse quality)"
    75 #define VIEW_LABEL_GRAY1ASRGB24 "Write black-and-white images as RGB24"
    76 #define VIEW_LABEL_ALWAYSRGB32 "Read greyscale images as RGB32"
    77 #define VIEW_LABEL_PHOTOSHOPCMYK "Use CMYK code with 0 for 100% ink coverage"
    78 #define VIEW_LABEL_SHOWREADERRORBOX "Show warning messages"
     74#define VIEW_LABEL_QUALITY B_TRANSLATE_MARK("Output quality")
     75#define VIEW_LABEL_SMOOTHING B_TRANSLATE_MARK("Output smoothing strength")
     76#define VIEW_LABEL_PROGRESSIVE B_TRANSLATE_MARK("Use progressive compression")
     77#define VIEW_LABEL_OPTIMIZECOLORS B_TRANSLATE_MARK("Prevent colors 'washing out'")
     78#define VIEW_LABEL_SMALLERFILE B_TRANSLATE_MARK("Make file smaller (sligthtly worse quality)")
     79#define VIEW_LABEL_GRAY1ASRGB24 B_TRANSLATE_MARK("Write black-and-white images as RGB24")
     80#define VIEW_LABEL_ALWAYSRGB32 B_TRANSLATE_MARK("Read greyscale images as RGB32")
     81#define VIEW_LABEL_PHOTOSHOPCMYK B_TRANSLATE_MARK("Use CMYK code with 0 for 100% ink coverage")
     82#define VIEW_LABEL_SHOWREADERRORBOX B_TRANSLATE_MARK("Show warning messages")
    7983
    8084// strings for use in TranslatorSettings
    8185#define JPEG_SET_SMOOTHING "smoothing"
  • src/add-ons/translators/jpeg/Jamfile

     
    1010
    1111UseLibraryHeaders jpeg ;
    1212
     13AddResources JPEGTranslator : JPEGTranslator.rdef ;
     14
    1315Translator JPEGTranslator :
    1416    be_jdatadst.cpp
    1517    be_jdatasrc.cpp
     
    2426DoCatalogs JPEGTranslator :
    2527    x-vnd.Haiku-JPEGTranslator
    2628    :
     29    JPEGTranslator.h
    2730    JPEGTranslator.cpp
    2831    exif_parser.cpp
    2932    be_jerror.cpp
  • src/add-ons/translators/jpeg/exif_parser.cpp

     
    66
    77#include "exif_parser.h"
    88
     9#include <Catalog.h>
    910#include <ctype.h>
    1011#include <set>
    1112#include <stdio.h>
  • src/add-ons/translators/jpeg/JPEGTranslator.rdef

     
     1/*
     2 * JPEGTranslator.rdef
     3 */
     4
     5resource app_signature "application/x-vnd.Haiku-JPEGTranslator";
     6
     7resource app_version {
     8    major  = 1,
     9    middle = 2,
     10    minor  = 0,
     11    variety = 0,
     12    internal = 0,
     13    short_info = "1.2.0",
     14    long_info = "Haiku JPEGTranslator Add-Ons."
     15};