Ticket #7229: STXTView.cpp_TGAView.cpp.patch

File STXTView.cpp_TGAView.cpp.patch, 3.4 KB (added by taos, 13 years ago)

Patch to localize title strings for STXT and TGA Translators.

  • src/add-ons/translators/stxt/STXTView.cpp

     
    11/*
    2  * Copyright 2002-2009, Haiku, Inc. All rights reserved.
     2 * Copyright 2002-2011, Haiku, Inc. All rights reserved.
    33 * Distributed under the terms of the MIT license.
    44 *
    55 * Authors:
     
    1313#include "STXTView.h"
    1414#include "STXTTranslator.h"
    1515
     16#include <Catalog.h>
    1617#include <StringView.h>
    1718
    1819#include <stdio.h>
    1920
    2021
     22#undef B_TRANSLATE_CONTEXT
     23#define B_TRANSLATE_CONTEXT "STXTView"
     24
     25
    2126STXTView::STXTView(const BRect &frame, const char *name, uint32 resizeMode,
    2227        uint32 flags, TranslatorSettings *settings)
    2328    : BView(frame, name, resizeMode, flags)
     
    3035    float height = fontHeight.descent + fontHeight.ascent + fontHeight.leading;
    3136
    3237    BRect rect(10, 10, 200, 10 + height);
    33     BStringView *stringView = new BStringView(rect, "title", "StyledEdit files translator");
     38    BStringView *stringView = new BStringView(rect, "title",
     39        B_TRANSLATE("StyledEdit files translator"));
    3440    stringView->SetFont(be_bold_font);
    3541    stringView->ResizeToPreferred();
    3642    AddChild(stringView);
     
    5561    height = fontHeight.descent + fontHeight.ascent + fontHeight.leading;
    5662
    5763    rect.OffsetBy(0, height + 5);
    58     stringView = new BStringView(rect, "Copyright", B_UTF8_COPYRIGHT "2002-2006 Haiku Inc.");
     64    stringView = new BStringView(rect, "Copyright",
     65        B_UTF8_COPYRIGHT "2002-2006 Haiku Inc.");
    5966    stringView->ResizeToPreferred();
    6067    AddChild(stringView);
    6168
  • src/add-ons/translators/tga/TGAView.cpp

     
    5252    SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
    5353    SetLowColor(ViewColor());
    5454
    55     fTitle = new BStringView("title", "TGA Image Translator");
     55    fTitle = new BStringView("title", B_TRANSLATE("TGA Image Translator"));
    5656    fTitle->SetFont(be_bold_font);
    57  
     57
    5858    char detail[100];
    5959    sprintf(detail, B_TRANSLATE("Version %d.%d.%d %s"),
    6060        static_cast<int>(B_TRANSLATION_MAJOR_VERSION(TGA_TRANSLATOR_VERSION)),
     
    6464    fDetail = new BStringView("detail", detail);
    6565    fWrittenBy = new BStringView("writtenby",
    6666        B_TRANSLATE("Written by the Haiku Translation Kit Team"));
    67  
     67
    6868    fpchkIgnoreAlpha = new BCheckBox(B_TRANSLATE("Ignore TGA alpha channel"),
    6969        new BMessage(CHANGE_IGNORE_ALPHA));
    7070    int32 val = (fSettings->SetGetBool(TGA_SETTING_IGNORE_ALPHA)) ? 1 : 0;
    7171    fpchkIgnoreAlpha->SetValue(val);
    7272    fpchkIgnoreAlpha->SetViewColor(ViewColor());
    73    
     73
    7474    fpchkRLE = new BCheckBox(B_TRANSLATE("Save with RLE Compression"),
    7575        new BMessage(CHANGE_RLE));
    7676    val = (fSettings->SetGetBool(TGA_SETTING_RLE)) ? 1 : 0;
    7777    fpchkRLE->SetValue(val);
    7878    fpchkRLE->SetViewColor(ViewColor());
    79  
     79
    8080    // Build the layout
    8181    SetLayout(new BGroupLayout(B_HORIZONTAL));
    82  
     82
    8383    AddChild(BGroupLayoutBuilder(B_VERTICAL, 7)
    8484        .Add(fTitle)
    8585        .Add(fDetail)
     
    9191        .AddGlue()
    9292        .SetInsets(5, 5, 5, 5)
    9393    );
    94  
     94
    9595    BFont font;
    9696    GetFont(&font);
    97     SetExplicitPreferredSize(BSize((font.Size() * 333)/12, (font.Size() * 200)/12));
     97    SetExplicitPreferredSize(BSize((font.Size() * 333)/12,
     98        (font.Size() * 200)/12));
    9899}
    99100
    100101