Ticket #7229: gif-another-localization-update.patch

File gif-another-localization-update.patch, 2.0 KB (added by Karvjorm, 13 years ago)

Additional GIFTranslator localization patch

  • src/add-ons/translators/gif/GIFTranslator.cpp

     
    4949status_t GetBitmap(BPositionIO *in, BBitmap **out);
    5050
    5151/* Required data */
    52 char translatorName[] = "GIF images";
    53 char translatorInfo[] = "GIF image translator v1.4";
     52BString str1(B_TRANSLATE("GIF images"));
     53BString str2(B_TRANSLATE("GIF image translator v1.4"));
     54char translatorName[255];
     55char translatorInfo[255];
    5456int32 translatorVersion = 0x140;
    5557
    5658translation_format inputFormats[] = {
     
    6971    { 0 }
    7072};
    7173
    72 
    7374/* Build a pretty view for DataTranslations */
    7475status_t
    7576MakeConfig(BMessage *ioExtension, BView **outView, BRect *outExtent)
     
    240241    : BApplication("application/x-vnd.Haiku-GIFTranslator")
    241242{
    242243    BRect rect(100, 100, 339, 339);
     244    memset(translatorName, 0x00, 255);
     245    memset(translatorInfo, 0x00, 255);
     246    if (str1.Length() <= 255)
     247        strncpy(translatorName, str1.String(), str1.Length());
     248    if (str2.Length() <= 255)
     249        strncpy(translatorInfo, str2.String(), str2.Length());
     250
    243251    gifwindow = new GIFWindow(rect, B_TRANSLATE("GIF Settings"));
    244252    gifwindow->Show();
    245253}
  • src/add-ons/translators/gif/GIFWindow.cpp

     
    1616#include "GIFWindow.h"
    1717#include "GIFView.h"
    1818#include <Application.h>
     19#include <Catalog.h>
    1920#include <GroupLayout.h>
    2021
     22#undef B_TRANSLATE_CONTEXT
     23#define B_TRANSLATE_CONTEXT "GIF Window"
     24
    2125GIFWindow::GIFWindow(BRect rect, const char *name) :
    2226    BWindow(rect, name, B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE
    2327    | B_AUTO_UPDATE_SIZE_LIMITS, B_CURRENT_WORKSPACE) {
    2428    SetLayout(new BGroupLayout(B_HORIZONTAL));
    25     gifview = new GIFView("GIFView");
     29    gifview = new GIFView(B_TRANSLATE("GIFView"));
    2630    AddChild(gifview);
    2731}
    2832