Ticket #7126: hviftranslator-localization.patch

File hviftranslator-localization.patch, 4.6 KB (added by Karvjorm, 14 years ago)

An HVIFTranslator localization patch

  • src/add-ons/translators/hvif/HVIFMain.cpp

     
    77 */
    88
    99#include <Application.h>
     10#include <Catalog.h>
    1011#include "HVIFTranslator.h"
    1112#include "TranslatorWindow.h"
    1213
     14#undef B_TRANSLATE_CONTEXT
     15#define B_TRANSLATE_CONTEXT "HVIFMain"
     16
    1317int
    1418main(int argc, char *argv[])
    1519{
    1620    BApplication application("application/x-vnd.Haiku.HVIFTranslator");
    17     if (LaunchTranslatorWindow(new HVIFTranslator, "HVIF Settings",
    18             BRect(0, 0, 250, 150)) != B_OK)
     21    if (LaunchTranslatorWindow(new HVIFTranslator,
     22        B_TRANSLATE("HVIF Settings"), BRect(0, 0, 250, 150)) != B_OK)
    1923        return 1;
    2024
    2125    application.Run();
  • src/add-ons/translators/hvif/HVIFTranslator.cpp

     
    1111
    1212#include <Bitmap.h>
    1313#include <BitmapStream.h>
     14#include <Catalog.h>
    1415#include <IconUtils.h>
    1516
    1617#include <stdio.h>
     
    2122#define HVIF_TRANSLATION_QUALITY        1.0
    2223#define HVIF_TRANSLATION_CAPABILITY     1.0
    2324
     25#undef B_TRANSLATE_CONTEXT
     26#define B_TRANSLATE_CONTEXT "HVIFTranslator"
     27
     28
    2429static const translation_format sInputFormats[] = {
    2530    {
    2631        HVIF_FORMAT_CODE,
     
    6570
    6671
    6772HVIFTranslator::HVIFTranslator()
    68     : BaseTranslator("HVIF icons", "Native Haiku vector icon translator",
     73    : BaseTranslator(B_TRANSLATE("HVIF icons"),
     74        B_TRANSLATE("Native Haiku vector icon translator"),
    6975        HVIF_TRANSLATOR_VERSION,
    7076        sInputFormats, kNumInputFormats,
    7177        sOutputFormats, kNumOutputFormats,
     
    174180BView *
    175181HVIFTranslator::NewConfigView(TranslatorSettings *settings)
    176182{
    177     return new HVIFView("HVIFTranslator Settings", B_WILL_DRAW, settings);
     183    return new HVIFView(B_TRANSLATE("HVIFTranslator Settings"),
     184        B_WILL_DRAW, settings);
    178185}
  • src/add-ons/translators/hvif/Jamfile

     
    88    HVIFMain.cpp
    99    HVIFTranslator.cpp
    1010    HVIFView.cpp
    11     : be translation libtranslatorsutils.a $(TARGET_LIBSUPC++)
     11    : be translation libtranslatorsutils.a $(TARGET_LIBSUPC++)
     12$(HAIKU_LOCALE_LIBS)
    1213    $(HAIKU_LOCALE_LIBS)
    1314    : true
    1415;
     16
     17DoCatalogs HVIFTranslator :
     18    x-vnd.Haiku-HVIFTranslator
     19    :
     20    HVIFMain.cpp
     21    HVIFTranslator.cpp
     22    HVIFView.cpp
     23;
  • src/add-ons/translators/hvif/HVIFView.cpp

     
    99#include "HVIFView.h"
    1010#include "HVIFTranslator.h"
    1111
     12#include <Catalog.h>
    1213#include <GroupLayoutBuilder.h>
    1314#include <String.h>
    1415#include <StringView.h>
     
    1718
    1819#define HVIF_SETTING_RENDER_SIZE_CHANGED    'rsch'
    1920
     21#undef B_TRANSLATE_CONTEXT
     22#define B_TRANSLATE_CONTEXT "HVIFView"
    2023
     24
    2125HVIFView::HVIFView(const char* name, uint32 flags, TranslatorSettings *settings)
    2226    :
    2327    BView(name, flags, new BGroupLayout(B_VERTICAL)),
     
    2630    BAlignment labelAlignment(B_ALIGN_LEFT, B_ALIGN_NO_VERTICAL);
    2731
    2832    BStringView* title= new BStringView("title",
    29         "Native Haiku icon format translator");
     33        B_TRANSLATE("Native Haiku icon format translator"));
    3034    title->SetFont(be_bold_font);
    3135    title->SetExplicitAlignment(labelAlignment);
    3236
    3337    char versionString[256];
    34     snprintf(versionString, sizeof(versionString), "Version %d.%d.%d, %s",
     38    snprintf(versionString, sizeof(versionString),
     39        B_TRANSLATE("Version %d.%d.%d, %s"),
    3540        int(B_TRANSLATION_MAJOR_VERSION(HVIF_TRANSLATOR_VERSION)),
    3641        int(B_TRANSLATION_MINOR_VERSION(HVIF_TRANSLATOR_VERSION)),
    3742        int(B_TRANSLATION_REVISION_VERSION(HVIF_TRANSLATOR_VERSION)),
     
    4550
    4651
    4752    int32 renderSize = fSettings->SetGetInt32(HVIF_SETTING_RENDER_SIZE);
    48     BString label = "Render size: ";
    49     label << renderSize;
     53    BString label = B_TRANSLATE("Render size:");
     54    label << " " << renderSize;
    5055
    5156    fRenderSize = new BSlider("renderSize", label.String(),
    5257        NULL, 1, 32, B_HORIZONTAL);
     
    101106            fSettings->SetGetInt32(HVIF_SETTING_RENDER_SIZE, &value);
    102107            fSettings->SaveSettings();
    103108
    104             BString newLabel = "Render size: ";
    105             newLabel << value;
     109            BString newLabel = B_TRANSLATE("Render size:");
     110            newLabel << " " << value;
    106111            fRenderSize->SetLabel(newLabel.String());
    107112            return;
    108113        }