Ticket #7233: lpe-localization.patch

File lpe-localization.patch, 3.2 KB (added by Karvjorm, 9 years ago)

pe lpe directory localization patch

  • lpe/lpe.rdef

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

     
    3939#include <stdlib.h>
    4040#include <stdarg.h>
    4141
     42#include <Catalog.h>
    4243#include <Message.h>
    4344#include <Roster.h>
    4445#include <String.h>
    4546
     47#undef B_TRANSLATE_CONTEXT
     48#define B_TRANSLATE_CONTEXT "lpe"
     49
    4650const long msg_CommandLineOpen = 'Cmdl';
    4751
    4852static std::vector<int> threads;
     
    5357
    5458void Usage()
    5559{
    56     puts("usage: lpe [file:linenr | +linenr file | file] ...");
     60    puts(B_TRANSLATE("usage: lpe [file:linenr | +linenr file | file] ..."));
    5761    exit(1);
    5862} /* Usage */
    5963
     
    8286
    8387    entry_ref pe;
    8488    if (be_roster->FindApp("application/x-vnd.beunited.pe", &pe))
    85         DoError("Could not find Pe!");
     89        DoError(B_TRANSLATE("Could not find Pe!"));
    8690   
    8791    status_t err;
    8892    if (!be_roster->IsRunning(&pe))
    8993    {
    9094        team_id team;
    9195        err = be_roster->Launch(&pe, &msg, &team);
    92         if (err) DoError("Error launching Pe (%s)", strerror(err));
     96        if (err) DoError(B_TRANSLATE("Error launching Pe (%s)"), strerror(err));
    9397        // now wait for the requested edit-window to come up (filter out standard
    9498        // windows):
    9599        bool foundThread = false;
     
    121125        {
    122126            thread_id tid;
    123127            err = reply.FindInt32("thread", (long *)&tid);
    124             if (err) DoError("Error getting thread id (%s)", strerror(err));
     128            if (err) DoError(B_TRANSLATE("Error getting thread id (%s)"), strerror(err));
    125129       
    126130            threads.push_back(tid);
    127131        }
    128132        else
    129             DoError("No Thread ID in reply");
     133            DoError(B_TRANSLATE("No Thread ID in reply"));
    130134    }
    131135
    132136} /* OpenInPe */
     
    168172                }
    169173
    170174                err = e.SetTo(path.String(), true);
    171                 if (err) DoError("Error trying to access file %s, (%s)", path.String(), strerror(err));
     175                if (err) DoError(B_TRANSLATE("Error trying to access file %s, (%s)"), path.String(), strerror(err));
    172176//              if (! e.Exists()) DoError("File %s does not exist", path.String());
    173                 if (e.Exists() && ! e.IsFile()) DoError("%s is not a regular file", path.String());
     177                if (e.Exists() && ! e.IsFile()) DoError(B_TRANSLATE("%s is not a regular file"), path.String());
    174178               
    175179                entry_ref ref;
    176180                err = e.GetRef(&ref);
    177                 if (err) DoError("Error trying to access file %s, (%s)", path.String(), strerror(err));
     181                if (err) DoError(B_TRANSLATE("Error trying to access file %s, (%s)"), path.String(), strerror(err));
    178182                OpenInPe(ref, lineNr);
    179183                lineNr = -1;
    180184            }
  • lpe/Jamfile

     
    11
    22SubDir TOP lpe ;
    33
     4AddResources lpe : lpe.rdef ;
     5
    46# <pe-src>
    57Application lpe
    68    : lpe.cpp
    7     : be $(STDC++LIB)
     9    : be $(STDC++LIB) $(HAIKU_LOCALE_LIBS)
    810    ;
     11
     12DoCatalogs lpe :
     13  x-vnd.Haiku-lpe
     14  :
     15  lpe.cpp
     16;
     17
    918# </pe-src>