Ticket #7140: sgitranslator-localization.patch

File sgitranslator-localization.patch, 6.7 KB (added by Karvjorm, 10 years ago)

A SGITranslator localization patch

  • src/add-ons/translators/sgi/Jamfile

     
    99    SGIMain.cpp
    1010    SGITranslator.cpp
    1111    SGIView.cpp
    12 
    13     : be translation libtranslatorsutils.a $(TARGET_LIBSUPC++)
    14     $(HAIKU_LOCALE_LIBS)
     12    : be translation libtranslatorsutils.a $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
    1513    : true
    1614;
    1715
     16DoCatalogs SGITranslator :
     17    x-vnd.Haiku-SGITranslator
     18    :
     19    SGIMain.cpp
     20    SGITranslator.cpp
     21    SGIView.cpp
     22;
     23
    1824Package haiku-translationkit-cvs :
    1925    SGITranslator :
    2026    boot home config add-ons Translators ;
  • src/add-ons/translators/sgi/SGIMain.cpp

     
    3535/*****************************************************************************/
    3636
    3737#include <Application.h>
     38#include <Catalog.h>
    3839#include "SGITranslator.h"
    3940#include "TranslatorWindow.h"
    4041
     42#undef B_TRANSLATE_CONTEXT
     43#define B_TRANSLATE_CONTEXT "SGIMain"
     44
    4145// ---------------------------------------------------------------
    4246// main
    4347//
     
    5761    BApplication app("application/x-vnd.Haiku-SGITranslator");
    5862    status_t result;
    5963    result = LaunchTranslatorWindow(new SGITranslator,
    60         "SGI Settings", BRect(0, 0, 225, 175));
     64        B_TRANSLATE("SGI Settings"), BRect(0, 0, 225, 175));
    6165    if (result == B_OK) {
    6266        app.Run();
    6367        return 0;
  • src/add-ons/translators/sgi/SGITranslator.cpp

     
    4444#include <stdio.h>
    4545#include <string.h>
    4646
     47#include <Catalog.h>
    4748#include <OS.h>
    4849
    4950#include "SGIImage.h"
     
    5253
    5354using std::nothrow;
    5455
     56#undef B_TRANSLATE_CONTEXT
     57#define B_TRANSLATE_CONTEXT "SGITranslator"
     58
     59
    5560// The input formats that this translator supports.
    5661static const translation_format sInputFormats[] = {
    5762    {
     
    152157// ---------------------------------------------------------------
    153158SGITranslator::SGITranslator()
    154159    :
    155     BaseTranslator("SGI images", "SGI image translator",
     160    BaseTranslator(B_TRANSLATE("SGI images"),
     161        B_TRANSLATE("SGI image translator"),
    156162        SGI_TRANSLATOR_VERSION,
    157163        sInputFormats, kNumInputFormats,
    158164        sOutputFormats, kNumOutputFormats,
     
    196202            outInfo->quality = SGI_IN_QUALITY;
    197203            outInfo->capability = SGI_IN_CAPABILITY;
    198204            strcpy(outInfo->MIME, "image/sgi");
    199             strcpy(outInfo->name, "SGI image");
     205            strcpy(outInfo->name, B_TRANSLATE("SGI image"));
    200206        }
    201207    } else {
    202208        delete sgiImage;
     
    412418                    for (uint32 z = 0; z < channelCount; z++) {
    413419                        ret = sgiImage->WriteRow(rows[z], y, z);
    414420                        if (ret < B_OK) {
    415 printf("WriteRow() returned %s!\n", strerror(ret));
     421                            printf(B_TRANSLATE("WriteRow() returned %s!\n"),
     422                                strerror(ret));
    416423                            break;
    417424                        }
    418425                    }
     
    498505                sizeof(TranslatorBitmap), B_SWAP_HOST_TO_BENDIAN)) < B_OK) {
    499506                return ret;
    500507            } else
    501                 ret = outDestination->Write(&bitsHeader, sizeof(TranslatorBitmap));
     508                ret = outDestination->Write(&bitsHeader,
     509                    sizeof(TranslatorBitmap));
    502510        }
    503 if (ret < B_OK)
    504 printf("error writing bits header: %s\n", strerror(ret));
     511        if (ret < B_OK)
     512            printf(B_TRANSLATE("error writing bits header: %s\n"),
     513                strerror(ret));
    505514        if (ret >= B_OK && !bheaderonly) {
    506515            // read one row at a time,
    507516            // convert to the correct format
     
    738747BView *
    739748SGITranslator::NewConfigView(TranslatorSettings *settings)
    740749{
    741     return new SGIView("SGITranslator Settings", B_WILL_DRAW, settings);
     750    return new SGIView(B_TRANSLATE("SGITranslator Settings"), B_WILL_DRAW,
     751        settings);
    742752}
  • src/add-ons/translators/sgi/SGIView.cpp

     
    3333#include <stdio.h>
    3434#include <string.h>
    3535
     36#include <Catalog.h>
    3637#include <GroupLayoutBuilder.h>
    3738#include <MenuBar.h>
    3839#include <MenuField.h>
     
    4950
    5051const char* author = "Stephan Aßmus, <stippi@yellowbites.com>";
    5152
     53#undef B_TRANSLATE_CONTEXT
     54#define B_TRANSLATE_CONTEXT "SGIView"
     55
    5256// add_menu_item
    5357void
    5458add_menu_item(BMenu* menu,
     
    8387{
    8488    BPopUpMenu* menu = new BPopUpMenu("pick compression");
    8589
    86     uint32 currentCompression = fSettings->SetGetInt32(SGI_SETTING_COMPRESSION);
     90    uint32 currentCompression =
     91        fSettings->SetGetInt32(SGI_SETTING_COMPRESSION);
    8792    // create the menu items with the various compression methods
    88     add_menu_item(menu, SGI_COMP_NONE, "None", currentCompression);
     93    add_menu_item(menu, SGI_COMP_NONE, B_TRANSLATE("None"),
     94        currentCompression);
    8995//  menu->AddSeparatorItem();
    90     add_menu_item(menu, SGI_COMP_RLE, "RLE", currentCompression);
     96    add_menu_item(menu, SGI_COMP_RLE, B_TRANSLATE("RLE"), currentCompression);
    9197
    9298// DON'T turn this on, it's so slow that I didn't wait long enough
    9399// the one time I tested this. So I don't know if the code even works.
     
    97103
    98104//  add_menu_item(menu, SGI_COMP_ARLE, "Agressive RLE", currentCompression);
    99105
    100     fCompressionMF = new BMenuField("compression", "Use compression:", menu);
     106    fCompressionMF = new BMenuField("compression",
     107        B_TRANSLATE("Use compression:"), menu);
    101108
    102109    BAlignment labelAlignment(B_ALIGN_LEFT, B_ALIGN_NO_VERTICAL);
    103110
    104     BStringView* titleView = new BStringView("title", "SGI image translator");
     111    BStringView* titleView = new BStringView("title",
     112        B_TRANSLATE("SGI image translator"));
    105113    titleView->SetFont(be_bold_font);
    106114    titleView->SetExplicitAlignment(labelAlignment);
    107115
    108116    char detail[100];
    109     sprintf(detail, "Version %d.%d.%d %s",
     117    sprintf(detail, B_TRANSLATE("Version %d.%d.%d %s"),
    110118        static_cast<int>(B_TRANSLATION_MAJOR_VERSION(SGI_TRANSLATOR_VERSION)),
    111119        static_cast<int>(B_TRANSLATION_MINOR_VERSION(SGI_TRANSLATOR_VERSION)),
    112         static_cast<int>(B_TRANSLATION_REVISION_VERSION(SGI_TRANSLATOR_VERSION)),
    113         __DATE__);
     120        static_cast<int>(B_TRANSLATION_REVISION_VERSION(
     121            SGI_TRANSLATOR_VERSION)), __DATE__);
    114122    BStringView* detailView = new BStringView("details", detail);
    115123    detailView->SetExplicitAlignment(labelAlignment);
    116124
    117125    BTextView* infoView = new BTextView("info");
    118     infoView->SetText(BString("written by:\n")
     126    infoView->SetText(BString(B_TRANSLATE("written by:\n"))
    119127            .Append(author)
    120             .Append("\n\nbased on GIMP SGI plugin v1.5:\n")
     128            .Append(B_TRANSLATE("\n\nbased on GIMP SGI plugin v1.5:\n"))
    121129            .Append(kSGICopyright).String());
    122130    infoView->SetExplicitAlignment(labelAlignment);
    123131    infoView->SetWordWrap(false);