Ticket #7233: pe-Sources-localization.patch

File pe-Sources-localization.patch, 95.6 KB (added by Karvjorm, 13 years ago)

pe Sources directory localization patch

  • Sources/Pe.rdef

     
     1/*
     2 * Pe.rdef
     3 */
     4
     5resource app_signature "application/x-vnd.Haiku-Pe";
     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 Pe editor."
     15};
  • Sources/CLanguageInterface.cpp

     
    3333    Created: 09/19/97 10:49:36
    3434*/
    3535
     36#include <Catalog.h>
     37
    3638#include "pe.h"
    3739#include "PText.h"
    3840#include "CLanguageInterface.h"
     
    4951#include <algorithm>
    5052
    5153
     54#undef B_TRANSLATE_CONTEXT
     55#define B_TRANSLATE_CONTEXT "C Language Interface"
     56
    5257using std::map;
    5358
    5459
     
    7681
    7782ext::ext(const char *e)
    7883{
    79     if (strlen(e) > 11) THROW(("Extension `%s' is too long", e));
     84    if (strlen(e) > 11) THROW((B_TRANSLATE("Extension `%s' is too long"), e));
    8085
    8186    strcpy(t, e);
    8287} /* CLanguageInterface::ext::ext */
     
    99104    if (sfWordBreakTable == NULL)
    100105    {
    101106        sfWordBreakTable = (unsigned char *)HResources::GetResource(rtyp_Wbrt, rid_Wbrt_WordbreakTable);
    102         if (sfWordBreakTable == NULL) THROW(("Missing Resource!"));
     107        if (sfWordBreakTable == NULL) THROW((B_TRANSLATE("Missing Resource!")));
    103108    }
    104109
    105110//  fImage = -1;
     
    108113    fScanForFunctions = NULL;
    109114    fColorLine = NULL;
    110115    fFindNextWord = NULL;
    111     fLanguage = "None";
     116    fLanguage = B_TRANSLATE("None");
    112117    fExtensions = "";
    113118    fKeywordFile = NULL;
    114119    fLineCommentStart = fLineCommentEnd = "";
     
    121126    if (sfWordBreakTable == NULL)
    122127    {
    123128        sfWordBreakTable = (unsigned char *)HResources::GetResource(rtyp_Wbrt, rid_Wbrt_WordbreakTable);
    124         if (sfWordBreakTable == NULL) THROW(("Missing Resource!"));
     129        if (sfWordBreakTable == NULL) THROW((B_TRANSLATE("Missing Resource!")));
    125130    }
    126131
    127132    fImage = image;
    128     if (fImage < 0) THROW(("Error loading language extension: %s", strerror(fImage)));
     133    if (fImage < 0) THROW((B_TRANSLATE("Error loading language extension: %s"), strerror(fImage)));
    129134
    130135    if (get_image_symbol(fImage, "Balance", B_SYMBOL_TYPE_TEXT, (void**)&fBalance) != B_OK)
    131136        fBalance = NULL;
     
    144149    get_image_symbol(fImage, "kInterfaceVersion", B_SYMBOL_TYPE_DATA, (void**)&versionPtr);
    145150    fInterfaceVersion = versionPtr ? *versionPtr : 1;
    146151    if (fInterfaceVersion < 2) {
    147         BString err("Unsupported Language:\n");
     152        BString err(B_TRANSLATE("Unsupported Language:\n"));
    148153        err << path;
    149154        THROW((err.String()));
    150155    }
     
    207212            if (next > B_ERROR &&
    208213                (err = get_image_symbol(next, "kLanguageName", B_SYMBOL_TYPE_DATA, (void**)&l)) == B_OK)
    209214            {
    210                 if (strlen(l) > 28) THROW(("Language name too long"));
     215                if (strlen(l) > 28) THROW((B_TRANSLATE("Language name too long")));
    211216                CLanguageInterface *intf = new CLanguageInterface(plug, next);
    212217                fInterfaces.push_back(intf);
    213218
     
    573578{
    574579    char extPref[64];
    575580
    576     if (strlen(fLanguage) > 32) THROW(("Language name too long: %s", fLanguage));
     581    if (strlen(fLanguage) > 32) THROW((B_TRANSLATE("Language name too long: %s"), fLanguage));
    577582    strcpy(extPref, fLanguage);
    578583    strcat(extPref, ".ext");
    579584
     
    592597
    593598void CLanguageInterface::ChooseDefault()
    594599{
    595     const char *d = gPrefs->GetPrefString(prf_S_DefLang, "None");
     600    const char *d = gPrefs->GetPrefString(prf_S_DefLang, B_TRANSLATE("None"));
    596601    vector<CLanguageInterface*>::iterator i;
    597602
    598603    for (i = fInterfaces.begin(); i != fInterfaces.end(); i++)
     
    705710
    706711        BEntry e;
    707712        FailOSErrMsg(e.SetTo(p.String(), B_FILE_NODE),
    708                          "Settings directory was not found?");
     713                         B_TRANSLATE("Settings directory was not found?"));
    709714
    710715        BString keywords;
    711716        if (!e.Exists())
     
    723728            size_t s;
    724729            const char *r = (const char*)res.LoadResource('KeyW', fKeywordFile, &s);
    725730
    726             if (!r) THROW(("Missing resource"));
     731            if (!r) THROW((B_TRANSLATE("Missing resource")));
    727732
    728733            BFile txtfile(p.String(), B_CREATE_FILE | B_READ_WRITE);
    729734            CheckedWrite(txtfile, r, s);
  • Sources/HStream.h

     
    4040
    4141#include "HError.h"
    4242
     43#include <Catalog.h>
     44
     45#undef B_TRANSLATE_CONTEXT
     46#define B_TRANSLATE_CONTEXT "H Stream"
     47
    4348template <class S>
    4449class HStream
    4550{
     
    109114inline IMPEXP_LIBHEKKEL BPositionIO& operator>>(BPositionIO& s, D& d)
    110115{
    111116    if (s.Read(&d, sizeof(D)) != sizeof(D))
    112         throw HErr("Error reading");
     117        throw HErr(B_TRANSLATE("Error reading"));
    113118    return s;
    114119} /* operator>> */
    115120
     
    123128inline IMPEXP_LIBHEKKEL BPositionIO& operator<<(BPositionIO& s, const D& d)
    124129{
    125130    if (s.Write(&d, sizeof(D)) != sizeof(D))
    126         throw HErr("Error writing");
     131        throw HErr(B_TRANSLATE("Error writing"));
    127132    return s;
    128133} /* operator<< */
    129134
     
    132137{
    133138    int sl = strlen(string) + 1;
    134139    if (stream.Write(string, sl) != sl)
    135         throw HErr("Error writing");
     140        throw HErr(B_TRANSLATE("Error writing"));
    136141    return stream;
    137142} /* operator<< */
    138143
  • Sources/utf-support.cpp

     
    3535
    3636#include "pe.h"
    3737
     38#include <Catalog.h>
    3839#include <String.h>
    3940
    4041#include "HAppResFile.h"
     
    4243#include "ResourcesUtf.h"
    4344#include "utf-support.h"
    4445
     46#undef B_TRANSLATE_CONTEXT
     47#define B_TRANSLATE_CONTEXT "Utf Support"
     48
    4549unsigned char *alphaTable, *numTable, *alnumTable;
    4650
    4751unsigned short *mappings[11];
     
    272276int maptounicode(int charset, char ch)
    273277{
    274278    if (charset < 1 || charset > 11 || mappings[charset - 1] == NULL)
    275         THROW(("unsupported characterset: %d", charset - 1));
     279        THROW((B_TRANSLATE("unsupported characterset: %d"), charset - 1));
    276280   
    277281    return mappings[charset - 1][(int)(unsigned char)ch];
    278282} /* maptounicode */
     
    408412    if (IsSupportedEncoding(encoding))
    409413        return gEncodings[encoding];
    410414    else
    411         return "<unknown encoding>";
     415        return B_TRANSLATE("<unknown encoding>");
    412416}
    413417
    414418CTextEncodingConverter::CTextEncodingConverter()
  • Sources/CListBox.cpp

     
    3333    Created: 10/20/97 20:08:37
    3434*/
    3535
     36#include <Catalog.h>
     37
    3638#include "pe.h"
    3739#include "CListBox.h"
    3840#include "PMessages.h"
     
    4143#include "HDefines.h"
    4244#include "HDialog.h"
    4345
     46#undef B_TRANSLATE_CONTEXT
     47#define B_TRANSLATE_CONTEXT "C List Box"
     48
    4449const unsigned long
    4550    msg_LBAdd = 'lbAd',
    4651    msg_LBChange = 'lbCn',
     
    6772    float dy = 30 * gFactor;
    6873    b.bottom = b.top + 20 * gFactor;
    6974   
    70     AddChild(fAdd = new BButton(b, "add", "Add", new BMessage(msg_LBAdd)));
     75    AddChild(fAdd = new BButton(b, "add", B_TRANSLATE("Add"), new BMessage(msg_LBAdd)));
    7176    b.OffsetBy(0, dy);
    72     AddChild(fChange = new BButton(b, "change", "Change", new BMessage(msg_LBChange)));
     77    AddChild(fChange = new BButton(b, "change", B_TRANSLATE("Change"), new BMessage(msg_LBChange)));
    7378    b.OffsetBy(0, dy);
    74     AddChild(fDelete = new BButton(b, "delete", "Delete", new BMessage(msg_LBDelete)));
     79    AddChild(fDelete = new BButton(b, "delete", B_TRANSLATE("Delete"), new BMessage(msg_LBDelete)));
    7580   
    7681    fSelfChange = false;
    7782} // CListBox::CListBox
  • Sources/PGlossyWindow.cpp

     
    4545#include "HPreferences.h"
    4646#include "Prefs.h"
    4747
     48#include <Catalog.h>
     49
     50#undef B_TRANSLATE_CONTEXT
     51#define B_TRANSLATE_CONTEXT "P Glossy Window"
     52
    4853PGlossyWindow *gGlossyWindow = NULL;
    4954
    5055class PGlossyItem : public BListItem {
     
    117122
    118123PGlossyWindow::PGlossyWindow()
    119124    : BWindow(gPrefs->GetPrefRect(prf_R_GlossaryPosition, BRect(100, 100, 200, 300)),
    120         "Glossary", B_TITLED_WINDOW,
     125        B_TRANSLATE("Glossary"), B_TITLED_WINDOW,
    121126        B_WILL_ACCEPT_FIRST_CLICK | B_NOT_ZOOMABLE)
    122127{
    123128    BRect r(Bounds());
     
    248253
    249254    file >> s;
    250255   
    251     if (strncmp(s, "### ", 4)) THROW(("Invalid glossary file"));
     256    if (strncmp(s, "### ", 4)) THROW((B_TRANSLATE("Invalid glossary file")));
    252257   
    253258    file >> s;
    254259    while (*s && strncmp(s, "##", 2) == 0)
  • Sources/CMimeBox.cpp

     
    3333    Created: 10/23/97 09:38:06
    3434*/
    3535
     36#include <Catalog.h>
     37
    3638#include "pe.h"
    3739#include "CListBox.h"
    3840#include "CMimeBox.h"
     
    4345#include "HPreferences.h"
    4446#include "Prefs.h"
    4547
     48#undef B_TRANSLATE_CONTEXT
     49#define B_TRANSLATE_CONTEXT "C Mime Box"
     50
    4651const unsigned long
    4752    msg_MimeChanged = 'MChg',
    4853    msg_MimeFind = 'MFnd',
     
    156161    r.bottom = Bounds().bottom;
    157162   
    158163//  r.right -= 70;
    159     AddChild(fEdit = new BTextControl(r, "edit mime", "Mimetype:",
     164    AddChild(fEdit = new BTextControl(r, "edit mime", B_TRANSLATE("Mimetype:"),
    160165        NULL, new BMessage(msg_MimeChanged)));
    161166   
    162     fEdit->SetDivider(be_plain_font->StringWidth("Mimetype:") + 4);
     167    fEdit->SetDivider(be_plain_font->StringWidth(B_TRANSLATE("Mimetype:")) + 4);
    163168    fEdit->SetModificationMessage(new BMessage(msg_MimeChanged));
    164169   
    165170    r.left = r.right + 10;
    166171    r.right = r.left + 60;
    167172    r.top = r.bottom - 24 * gFactor;
    168     AddChild(fGet = new BButton(r, "get", "Find…", new BMessage(msg_MimeFind)));
     173    AddChild(fGet = new BButton(r, "get", B_TRANSLATE("Find…"), new BMessage(msg_MimeFind)));
    169174   
    170175    fAdd->SetEnabled(false);
    171176    fChange->SetEnabled(false);
     
    285290            {
    286291                fPanel = new BFilePanel(B_OPEN_PANEL, new BMessenger(this),
    287292                    NULL, B_FILE_NODE, true, new BMessage(msg_MimeFound));
    288                 fPanel->SetButtonLabel(B_DEFAULT_BUTTON, "Pick");
     293                fPanel->SetButtonLabel(B_DEFAULT_BUTTON, B_TRANSLATE("Pick"));
    289294                fPanel->Show();
    290295            }
    291296            break;
  • Sources/PStatus.cpp

     
    3333
    3434#include "pe.h"
    3535
     36#include <Catalog.h>
     37
    3638#include "PText.h"
    3739#include "PStatus.h"
    3840#include "Utils.h"
     
    4345#include "HError.h"
    4446#include "HDefines.h"
    4547
     48#undef B_TRANSLATE_CONTEXT
     49#define B_TRANSLATE_CONTEXT "P Status"
     50
    4651PStatus::PStatus(BRect frame, PText *txt)
    4752    : BView(frame, "status", B_FOLLOW_BOTTOM | B_FOLLOW_LEFT, B_WILL_DRAW)
    4853{
     
    135140
    136141    if (fPath)
    137142    {
    138         BPopUpMenu popup("no title");
     143        BPopUpMenu popup(B_TRANSLATE("no title"));
    139144        popup.SetFont(be_plain_font);
    140145       
    141146        char *s = strdup(fPath), *d;
  • Sources/PGroupWindow.cpp

     
    3333
    3434#include "pe.h"
    3535
     36#include <Catalog.h>
    3637#include <fs_attr.h>
    3738#include <String.h>
    3839
     
    5455#include "ResourcesToolbars.h"
    5556#include "Utils.h"
    5657
     58#undef B_TRANSLATE_CONTEXT
     59#define B_TRANSLATE_CONTEXT "P Group Window"
    5760
    5861const unsigned long msg_Done = 'done';
    5962
     
    258261    try
    259262    {
    260263        if (docText.Compare("### pe Group File\n", 18) != 0)
    261             THROW(("Not a group file!"));
     264            THROW((B_TRANSLATE("Not a group file!")));
    262265
    263266        if (!EntryRef())
    264             THROW(("Can only read local groups"));
     267            THROW((B_TRANSLATE("Can only read local groups")));
    265268
    266269        node_ref nref;
    267270        nref.device = EntryRef()->device;
     
    397400
    398401const char* PGroupWindow::DefaultName() const
    399402{
    400     return "Untitled Group";
     403    return B_TRANSLATE("Untitled Group");
    401404}
    402405
    403406PEntryItem* PGroupWindow::AddRef(entry_ref& ref)
     
    437440        }
    438441
    439442        fPanel = new BFilePanel(B_OPEN_PANEL, new BMessenger(this), &ref);
    440         fPanel->SetButtonLabel(B_DEFAULT_BUTTON, "Add");
     443        fPanel->SetButtonLabel(B_DEFAULT_BUTTON, B_TRANSLATE("Add"));
    441444        fPanel->Show();
    442445    }
    443446} /* PGroupWindow::AddFiles */
  • Sources/CGlossary.cpp

     
    3333    Created: 09/10/97 15:20:13
    3434*/
    3535
     36#include <Catalog.h>
     37
    3638#include "pe.h"
    3739#include "CGlossary.h"
    3840#include "PApp.h"
     
    4042#include "Utils.h"
    4143#include "HError.h"
    4244
     45#undef B_TRANSLATE_CONTEXT
     46#define B_TRANSLATE_CONTEXT "C Glossary"
     47
    4348CGlossary *gGlossary;
    4449
    4550CGlossary::CGlossary()
     
    180185   
    181186    fgets(s, 255, file);
    182187   
    183     if (strncmp(s, "### ", 4)) THROW(("Invalid glossary file"));
     188    if (strncmp(s, "### ", 4)) THROW((B_TRANSLATE("Invalid glossary file")));
    184189   
    185190    fgets(s, 255, file);
    186191    while (!feof(file) && strncmp(s, "##", 2) == 0)
     
    208213            else if (tolower(*kp) == 'f')
    209214                key |= strtol(kp + 1, &kp, 10) + 1 | 0x0100;
    210215            else
    211                 THROW(("Incorrect Glossary File, unrecognized keyword %s", kp));
     216                THROW((B_TRANSLATE("Incorrect Glossary File, unrecognized keyword %s"), kp));
    212217
    213218            kp = strtok(NULL, " -\n");
    214219        }
  • Sources/HDialog.h

     
    3636#ifndef HDIALOG_H
    3737#define HDIALOG_H
    3838
     39#include <Catalog.h>
     40
    3941#include "HLibHekkel.h"
    4042
    4143#include "HStream.h"
    4244#include "HAppResFile.h"
    4345#include "HPreferences.h"
    4446
     47#undef B_TRANSLATE_CONTEXT
     48#define B_TRANSLATE_CONTEXT "H Dialog"
     49
    4550struct IMPEXP_LIBHEKKEL dRect {
    4651    short left, top, right, bottom;
    4752
     
    7984{
    8085    size_t size;
    8186    const void *p = HResources::GetResource('DLOG', T::sResID, size);
    82     if (!p) throw HErr("missing resource");
     87    if (!p) throw HErr(B_TRANSLATE("missing resource"));
    8388    BMemoryIO buf(p, size);
    8489
    8590    T *d = CreateDialog(owner, buf, placement);
  • Sources/PCmd.cpp

     
    4343#include "PApp.h"
    4444#include "PErrorWindow.h"
    4545
     46#include <Catalog.h>
     47
     48#undef B_TRANSLATE_CONTEXT
     49#define B_TRANSLATE_CONTEXT "P Cmd"
     50
    4651PCmd::PCmd(const char *str, PText *txt)
    4752{
    4853    fStr = strdup(str);
     
    7277#pragma mark - Copy
    7378
    7479PCutCmd::PCutCmd(PText *txt, int append)
    75     : PCmd("Cut", txt)
     80    : PCmd(B_TRANSLATE("Cut"), txt)
    7681{
    7782    fSavedTxt = NULL;
    7883    fAnchor = txt->Anchor();
     
    112117#pragma mark -
    113118
    114119PClearCmd::PClearCmd(PText *txt)
    115     : PCmd("Clear", txt)
     120    : PCmd(B_TRANSLATE("Clear"), txt)
    116121{
    117122    fSavedTxt = NULL;
    118123    fAnchor = txt->Anchor();
     
    151156#pragma mark -
    152157
    153158PPasteCmd::PPasteCmd(PText *txt)
    154     : PCmd("Paste", txt)
     159    : PCmd(B_TRANSLATE("Paste"), txt)
    155160{
    156161    fSavedTxt = NULL;
    157162} /* PPasteCmd::PPasteCmd */
     
    214219
    215220#pragma mark --- Typing Command ---
    216221PTypingCmd::PTypingCmd(PText *txt)
    217     : PCmd("Typing", txt)
     222    : PCmd(B_TRANSLATE("Typing"), txt)
    218223{
    219224} /* PTypingCmd::PTypingCmd */
    220225
     
    353358#pragma mark --- Drop Command ---
    354359
    355360PDropCmd::PDropCmd(PText *txt, const char *data, ssize_t dataLen, int srcLoc, int dstLoc)
    356     : PCmd("Drop", txt)
     361    : PCmd(B_TRANSLATE("Drop"), txt)
    357362{
    358363    fData = (char *)malloc(fDataLen = dataLen);
    359364    FailNil(fData);
     
    518523#pragma mark --- PReplaceCmd
    519524
    520525PReplaceCmd::PReplaceCmd(PText *txt, int offset, int size, bool findNext, bool backward)
    521     : PCmd("Replace", txt)
     526    : PCmd(B_TRANSLATE("Replace"), txt)
    522527{
    523528    fOffset = offset;
    524529    fSize = size;
     
    593598#pragma mark --- PReplaceAllCmd
    594599
    595600PReplaceAllCmd::PReplaceAllCmd(PText *txt)
    596     : PCmd("Replace All", txt)
     601    : PCmd(B_TRANSLATE("Replace All"), txt)
    597602{
    598603    fFind = strdup(gFindDialog->FindString());
    599604    fRepl = strdup(gFindDialog->ReplaceString());
     
    706711    kBufferSize = 1024;
    707712
    708713PScriptCmd::PScriptCmd(PText *txt, const char *script)
    709     : PCmd("Script", txt)
     714    : PCmd(B_TRANSLATE("Script"), txt)
    710715{
    711716    char buf[PATH_MAX];
    712717   
     
    958963} /* PShiftCmd::LastLine */
    959964
    960965PShiftLeftCmd::PShiftLeftCmd(PText *txt)
    961     : PShiftCmd("Shift Left", txt)
     966    : PShiftCmd(B_TRANSLATE("Shift Left"), txt)
    962967{
    963968    // count the involved hard lines
    964969    int firstLine = FirstLine();
     
    10611066
    10621067
    10631068PShiftRightCmd::PShiftRightCmd(PText *txt)
    1064     : PShiftCmd("Shift Right", txt)
     1069    : PShiftCmd(B_TRANSLATE("Shift Right"), txt)
    10651070{
    10661071} /* PShiftRightCmd::PShiftRightCmd */
    10671072
     
    11121117#pragma mark --- Twiddle Command ---
    11131118
    11141119PTwiddleCmd::PTwiddleCmd(PText *txt)
    1115     : PCmd("Twiddle", txt)
     1120    : PCmd(B_TRANSLATE("Twiddle"), txt)
    11161121{
    11171122    fFrom = std::min(fText->Caret(), fText->Anchor());
    11181123    fTo = std::max(fText->Caret(), fText->Anchor());
     
    11831188
    11841189PCommentCmd::PCommentCmd(PText *txt, bool comment,
    11851190            const char *before, const char *after)
    1186     : PCmd(comment ? "Comment" : "Uncomment", txt)
     1191    : PCmd(comment ? B_TRANSLATE("Comment") : B_TRANSLATE("Uncomment"), txt)
    11871192{
    11881193    fComment = comment;
    11891194   
    11901195    fFrom = std::min(fText->Caret(), fText->Anchor());
    11911196    fTo = std::max(fText->Caret(), fText->Anchor());
    11921197   
    1193     if (strlen(before) > 7 || strlen(after) > 7) THROW(("comment strings too long"));
     1198    if (strlen(before) > 7 || strlen(after) > 7) THROW((B_TRANSLATE("comment strings too long")));
    11941199   
    11951200    strcpy(fBefore, before);
    11961201    strcpy(fAfter, after);
     
    13181323#pragma mark --- Wrap Command ---
    13191324
    13201325PWrapCmd::PWrapCmd(PText *txt)
    1321     : PCmd("Wrap", txt)
     1326    : PCmd(B_TRANSLATE("Wrap"), txt)
    13221327{
    13231328    fCaret = txt->Caret();
    13241329    fAnchor = txt->Anchor();
     
    13581363#pragma mark --- Unwrap Command ---
    13591364
    13601365PUnwrapCmd::PUnwrapCmd(PText *txt)
    1361     : PCmd("Unwrap", txt)
     1366    : PCmd(B_TRANSLATE("Unwrap"), txt)
    13621367{
    13631368    fCaret = txt->Caret();
    13641369    fAnchor = txt->Anchor();
     
    14051410#pragma mark --- Justify Command ---
    14061411
    14071412PJustifyCmd::PJustifyCmd(PText *txt)
    1408     : PCmd("Justify", txt)
     1413    : PCmd(B_TRANSLATE("Justify"), txt)
    14091414{
    14101415} /* PJustifyCmd::PJustifyCmd */
    14111416
     
    14841489#pragma mark --- Change Case Command ---
    14851490
    14861491PChangeCaseCmd::PChangeCaseCmd(PText *txt, int newCase)
    1487     : PCmd("Change Case", txt)
     1492    : PCmd(B_TRANSLATE("Change Case"), txt)
    14881493{
    14891494    fText->GetSelectedText(fSavedText);
    14901495   
     
    16031608#pragma mark --- Change Encoding Command ---
    16041609
    16051610PEncodingCmd::PEncodingCmd(PText *txt, int from, int to)
    1606     : PCmd("Change Encoding", txt)
     1611    : PCmd(B_TRANSLATE("Change Encoding"), txt)
    16071612{
    16081613    fSourceEncoding = from;
    16091614    fDestEncoding = to;
  • Sources/CDocIO.cpp

     
    66
    77#include "pe.h"
    88
     9#include <Catalog.h>
    910#include <NodeMonitor.h>
    1011#include <fs_attr.h>
    1112#include <String.h>
     
    1819#include "MAlert.h"
    1920#include "Prefs.h"
    2021
     22#undef B_TRANSLATE_CONTEXT
     23#define B_TRANSLATE_CONTEXT "C Doc IO"
     24
    2125static void ConvertLinebreaks(BString& str, int fromType, int toType)
    2226{
    2327    const char* lbStr[] = {
     
    347351    {
    348352        BString err;
    349353        if (fDoc->Encoding() != B_UNICODE_UTF8)
    350             err = BString("An error occurred when converting the document ")
    351                     << "from its native encoding to UTF-8. The first "
    352                     << "problematic character is highlighted.\n"
    353                     << "Please use the 'File Options'-dialog to select "
    354                     << "the correct source encoding.";
     354            err = BString(B_TRANSLATE("An error occurred when "
     355              "converting the document from its native encoding "
     356              "to UTF-8. The first problematic character is "
     357              "highlighted.\nPlease use the 'File Options'-dialog "
     358              "to select the correct source encoding."));
     359
    355360        else
    356             err = BString("An error occurred when checking the document's ")
    357                     << "UTF-8 encoding. The first problematic character is "
    358                     << "highlighted.\n"
    359                     << "Please use the 'File Options'-dialog to select "
    360                     << "the correct source encoding.";
     361            err = BString(B_TRANSLATE("An error occurred when "
     362              "checking the document's UTF-8 encoding. The first "
     363              "problematic character is highlighted.\nPlease use "
     364              "the 'File Options'-dialog to select the correct "
     365              "source encoding."));
    361366        fDoc->SetErrorMsg(err.String());
    362367        return false;
    363368    }
     
    381386        {
    382387            fDoc->HighlightErrorPos(fConv.ErrorPos());
    383388            BString err =
    384                 BString("An error occurred when converting the document ")
    385                     << "to the requested destination encoding. The first "
    386                     << "problematic character is highlighted.\n"
    387                     << "Please use the 'File Options'-dialog to select "
    388                     << "another destination encoding.";
    389             MInfoAlert a(err.String(), "I See");
     389                BString(B_TRANSLATE("An error occurred when "
     390                  "converting the document to the requested "
     391                  "destination encoding. The first problematic"
     392                  " character is highlighted.\nPlease use the "
     393                  "'File Options'-dialog to select another "
     394                  "destination encoding."));
     395            MInfoAlert a(err.String(), B_TRANSLATE("I See"));
    390396            a.Go();
    391397            return false;
    392398        }
     
    463469        int bytesRead = file.Read(buf, size);
    464470        docText.UnlockBuffer(size);
    465471        if (bytesRead < size)
    466             THROW(("A read error occurred: %s", strerror(errno)));
     472            THROW((B_TRANSLATE("A read error occurred: %s"),
     473                   strerror(errno)));
    467474    }
    468475
    469476    if (readAttributes)
     
    742749                && _HasFileContentsChanged(file))
    743750            {
    744751                char s[PATH_MAX + 20];
    745                 sprintf(s, "File %s was modified by another application, reload it?", fEntryRef->name);
    746                 MInfoAlert a(s, "Reload", "Cancel");
     752                sprintf(s, B_TRANSLATE("File %s was modified "
     753                  "by another application, reload it?"),
     754                  fEntryRef->name);
     755                MInfoAlert a(s, B_TRANSLATE("Reload"),
     756                         B_TRANSLATE("Cancel"));
    747757
    748758                if (a.Go() == 1)
    749759                {
     
    876886    int sz = ftp.ReadAt(0, buf, size);
    877887    docText.UnlockBuffer(size);
    878888    if (sz < size)
    879         THROW(("A read error occurred: %s", strerror(errno)));
     889        THROW((B_TRANSLATE("A read error occurred: %s"),
     890               strerror(errno)));
    880891
    881892    if (readAttributes)
    882893    {
  • Sources/HAppResFile.cpp

     
    3333    Created: 02-06-02
    3434*/
    3535
     36#include <Catalog.h>
     37
    3638#include "pe.h"
    3739#include "HAppResFile.h"
    3840#include "HError.h"
    3941#include "HStream.h"
    4042#include "ResourcesMenus.h"
    4143
     44#undef B_TRANSLATE_CONTEXT
     45#define B_TRANSLATE_CONTEXT "H App Res File"
     46
    4247using namespace HResources;
    4348
    4449BResources *gAppResFile = NULL;
     
    7681{
    7782    size_t size;
    7883    const char *m = (char *)GetResource(rtyp_Menu, id, size);
    79     if (!m) throw HErr("Could not find resource!");
     84    if (!m) throw HErr(B_TRANSLATE("Could not find resource!"));
    8085   
    8186    BMemoryIO buf(m, size);
    8287    BPositionIO& data = buf;
  • Sources/HDialog.cpp

     
    3535
    3636#include "pe.h"
    3737
     38#include <Catalog.h>
    3839#include <Slider.h>
    3940
    4041#include "HDialog.h"
     
    4647#include "HError.h"
    4748#include "MAlert.h"
    4849
     50#undef B_TRANSLATE_CONTEXT
     51#define B_TRANSLATE_CONTEXT "H Dialog"
     52
    4953const unsigned long
    5054    msg_AddDialog       = 'ADlg',
    5155    msg_RemoveDialog    = 'RDlg';
     
    358362
    359363    if (isnan(d))
    360364    {
    361         MWarningAlert a("Invalid number entered");
     365        MWarningAlert a(B_TRANSLATE("Invalid number entered"));
    362366        a.Go();
    363367        FindView(name)->MakeFocus(true);
    364368        return false;
     
    510514            if (sFieldMap && sFieldMap->find(kind) != sFieldMap->end())
    511515                (*sFieldMap)[kind](kind, data, inside);
    512516            else
    513                 throw HErr("Unknown type for dialog item (%4.4s)", &kind);
     517                throw HErr(B_TRANSLATE("Unknown type for dialog item (%4.4s)"), &kind);
    514518        }
    515519    }
    516520} /* HDialog::CreateField */
     
    544548int HDialog::GetValue(const char *id) const
    545549{
    546550    BView *v = FindView(id);
    547     if (v == NULL) THROW(("View '%s' not found", id));
     551    if (v == NULL) THROW((B_TRANSLATE("View '%s' not found"), id));
    548552
    549553        // according to stroustrup I shouldn't do this:
    550554
     
    558562    else if (typeid(*v) == typeid(BSlider))
    559563        return static_cast<BSlider*>(v)->Value();
    560564
    561     THROW(("view '%s' not of valid type", id));
     565    THROW((B_TRANSLATE("view '%s' not of valid type"), id));
    562566    return 0;
    563567} // HDialog::GetValue
    564568
    565569void HDialog::SetValue(const char *id, int value)
    566570{
    567571    BView *v = FindView(id);
    568     if (v == NULL) THROW(("View '%s' not found", id));
     572    if (v == NULL) THROW((B_TRANSLATE("View '%s' not found"), id));
    569573
    570574    if (typeid(*v) == typeid(BMenuField))
    571575    {
     
    588592        return;
    589593    }
    590594
    591     THROW(("view '%s' not found", id));
     595    THROW((B_TRANSLATE("view '%s' not found"), id));
    592596} // HDialog::SetValue
    593597
    594598void HDialog::SetLabel(const char *id, const char *label)
     
    597601    if (control)
    598602        control->SetLabel(label);
    599603    else
    600         THROW(("Control '%s' not found", id));
     604        THROW((B_TRANSLATE("Control '%s' not found"), id));
    601605} // HDialog::SetLabel
    602606
    603607filter_result HDialog::KeyDownFilter(BMessage* msg, BHandler**,
  • Sources/CDoc.cpp

     
    3535
    3636#include "pe.h"
    3737
     38#include <Catalog.h>
    3839#include <String.h>
    3940
    4041#include "CDoc.h"
     
    4748#include "PMessages.h"
    4849#include "Prefs.h"
    4950
     51#undef B_TRANSLATE_CONTEXT
     52#define B_TRANSLATE_CONTEXT "C Doc"
     53
    5054doclist CDoc::sfDocList;
    5155vector<char*> CDoc::sfTenLastDocs;
    5256
     
    126130void CDoc::Read(bool readAttributes)
    127131{
    128132    if (!fDocIO)
    129         THROW(("No file available"));
     133        THROW((B_TRANSLATE("No file available")));
    130134
    131135    fDocIO->ReadDoc(readAttributes);
    132136}
     
    136140    try
    137141    {
    138142        if (!fDocIO)
    139             THROW(("No file available"));
     143            THROW((B_TRANSLATE("No file available")));
    140144        // Only save directly if the file is writable and if we already
    141145        // have a place (entry) for the file
    142146        if (!fReadOnly && (!fDocIO->IsLocal() || EntryRef()))
     
    171175    w->Lock();
    172176
    173177    char s[256];
    174     sprintf(s, "Save %s as:", Name());
     178    sprintf(s, B_TRANSLATE("Save %s as:"), Name());
    175179
    176180    w->SetTitle(s);
    177181    fSavePanel->SetSaveText(Name());
     
    270274    w->Lock();
    271275
    272276    char s[256];
    273     sprintf(s, "Save a copy of %s as:", Name());
     277    sprintf(s, B_TRANSLATE("Save a copy of %s as:"), Name());
    274278
    275279    w->SetTitle(s);
    276280    fSavePanel->SetSaveText(Name());
     
    336340void CDoc::Revert()
    337341{
    338342    char title[256];
    339     sprintf(title, "Revert to the last saved version of %s?", Name());
     343    sprintf(title, B_TRANSLATE("Revert to the last saved version of %s?"),
     344        Name());
    340345
    341     MInfoAlert a(title, "Cancel", "OK");
     346    MInfoAlert a(title, B_TRANSLATE("Cancel"), B_TRANSLATE("OK"));
    342347    if (a == 2)
    343348    {
    344349        Read();
     
    350355{
    351356    if ((readOnly && fDirty) || !EntryRef())
    352357    {
    353         MWarningAlert a("You have to save the file first before marking it read-only");
     358        MWarningAlert a(B_TRANSLATE("You have to save the file first before marking it read-only"));
    354359        a.Go();
    355360    }
    356361    else
     
    402407
    403408const char* CDoc::DefaultName() const
    404409{
    405     return "Untitled";
     410    return B_TRANSLATE("Untitled");
    406411}
    407412
    408413const char* CDoc::Name() const
  • Sources/CUrlOpener.cpp

     
    3333    Created: 04/26/98 21:16:08
    3434*/
    3535
     36#include <Catalog.h>
     37
    3638#include "pe.h"
    3739#include "PApp.h"
    3840#include "CUrlOpener.h"
     
    4042#include "CFtpStream.h"
    4143#include "PDoc.h"
    4244
     45#undef B_TRANSLATE_CONTEXT
     46#define B_TRANSLATE_CONTEXT "C Url Opener"
     47
    4348CUrlOpener::CUrlOpener(const char *url)
    4449    : fURL(url)
    4550{
     
    6267        URLData& url = fURL;
    6368       
    6469        if (! url.IsValid())
    65             THROW(("Url \"ftp:://%s/%s/%s\" is not valid", fURL.Server(), fURL.Path(), fURL.File()));
     70            THROW((B_TRANSLATE("Url \"ftp:://%s/%s/%s\" is not valid"), fURL.Server(), fURL.Path(), fURL.File()));
    6671       
    6772        bool ok;
    6873
  • Sources/CStdErrBox.cpp

     
    3333    Created: 02/22/98 22:12:11
    3434*/
    3535
     36#include <Catalog.h>
     37
    3638#include "pe.h"
    3739#include "CListBox.h"
    3840#include "CStdErrBox.h"
     
    4244#include "HPreferences.h"
    4345#include "Prefs.h"
    4446
     47#undef B_TRANSLATE_CONTEXT
     48#define B_TRANSLATE_CONTEXT "C Std Err Box"
     49
    4550const unsigned long
    4651    msg_ChangedPattern = 'ECnm';
    4752
     
    108113   
    109114    BTextControl *t;
    110115
    111     AddChild(t = new BTextControl(r, "SEpt", "Pattern:",
     116    AddChild(t = new BTextControl(r, "SEpt", B_TRANSLATE("Pattern:"),
    112117        NULL, new BMessage(msg_ChangedPattern)));
    113118   
    114119    t->SetDivider(40 * gFactor);
     
    117122    r.OffsetBy(0, 20 * gFactor);
    118123    r.right = r.left + r.Width() / 2 - 10 * gFactor;
    119124
    120     AddChild(t = new BTextControl(r, "SEfl", "File:",
     125    AddChild(t = new BTextControl(r, "SEfl", B_TRANSLATE("File:"),
    121126        NULL, new BMessage(msg_ChangedPattern)));
    122127   
    123128    t->SetDivider(40 * gFactor);
     
    125130   
    126131    r.OffsetBy(0, 20 * gFactor);
    127132
    128     AddChild(t = new BTextControl(r, "SEln", "Line:",
     133    AddChild(t = new BTextControl(r, "SEln", B_TRANSLATE("Line:"),
    129134        NULL, new BMessage(msg_ChangedPattern)));
    130135   
    131136    t->SetDivider(40 * gFactor);
     
    134139    r.OffsetBy(r.Width() + 10 * gFactor, -20 * gFactor);
    135140    r.right += 10 * gFactor;
    136141
    137     AddChild(t = new BTextControl(r, "SEms", "Message:",
     142    AddChild(t = new BTextControl(r, "SEms", B_TRANSLATE("Message:"),
    138143        NULL, new BMessage(msg_ChangedPattern)));
    139144   
    140145    t->SetDivider(50 * gFactor);
     
    142147   
    143148    r.OffsetBy(0, 20 * gFactor);
    144149
    145     AddChild(t = new BTextControl(r, "SEwa", "Warning:",
     150    AddChild(t = new BTextControl(r, "SEwa", B_TRANSLATE("Warning:"),
    146151        NULL, new BMessage(msg_ChangedPattern)));
    147152   
    148153    t->SetDivider(50 * gFactor);
  • Sources/Jamfile

     
    33
    44SubDirHdrs $(OBJECTS_DIR) Sources ;
    55
     6AddResources Pe : Pe.rdef ;
     7
    68if $(OSPLAT) = X86 {
    79    C++FLAGS += -Wno-sign-compare -Wno-overloaded-virtual ;
    810} else {
     
    111113    utf-support.cpp
    112114    Utils.cpp
    113115    :   libhekkel.so pcre be $(STDC++LIB) tracker mail textencoding
     116    $(HAIKU_LOCALE_LIBS)
    114117    ;
    115118#   </pe-src>
    116119if $(OSPLAT) = X86 {
     
    143146Rez Pe : [ FDirName $(TOP) Resources Now.r ] ;
    144147
    145148MimeSet Pe ;
     149
     150DoCatalogs Pe :
     151  x-vnd.Haiku-Pe
     152  :
     153  CDiffWindow.cpp
     154  CDoc.cpp
     155  CDocWindow.cpp
     156  CFilterChoiceDialog.cpp
     157  CFindDialog.cpp
     158  CFtpDialog.cpp
     159  CFtpStream.cpp
     160  CGlossary.cpp
     161  CGoToLine.cpp
     162  CGrepBox.cpp
     163  CHtmlBar.cpp
     164  CInfoDialog.cpp
     165  CKeyMapper.cpp
     166  CLanguageAddOn.cpp
     167  CLanguageInterface.cpp
     168  CListBox.cpp
     169  CMimeBox.cpp
     170  CPathsBox.cpp
     171  CPrefsDialog.cpp
     172  CRegex.cpp
     173  CStdErrBox.cpp
     174  CUrlOpener.cpp
     175  HAppResFile.cpp
     176  HDialog.cpp
     177  HDialog.h
     178  HError.cpp
     179  HError.h
     180  HLazyObject.cpp
     181  HPreferences.cpp
     182  HStream.h
     183  MAlert.cpp
     184  PAbout.cpp
     185  PApp.cpp
     186  PCmd.cpp
     187  PDoc.cpp
     188  PGlossyWindow.cpp
     189  PGroupWindow.cpp
     190  PItalicMenuItem.cpp
     191  PMessageWindow.cpp
     192  PProjectWindow.cpp
     193  PStatus.cpp
     194  PText.cpp
     195  PTextBuffer.cpp
     196  utf-support.cpp
     197  Utils.cpp
     198;
  • Sources/HError.cpp

     
    3434*/
    3535
    3636#include "pe.h"
     37
     38#include <Catalog.h>
     39
    3740#include <stdarg.h>
    3841#include "HError.h"
    3942#include "MAlert.h"
    4043
     44#undef B_TRANSLATE_CONTEXT
     45#define B_TRANSLATE_CONTEXT "H Error"
     46
    4147HErr::HErr()
    4248{
    4349} /* HErr::HErr */
     
    4854    fMessage[0] = 0;
    4955   
    5056    if (err == 0)
    51         strcpy(fMessage, "No Error");
     57        strcpy(fMessage, B_TRANSLATE("No Error"));
    5258    else if (err < 0)
    5359        strcpy(fMessage, strerror(err));
    5460    else
    55         sprintf(fMessage, "An unknown error occured (nr: %d)", err);
     61        sprintf(fMessage, B_TRANSLATE("An unknown error occured (nr: %d)"), err);
    5662
    5763//#if DEBUG
    5864//  if (err)
  • Sources/CGrepBox.cpp

     
    3333    Created: 02/22/98 22:12:11
    3434*/
    3535
     36#include <Catalog.h>
     37
    3638#include "pe.h"
    3739#include "CListBox.h"
    3840#include "CGrepBox.h"
     
    4143#include "HDialog.h"
    4244#include "Prefs.h"
    4345
     46#undef B_TRANSLATE_CONTEXT
     47#define B_TRANSLATE_CONTEXT "C Grep Box"
     48
    4449const unsigned long
    4550    msg_ChangedPattern = 'GCnm';
    4651
     
    8994    r.top = r.bottom + 10 * gFactor;
    9095    r.bottom = r.top + 16 * gFactor;
    9196   
    92     AddChild(fName = new BTextControl(r, "edit mime", "Name:",
     97    AddChild(fName = new BTextControl(r, "edit mime", B_TRANSLATE("Name:"),
    9398        NULL, new BMessage(msg_ChangedPattern)));
    9499   
    95100    fName->SetDivider(40 * gFactor);
     
    97102   
    98103    r.OffsetBy(0, 20 * gFactor);
    99104
    100     AddChild(fFind = new BTextControl(r, "edit mime", "Find:",
     105    AddChild(fFind = new BTextControl(r, "edit mime", B_TRANSLATE("Find:"),
    101106        NULL, new BMessage(msg_ChangedPattern)));
    102107   
    103108    fFind->SetDivider(40 * gFactor);
     
    105110   
    106111    r.OffsetBy(0, 20 * gFactor);
    107112
    108     AddChild(fReplace = new BTextControl(r, "edit mime", "Replace:",
     113    AddChild(fReplace = new BTextControl(r, "edit mime", B_TRANSLATE("Replace:"),
    109114        NULL, new BMessage(msg_ChangedPattern)));
    110115   
    111116    fReplace->SetDivider(40 * gFactor);
  • Sources/CFilterChoiceDialog.cpp

     
    1010
    1111#include <Application.h>
    1212#include <Beep.h>
     13#include <Catalog.h>
    1314#include <ListItem.h>
    1415#include <ListView.h>
    1516#include <Screen.h>
     
    2324#include "KeyBindings.h"
    2425#include "Prefs.h"
    2526
     27#undef B_TRANSLATE_CONTEXT
     28#define B_TRANSLATE_CONTEXT "C Filter Choice Dialog"
     29
    2630// internal messages
    2731enum {
    2832    MSG_COMMIT_REQUEST  = 'fico',
     
    407411    FailNil(message);
    408412    BRect rect(bounds);
    409413    fFilterStringControl = new(std::nothrow) BTextControl(rect, "filter text",
    410         "Filter", "", message,
     414        B_TRANSLATE("Filter"), "", message,
    411415        B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP, B_WILL_DRAW);
    412416    FailNil(fFilterStringControl);
    413417    fMainView->AddChild(fFilterStringControl);
    414418    BFont labelFont;
    415419    fFilterStringControl->GetFont(&labelFont);
    416     fFilterStringControl->SetDivider(labelFont.StringWidth("Filter#"));
     420    fFilterStringControl->SetDivider(labelFont.StringWidth(B_TRANSLATE("Filter#")));
    417421    message = new BMessage(MSG_FILTER_MODIFIED);
    418422    FailNil(message);
    419423    fFilterStringControl->SetModificationMessage(message);
  • Sources/CDocWindow.cpp

     
    3535
    3636#include <algorithm>
    3737
     38#include <Catalog.h>
    3839#include <NodeMonitor.h>
    3940#include <fs_attr.h>
    4041#include <String.h>
     
    4849#include "PMessages.h"
    4950#include "Prefs.h"
    5051
     52#undef B_TRANSLATE_CONTEXT
     53#define B_TRANSLATE_CONTEXT "C Doc Window"
    5154
    5255int CDocWindow::sfNewCount = -1;
    5356
    5457CDocWindow::CDocWindow(const entry_ref *doc)
    55     : inheritedWindow(BRect(0,0,0,0), doc ? doc->name : "Untitled", B_DOCUMENT_WINDOW,
    56                             B_ASYNCHRONOUS_CONTROLS)
     58    : inheritedWindow(BRect(0,0,0,0), doc ? doc->name :
     59    B_TRANSLATE("Untitled"), B_DOCUMENT_WINDOW, B_ASYNCHRONOUS_CONTROLS)
    5760    , inheritedDoc("", this, doc)
    5861    , fCloseWinAfterSave(false)
    5962    , fCloseAppAfterSave(false)
     
    155158    if (IsDirty())
    156159    {
    157160        char title[256];
    158         sprintf(title, "Save changes to '%s' before closing?", inheritedDoc::Name());
     161        sprintf(title, B_TRANSLATE("Save changes to '%s' before "
     162          "closing?"), inheritedDoc::Name());
    159163
    160164        if (IsMinimized())
    161165            Minimize(false);
     
    163167
    164168        UnlockLooper();
    165169
    166         MInfoAlert alert(title, "Save", "Cancel", "Don't save");
     170        MInfoAlert alert(title, B_TRANSLATE("Save"),
     171                 B_TRANSLATE("Cancel"),
     172                 B_TRANSLATE("Don't save"));
    167173
    168174        int32 alertResult = alert.Go();
    169175
     
    237243    // now that the window is shown, we might have to show any error alongside
    238244    // it that may have ocurred during load (conversion failure):
    239245    if (HadError()) {
    240         MInfoAlert a(ErrorMsg(), "I See");
     246        MInfoAlert a(ErrorMsg(), B_TRANSLATE("I See"));
    241247        a.Go();
    242248        ClearErrorMsg();
    243249    }
  • Sources/CKeyMapper.cpp

     
    3333    Created: 10/07/97 21:53:17
    3434*/
    3535
     36#include <Catalog.h>
     37
    3638#include "pe.h"
    3739
    3840#include "HStream.h"
     
    4648#include "ResourcesBindings.h"
    4749#include "ResourcesUtf.h"
    4850
     51#undef B_TRANSLATE_CONTEXT
     52#define B_TRANSLATE_CONTEXT "C Key Mapper"
     53
    4954CKeyMapper* CKeyMapper::sfInstance = NULL;
    5055
    5156void CKeyMapper::Init()
     
    156161void CKeyMapper::ReadKeymap(keymap& kmap)
    157162{
    158163    static sem_id kmsem = create_sem(1, "reading keymap");
    159     if (kmsem < 0) THROW(("Error creating semaphore"));
     164    if (kmsem < 0) THROW((B_TRANSLATE("Error creating semaphore")));
    160165   
    161166    FailOSErr(acquire_sem(kmsem));
    162167
     
    209214        b << cnt;
    210215       
    211216        if (file.Write(b.Buffer(), b.BufferLength()) != b.BufferLength())
    212             THROW(("Error writing keybindings"));
     217            THROW((B_TRANSLATE("Error writing keybindings")));
    213218    }
    214219    else
    215220        FailOSErr(file.SetTo(&gPrefsDir, "keybindings", B_READ_ONLY));
     
    224229    {
    225230        cnt = __swap_int32(cnt);
    226231        if (cnt != size / (sizeof(long) * 3))
    227             THROW(("Invalid keybinding file!"));
     232            THROW((B_TRANSLATE("Invalid keybinding file!")));
    228233       
    229234        while (cnt--)
    230235        {
  • Sources/CFindDialog.cpp

     
    364364} // CFindDialog::Create
    365365
    366366void CFindDialog::Layout(void) {
    367     fButFind    ->ResizeLocalized("Find");
    368     fButRepl    ->ResizeLocalized("Replace");
    369     fButRepF    ->ResizeLocalized("Replace & Find");
    370     fButRepA    ->ResizeLocalized("Replace All");
    371     fMfdPats    ->ResizeLocalized(NULL, "Find:");
    372     fLabRepl    ->ResizeLocalized("Replace:");
    373     fChkCase    ->ResizeLocalized("Ignore Case");
    374     fChkWrap    ->ResizeLocalized("Wrap Around");
    375     fChkBack    ->ResizeLocalized("Backwards");
    376     fChkWord    ->ResizeLocalized("Entire Word");
    377     fChkGrep    ->ResizeLocalized("Regex");
    378     fChkBtch    ->ResizeLocalized("Batch");
    379     fChkMult    ->ResizeLocalized("Multi-File:");
     367    fButFind    ->ResizeLocalized(B_TRANSLATE("Find"));
     368    fButRepl    ->ResizeLocalized(B_TRANSLATE("Replace"));
     369    fButRepF    ->ResizeLocalized(B_TRANSLATE("Replace & Find"));
     370    fButRepA    ->ResizeLocalized(B_TRANSLATE("Replace All"));
     371    fMfdPats    ->ResizeLocalized(NULL, B_TRANSLATE("Find:"));
     372    fLabRepl    ->ResizeLocalized(B_TRANSLATE("Replace:"));
     373    fChkCase    ->ResizeLocalized(B_TRANSLATE("Ignore Case"));
     374    fChkWrap    ->ResizeLocalized(B_TRANSLATE("Wrap Around"));
     375    fChkBack    ->ResizeLocalized(B_TRANSLATE("Backwards"));
     376    fChkWord    ->ResizeLocalized(B_TRANSLATE("Entire Word"));
     377    fChkGrep    ->ResizeLocalized(B_TRANSLATE("Regex"));
     378    fChkBtch    ->ResizeLocalized(B_TRANSLATE("Batch"));
     379    fChkMult    ->ResizeLocalized(B_TRANSLATE("Multi-File:"));
    380380    fMfdMeth    ->ResizeLocalized();
    381     fMitMethDir ->SetLabel("Directory Scan");
    382     fMitMethWin ->SetLabel("Open Windows");
     381    fMitMethDir ->SetLabel(B_TRANSLATE("Directory Scan"));
     382    fMitMethWin ->SetLabel(B_TRANSLATE("Open Windows"));
    383383    fMitMethInc ->SetLabel("$BEINCLUDES");
    384     fChkText    ->ResizeLocalized("Text Files Only");
    385     fChkRecu    ->ResizeLocalized("Recursive");
    386     fMfdSdir    ->ResizeLocalized("Search In:");
    387     fMitSdirOth ->SetLabel("Other…");
    388     fMfdNamp    ->ResizeLocalized("File Name:");
    389     fMitNampAny ->SetLabel("Any");
    390     fMitNampEnd ->SetLabel("Ends with");
    391     fMitNampBeg ->SetLabel("Begins with");
    392     fMitNampCon ->SetLabel("Contains");
     384    fChkText    ->ResizeLocalized(B_TRANSLATE("Text Files Only"));
     385    fChkRecu    ->ResizeLocalized(B_TRANSLATE("Recursive"));
     386    fMfdSdir    ->ResizeLocalized(B_TRANSLATE("Search In:"));
     387    fMitSdirOth ->SetLabel(B_TRANSLATE("Other…"));
     388    fMfdNamp    ->ResizeLocalized(B_TRANSLATE("File Name:"));
     389    fMitNampAny ->SetLabel(B_TRANSLATE("Any"));
     390    fMitNampEnd ->SetLabel(B_TRANSLATE("Ends with"));
     391    fMitNampBeg ->SetLabel(B_TRANSLATE("Begins with"));
     392    fMitNampCon ->SetLabel(B_TRANSLATE("Contains"));
    393393    fEdiName    ->ResizeLocalized();
    394394
    395395    // Hack: Somehow the Label isn't set (SetLabelFromMarked()) if we don't do this
     
    529529
    530530                if (cmd == msg_ReplaceAll)
    531531                {
    532                     switch (MAlert("Replace All on multiple files", "Cancel", "Leave Open", "Save To Disk").Go())
     532                    switch (MAlert(
     533                      B_TRANSLATE("Replace All on multiple"
     534                      " files"), B_TRANSLATE("Cancel"),
     535                      B_TRANSLATE("Leave Open"),
     536                      B_TRANSLATE("Save To Disk")).Go())
    533537                    {
    534538                        case 1: return;
    535539                        case 2: all = mrLeaveOpen; break;
     
    10211025        fDirNameStack.push(strdup(dir));
    10221026    }
    10231027
    1024     if (!fCurrentDir) THROW(("Directory not found: %s", dir));
     1028    if (!fCurrentDir) THROW((B_TRANSLATE("Directory not found: %s"), dir));
    10251029
    10261030    struct dirent *dent;
    10271031    struct stat stbuf;
     
    13011305        if (w && *w)
    13021306            m = static_cast<PMessageWindow*>(*w);
    13031307        else
    1304             m = new PMessageWindow("Search Results");
     1308            m = new PMessageWindow(B_TRANSLATE("Search Results"));
    13051309
    13061310        BAutolock lock(m);
    13071311
  • Sources/CGoToLine.cpp

     
    3333    Created: 10/10/97 20:44:22
    3434*/
    3535
     36#include <Catalog.h>
     37
    3638#include "pe.h"
    3739#include "PDoc.h"
    3840#include "PText.h"
    3941#include "CGoToLine.h"
    4042#include "PMessages.h"
    4143
     44#undef B_TRANSLATE_CONTEXT
     45#define B_TRANSLATE_CONTEXT "C Go To Line"
     46
    4247CGoToLine::CGoToLine(BRect frame, const char *name, window_type type, int flags,
    4348    BWindow *owner)
    4449    : HDialog(frame, name, type, flags | B_NOT_RESIZABLE, owner)
     
    7782
    7883void CGoToLine::Layout(void)
    7984{
    80     fLine->ResizeLocalized("Line:");
    81     fCancelButton->ResizeLocalized("Cancel");
    82     fOkButton->ResizeLocalized("Ok");
     85    fLine->ResizeLocalized(B_TRANSLATE("Line:"));
     86    fCancelButton->ResizeLocalized(B_TRANSLATE("Cancel"));
     87    fOkButton->ResizeLocalized(B_TRANSLATE("Ok"));
    8388
    84     float div = fLine->StringWidth("Line:")+20;
     89    float div = fLine->StringWidth(B_TRANSLATE("Line:"))+20;
    8590    fLine->SetDivider(div);
    8691    fLine->SetWidth(div+fLine->TextView()->StringWidth("1234567")+10);
    8792
  • Sources/CPathsBox.cpp

     
    3333    Created: 10/20/97 21:53:02
    3434*/
    3535
     36#include <Catalog.h>
     37
    3638#include "pe.h"
    3739#include "CListBox.h"
    3840#include "CPathsBox.h"
     
    4345#include "HDefines.h"
    4446#include "HPreferences.h"
    4547
     48#undef B_TRANSLATE_CONTEXT
     49#define B_TRANSLATE_CONTEXT "C Paths Box"
     50
    4651    typedef BListItem CListItem;
    4752    typedef BView LView;
    4853
     
    188193                    BStringItem *item;
    189194                    FailOSErr(msg->FindPointer("item", (void**)&item));
    190195                    if (fList->IndexOf(item) < 0)
    191                         THROW(("item was removed from list!"));
     196                        THROW((B_TRANSLATE("item was removed from list!")));
    192197                    item->SetText(p.Path());
    193198                }
    194199               
     
    218223        NULL, B_DIRECTORY_NODE, false, new BMessage(msg_AddPath));
    219224    FailNil(fPanel);
    220225   
    221     fPanel->Window()->SetTitle("Add Directory");
     226    fPanel->Window()->SetTitle(B_TRANSLATE("Add Directory"));
    222227    fPanel->Show();
    223228} /* CPathsBox::AddClicked */
    224229
     
    243248        &ref, B_DIRECTORY_NODE, false, msg);
    244249    FailNil(fPanel);
    245250   
    246     fPanel->Window()->SetTitle("Change Directory");
     251    fPanel->Window()->SetTitle(B_TRANSLATE("Change Directory"));
    247252    fPanel->Show();
    248253} /* CPathsBox::ChangeClicked */
    249254
  • Sources/CHtmlBar.cpp

     
    3333    Created: 03/09/98 23:14:35
    3434*/
    3535
     36#include <Catalog.h>
     37
    3638#include "pe.h"
    3739#include "CHtmlBar.h"
    3840#include "PApp.h"
     
    4648#include "ResourcesMisc.h"
    4749#include "Prefs.h"
    4850
     51#undef B_TRANSLATE_CONTEXT
     52#define B_TRANSLATE_CONTEXT "C Html Bar"
     53
    4954CHtmlBar *CHtmlBar::sfInstance;
    5055
    5156CHtmlBar* CHtmlBar::Instance()
     
    7075
    7176CHtmlBar::CHtmlBar()
    7277    : BWindow(gPrefs->GetPrefRect(prf_R_HtmlPalettePos, BRect(20, 20, 120, 120)),
    73         "HTML Palette",
     78        B_TRANSLATE("HTML Palette"),
    7479        B_FLOATING_WINDOW,
    7580        B_AVOID_FRONT | B_AVOID_FOCUS | B_WILL_ACCEPT_FIRST_CLICK | B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
    7681{
     
    9196           
    9297            size_t size;
    9398            p = r.FindResource(rtyp_Htmp, (int32)rid_Htmp_HtmlPalette, &size);
    94             if (p == NULL) THROW(("The custom HTML Palette file does not contain a valid palette resource"));
     99            if (p == NULL) THROW((B_TRANSLATE("The custom HTML Palette file does not contain a valid palette resource")));
    95100        }
    96101        catch (HErr& e)
    97102        {
     
    102107    else
    103108        p = HResources::GetResource(rtyp_Htmp, rid_Htmp_HtmlPalette, size);
    104109   
    105     if (p == NULL) THROW(("Could not find a palette resource"));
     110    if (p == NULL) THROW((B_TRANSLATE("Could not find a palette resource")));
    106111   
    107112    BMemoryIO data(p, size);
    108113    BPositionIO& buf = data;
  • Sources/PApp.cpp

     
    3737
    3838static const char *rcsid = "$Id$";
    3939
     40#include <Catalog.h>
     41
    4042#include "PApp.h"
    4143#include "PDoc.h"
    4244#include "PMessages.h"
     
    6365#include "CProjectRoster.h"
    6466#include "Prefs.h"
    6567
     68#undef B_TRANSLATE_CONTEXT
     69#define B_TRANSLATE_CONTEXT "P App"
     70
    6671BDirectory gAppDir, gCWD, gPrefsDir;
    6772BFile gAppFile;
    6873PApp *gApp;
     
    137142    : BApplication("application/x-vnd.beunited.pe")
    138143{
    139144#if BETA
    140     MInfoAlert a("This is a beta release of Pe.\n");
     145    MInfoAlert a(B_TRANSLATE("This is a beta release of Pe.\n"));
    141146    a.Go();
    142147#endif
    143148
     
    150155            FailOSErr(find_directory(B_USER_SETTINGS_DIRECTORY, &settings, true));
    151156
    152157            BDirectory e;
    153             FailOSErrMsg(e.SetTo(settings.Path()), "~/config/settings directory not found ?!?!?");
     158            FailOSErrMsg(e.SetTo(settings.Path()), B_TRANSLATE("~/config/settings directory not found ?!?!?"));
    154159            if (!e.Contains("pe", B_DIRECTORY_NODE))
    155160                FailOSErr(e.CreateDirectory("pe", &gPrefsDir));
    156161            else
     
    264269        gRecentBufferSize = gPrefs->GetPrefInt(prf_I_RecentSize, 10);
    265270        RestoreRecentMenu();
    266271
    267         fFindDialog = DialogCreator<CFindDialog>::CreateDialog("Find", NULL, PDoc::TopWindow());
     272        fFindDialog = DialogCreator<CFindDialog>::CreateDialog(B_TRANSLATE("Find"), NULL, PDoc::TopWindow());
    268273        fFindDialog->Run();
    269274
    270275        InitSelectedMap();
     
    555560
    556561static void Usage()
    557562{
    558     fprintf(stderr, "Usage: pe [\"+\"linenr] file1 file2 ...\n");
     563    fprintf(stderr, B_TRANSLATE("Usage: pe [\"+\"linenr] file1 file2 ...\n"));
    559564} /* Usage */
    560565
    561566void PApp::ArgvReceived(int32 argc, const char *argv[], const char * cwd)
     
    796801            case msg_FindDifferences:
    797802            {
    798803                BRect r(100,100,500,250);
    799                 new CDiffWindow(r, "Differences");
     804                new CDiffWindow(r, B_TRANSLATE("Differences"));
    800805                break;
    801806            }
    802807
     
    935940                if (fPrefsDialog) {
    936941                    BAutolock lock(fPrefsDialog);
    937942                    if (!lock.IsLocked()) {
    938                         THROW(("Preferences panel failed to lock"));
     943                        THROW((B_TRANSLATE("Preferences panel failed to lock")));
    939944                        break;
    940945                    }
    941946
     
    951956                    fPrefsDialog->Activate(true);
    952957                }
    953958                else
    954                     THROW(("Preferences panel failed to open"));
     959                    THROW((B_TRANSLATE("Preferences panel failed to open")));
    955960                break;
    956961            }
    957962
     
    10391044            be_roster->ActivateApp(team);
    10401045        }
    10411046        else if (be_roster->Launch(sig, &msg))
    1042             THROW(("Could not launch browser"));
     1047            THROW((B_TRANSLATE("Could not launch browser")));
    10431048    }
    10441049    catch (HErr& e)
    10451050    {
  • Sources/CPrefsDialog.cpp

     
    3434    Created: 10/20/97 20:28:28
    3535*/
    3636
     37#include <Catalog.h>
     38
    3739#include "pe.h"
    3840#include "CPrefsDialog.h"
    3941#include "PMessages.h"
     
    6062#include "Prefs.h"
    6163#include "PrefControls.h"
    6264
     65#undef B_TRANSLATE_CONTEXT
     66#define B_TRANSLATE_CONTEXT "C Prefs Dialog"
     67
    6368typedef BStringItem CStringItem;
    6469
    6570class MyItem : public CStringItem
     
    234239    BButton *ok = static_cast<BButton*>(FindView("ok  "));
    235240    if (ok->IsEnabled())
    236241    {
    237         MWarningAlert a("The preferences have changed. Save changes before closing?", "Save", "Discard");
     242        MWarningAlert a(B_TRANSLATE("The preferences have changed. Save changes before closing?"), B_TRANSLATE("Save"), B_TRANSLATE("Discard"));
    238243        if (a == 1)
    239244            OkClicked();
    240245        else
     
    392397        intf->SetExtensions(fSuffixes[cookie - 1].c_str());
    393398
    394399    item = fDefLanguage->FindMarked();
    395     gPrefs->SetPrefString(prf_S_DefLang, item ? item->Label() : "None");
     400    gPrefs->SetPrefString(prf_S_DefLang, item ? item->Label() : B_TRANSLATE("None"));
    396401    CLanguageInterface::ChooseDefault();
    397402
    398403
     
    608613
    609614    CLanguageInterface *intf;
    610615    int cookie = 0, i = 0;
    611     const char *defLang = gPrefs->GetPrefString(prf_S_DefLang, "None");
     616    const char *defLang = gPrefs->GetPrefString(prf_S_DefLang, B_TRANSLATE("None"));
    612617
    613618    while ((intf = CLanguageInterface::NextIntf(cookie)) != NULL)
    614619    {
     
    963968        keymap::iterator ki = fKeymap.find(ks);
    964969        if (ki != fKeymap.end() && (*ki).second != mi->fOne)
    965970        {
    966             MInfoAlert a("Do you want to replace the current binding for this shortcut?",
    967                 "Replace", "Cancel");
     971            MInfoAlert a(B_TRANSLATE("Do you want to replace the current binding for this shortcut?"),
     972                B_TRANSLATE("Replace"), B_TRANSLATE("Cancel"));
    968973            if (a.Go() != 1)
    969974                return;
    970975        }
  • Sources/CDiffWindow.cpp

     
    5050#include "ResourcesToolbars.h"
    5151#include "Prefs.h"
    5252
     53#include <Catalog.h>
     54
     55#undef B_TRANSLATE_CONTEXT
     56#define B_TRANSLATE_CONTEXT "C Diff Window"
     57
    5358inline int compare(const char *a, const char *b)
    5459{
    5560    return strcmp(a, b);
     
    8792        pt.x = FindView("ButtonBar")->Frame().right + 10;
    8893        pt.y = fh.ascent - 1;
    8994       
    90         strcpy(s, "File 1: ");
     95        strcpy(s, B_TRANSLATE_WITH_COMMENT("File 1: ",
     96                "There is a space after the colon."));
    9197        if (e.SetTo(&dw->File1(), true) == B_OK && e.Exists())
    9298        {
    9399            e.GetPath(&p);
    94100            strcat(s, p.Path());
    95101        }
    96102        else
    97             strcat(s, "<none>");
     103            strcat(s, B_TRANSLATE("<none>"));
    98104       
    99105        DrawString(s, pt);
    100106       
    101         strcpy(s, "File 2: ");
     107        strcpy(s, B_TRANSLATE_WITH_COMMENT("File 2: ",
     108                "There is a space after the colon."));
    102109        if (e.SetTo(&dw->File2(), true) == B_OK && e.Exists())
    103110        {
    104111            e.GetPath(&p);
    105112            strcat(s, p.Path());
    106113        }
    107114        else
    108             strcat(s, "<none>");
     115            strcat(s, B_TRANSLATE("<none>"));
    109116       
    110117        pt.y += fh.ascent + fh.descent - 1;
    111118        DrawString(s, pt);
     
    308315                    msg->AddInt32("filenr", fileNr);
    309316                   
    310317                    fPanel = new BFilePanel(B_OPEN_PANEL, new BMessenger(this), &ref, B_ANY_NODE, false, msg);
    311                     fPanel->SetButtonLabel(B_DEFAULT_BUTTON, "Choose");
     318                    fPanel->SetButtonLabel(B_DEFAULT_BUTTON, B_TRANSLATE("Choose"));
    312319                    fPanel->Show();
    313320                }
    314321                fButtonBar->SetDown(cmd, false);
     
    321328        while (system_time() < longEnough);
    322329    }
    323330
    324     BPopUpMenu popup("Recent");
     331    BPopUpMenu popup(B_TRANSLATE("Recent"));
    325332    BMenuItem *item;
    326333    char s[PATH_MAX];
    327334    int i = 0;
     
    332339    popup.SetFont(be_plain_font);
    333340   
    334341    if (popup.CountItems() == 0)
    335         popup.AddItem(new BMenuItem("Empty", NULL));
     342        popup.AddItem(new BMenuItem(B_TRANSLATE("Empty"), NULL));
    336343
    337344    BRect r;
    338345   
     
    359366        PDoc *docA, *docB;
    360367       
    361368        docA = dynamic_cast<PDoc*>(gApp->OpenWindow(fFile1));
    362         if (! docA) THROW(("Could not open file 1"));
     369        if (! docA) THROW((B_TRANSLATE("Could not open file 1")));
    363370        docB = dynamic_cast<PDoc*>(gApp->OpenWindow(fFile2));
    364         if (! docB) THROW(("Could not open file 2"));
     371        if (! docB) THROW((B_TRANSLATE("Could not open file 2")));
    365372       
    366373        vector<int> va, vb;
    367374       
     
    391398       
    392399        if (fScript->CountItems() == 0)
    393400        {
    394             MInfoAlert a("Files are identical");
     401            MInfoAlert a(B_TRANSLATE("Files are identical"));
    395402            a.Go();
    396403            return;
    397404        }
     
    525532    FailOSErr(BEntry(&file, true).GetPath(&p));
    526533   
    527534    FILE *f = fopen(p.Path(), "r");
    528     if (!f) THROW(("Failed to open file %s", p.Path()));
     535    if (!f) THROW((B_TRANSLATE("Failed to open file %s"), p.Path()));
    529536
    530537    char *txt;
    531538    size_t size;
     
    655662
    656663                BRect r(100,100,500,250);
    657664                       
    658                 CDiffWindow *ndw = new CDiffWindow(r, "Differences");
     665                CDiffWindow *ndw = new CDiffWindow(r, B_TRANSLATE("Differences"));
    659666               
    660667                BMessage msg(msg_Add2Files);
    661668                msg.AddRef("refs", &f1);
     
    821828    if (fA1 == fA2)
    822829    {
    823830        if (fB1 < fB2 - 1)
    824             sprintf(s, "Extra lines in file 2: %d-%d", fB1 + 1, fB2);
     831            sprintf(s, B_TRANSLATE("Extra lines in file 2: %d-%d"),
     832                fB1 + 1, fB2);
    825833        else
    826             sprintf(s, "Extra line in file 2: %d", fB1 + 1);
     834            sprintf(s, B_TRANSLATE("Extra line in file 2: %d"),
     835                fB1 + 1);
    827836    }
    828837    else if (fB1 == fB2)
    829838    {
    830839        if (fA1 < fA2 - 1)
    831             sprintf(s, "Extra lines in file 1: %d-%d", fA1 + 1, fA2);
     840            sprintf(s, B_TRANSLATE("Extra lines in file 1: %d-%d"),
     841                fA1 + 1, fA2);
    832842        else
    833             sprintf(s, "Extra line in file 1: %d", fA1 + 1);
     843            sprintf(s, B_TRANSLATE("Extra line in file 1: %d"),
     844                fA1 + 1);
    834845    }
    835846    else
    836847    {
    837848        if (fA1 < fA2 - 1 && fB1 < fB2 - 1)
    838             sprintf(s, "Nonmatching lines. File 1: %d-%d, File2: %d-%d", fA1 + 1, fA2, fB1 + 1, fB2);
     849            sprintf(s, B_TRANSLATE("Nonmatching lines. File 1: "
     850              "%d-%d, File2: %d-%d"), fA1 + 1, fA2, fB1 + 1, fB2);
    839851        else if (fB1 < fB2 - 1)
    840             sprintf(s, "Nonmatching lines. File 1: %d, File2: %d-%d", fA1 + 1, fB1 + 1, fB2);
     852            sprintf(s, B_TRANSLATE("Nonmatching lines. File 1: %d,"
     853              " File2: %d-%d"), fA1 + 1, fB1 + 1, fB2);
    841854        else if (fA1 < fA2 - 1)
    842             sprintf(s, "Nonmatching lines. File 1: %d-%d, File2: %d", fA1 + 1, fA2, fB1 + 1);
     855            sprintf(s, B_TRANSLATE("Nonmatching lines. File 1: "
     856              "%d-%d, File2: %d"), fA1 + 1, fA2, fB1 + 1);
    843857        else
    844             sprintf(s, "Nonmatching lines. File 1: %d, File2: %d", fA1 + 1, fB1 + 1);
     858            sprintf(s, B_TRANSLATE("Nonmatching lines. File 1: "
     859              "%d, File2: %d"), fA1 + 1, fB1 + 1);
    845860    }
    846861   
    847862    if (IsSelected())
     
    872887    switch (fWhere)
    873888    {
    874889        case 0: strcpy(s, fFile); break;
    875         case 1: sprintf(s, "File %s only in dir %d", fFile, 1); break;
    876         case 2: sprintf(s, "File %s only in dir %d", fFile, 2); break;
     890        case 1: sprintf(s, B_TRANSLATE("File %s only in dir %d"),
     891          fFile, 1); break;
     892        case 2: sprintf(s, B_TRANSLATE("File %s only in dir %d"),
     893          fFile, 2); break;
    877894    }
    878895   
    879896    if (IsSelected())
     
    910927            docB = dynamic_cast<PDoc*>(gApp->OpenWindow(fFile2));
    911928    }
    912929
    913     if (! docA) THROW(("Could not open file 1"));
    914     if (! docB) THROW(("Could not open file 2"));
     930    if (! docA) THROW((B_TRANSLATE("Could not open file 1")));
     931    if (! docB) THROW((B_TRANSLATE("Could not open file 2")));
    915932} // CDiffWindow::GetDocs
  • Sources/PText.cpp

     
    3535
    3636#include "pe.h"
    3737
     38#include <Catalog.h>
    3839#include <signal.h>
    3940#include <PrintJob.h>
    4041#include <String.h>
     
    6869#include "ResourcesMenus.h"
    6970#include "Prefs.h"
    7071
     72#undef B_TRANSLATE_CONTEXT
     73#define B_TRANSLATE_CONTEXT "P Text"
     74
    7175#if defined(__BEOS__) && defined(__INTEL__)
    7276    // [zooey]: BeOS' glib is messing up iscntrl, as it reports all values>127 as
    7377    // being control-chars, too (but they are *not*). We fix that:
     
    11571161
    11581162void PText::Insert(const char *bytes, int numBytes, int offset)
    11591163{
    1160     if (Doc()->IsReadOnly()) THROW(("Document is read-only"));
     1164    if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only")));
    11611165
    11621166    ASSERT(numBytes >= 0);
    11631167    ASSERT(offset >= 0);
     
    11771181
    11781182void PText::Delete(int from, int to)
    11791183{
    1180     if (Doc()->IsReadOnly()) THROW(("Document is read-only"));
     1184    if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only")));
    11811185
    11821186    ASSERT(from >= 0);
    11831187    ASSERT(to > from);
     
    11961200
    11971201void PText::BackspaceKeyDown()
    11981202{
    1199     if (Doc()->IsReadOnly()) THROW(("Document is read-only"));
     1203    if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only")));
    12001204
    12011205    if (fAnchor == fCaret)
    12021206    {
     
    12421246
    12431247void PText::DeleteKeyDown()
    12441248{
    1245     if (Doc()->IsReadOnly()) THROW(("Document is read-only"));
     1249    if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only")));
    12461250
    12471251    if (fAnchor == fCaret)
    12481252    {
     
    12811285
    12821286void PText::CharKeyDown(const char *bytes, int numBytes)
    12831287{
    1284     if (Doc()->IsReadOnly()) THROW(("Document is read-only"));
     1288    if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only")));
    12851289
    12861290    bool keepContext = OffsetIsOutsideOfContextArea(fCaret);
    12871291
     
    13521356
    13531357void PText::TypeString(const char *string)
    13541358{
    1355     if (Doc()->IsReadOnly()) THROW(("Document is read-only"));
     1359    if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only")));
    13561360
    13571361    CharKeyDown(string, strlen(string));
    13581362    fStatus->SetOffset(fCaret);
     
    19551959
    19561960            BMessage drag(B_SIMPLE_DATA);
    19571961            FailOSErr(drag.AddData("text/plain", B_MIME_DATA, s, strlen(s)));
    1958             FailOSErr(drag.AddString("be:clip_name", "Text Snippet"));
     1962            FailOSErr(drag.AddString("be:clip_name", B_TRANSLATE("Text Snippet")));
    19591963
    19601964            fDragStart = min(fAnchor, fCaret);
    19611965            sfDragSource = this;
     
    22172221            {
    22182222                BPopUpMenu popup("copy or move");
    22192223                popup.SetFont(be_plain_font);
    2220                 popup.AddItem(new BMenuItem("Move", NULL));
    2221                 popup.AddItem(new BMenuItem("Copy", NULL));
     2224                popup.AddItem(new BMenuItem(B_TRANSLATE("Move"), NULL));
     2225                popup.AddItem(new BMenuItem(B_TRANSLATE("Copy"), NULL));
    22222226                BMenuItem *item = popup.Go(msg->DropPoint(), false, true);
    22232227
    22242228                if (!item)
     
    24692473
    24702474    if (includes.IsEmpty() && functions.IsEmpty())
    24712475    {
    2472         popup->AddItem(new BMenuItem("Nothing Found", NULL));
     2476        popup->AddItem(new BMenuItem(B_TRANSLATE("Nothing Found"), NULL));
    24732477    }
    24742478    else
    24752479    {
     
    25512555
    25522556        BMenuItem* fontItem = fMainPopUp->FindItem(msg_ToggleFont);
    25532557        int fontKind = kAltFont;
    2554         // TODO: what about localized item names?!?
    25552558        switch (fFontKind) {
    25562559            case kNormalFont:
    2557                 fontItem->SetLabel("Alternate Font");
     2560                fontItem->SetLabel(B_TRANSLATE("Alternate Font"));
    25582561                fontItem->SetMarked(false);
    25592562                fontKind = kAltFont;
    25602563                break;
    25612564            case kAltFont:
    2562                 fontItem->SetLabel("Alternate Font");
     2565                fontItem->SetLabel(B_TRANSLATE("Alternate Font"));
    25632566                fontItem->SetMarked(true);
    25642567                fontKind = kNormalFont;
    25652568                break;
    25662569            case kIndividualFont:
    25672570            default:
    2568                 fontItem->SetLabel("Individual Font");
     2571                fontItem->SetLabel(B_TRANSLATE("Individual Font"));
    25692572                fontItem->SetMarked(true);
    25702573                fontKind = kNormalFont;
    25712574                break;
     
    34073410        switch (bytes[0])
    34083411        {
    34093412            case B_FUNCTION_KEY:
    3410                 if (Doc()->IsReadOnly()) THROW(("Document is read-only"));
     3413                if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only")));
    34113414
    34123415                key |= 0x0100;
    34133416
     
    34343437
    34353438            default:
    34363439            {
    3437                 if (Doc()->IsReadOnly()) THROW(("Document is read-only"));
     3440                if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only")));
    34383441
    34393442                if (gGlossary->IsGlossaryShortcut(ch, modifiers))
    34403443                {
     
    38023805            RedrawDirtyLines();
    38033806            break;
    38043807        case kmsg_ExchangeMarkAndPoint:
    3805             if (fMark == -1) THROW(("Mark not set"));
     3808            if (fMark == -1) THROW((B_TRANSLATE("Mark not set")));
    38063809            newCaret = fMark;
    38073810            if (fAnchor != fCaret)
    38083811                newAnchor = newCaret;
    38093812            SetMark(fCaret);
    38103813            break;
    38113814        case kmsg_CutRegion:
    3812             if (fMark == -1) THROW(("Mark not set"));
     3815            if (fMark == -1) THROW((B_TRANSLATE("Mark not set")));
    38133816            fAnchor = fMark;
    38143817            RegisterCommand(new PCutCmd(this));
    38153818            fMark = newCaret = newAnchor = fCaret;
    38163819            break;
    38173820        case kmsg_CopyRegion:
    3818             if (fMark == -1) THROW(("Mark not set"));
     3821            if (fMark == -1) THROW((B_TRANSLATE("Mark not set")));
    38193822            fAnchor = fMark;
    38203823            Copy();
    38213824            break;
    38223825        case kmsg_ClearRegion:
    3823             if (fMark == -1) THROW(("Mark not set"));
     3826            if (fMark == -1) THROW((B_TRANSLATE("Mark not set")));
    38243827            fAnchor = fMark;
    38253828            RegisterCommand(new PClearCmd(this));
    38263829            fMark = newCaret = newAnchor = fCaret;
     
    46474650{
    46484651    if (fExec)
    46494652    {
    4650         MWarningAlert a("Can only execute one command at the time per window, sorry!");
     4653        MWarningAlert a(B_TRANSLATE("Can only execute one command at the time per window, sorry!"));
    46514654        a.Go();
    46524655        return;
    46534656    }
     
    60286031
    60296032                FailOSErr(msg->FindRef("refs", &ref));
    60306033                FailOSErr(e.SetTo(&ref));
    6031                 if (!e.IsDirectory()) THROW(("This is not a directory!"));
     6034                if (!e.IsDirectory()) THROW((B_TRANSLATE("This is not a directory!")));
    60326035
    60336036                BPath p;
    60346037                FailOSErr(e.GetPath(&p));
     
    63616364
    63626365void PText::Cut(int append)
    63636366{
    6364     if (Doc()->IsReadOnly()) THROW(("Document is read-only"));
     6367    if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only")));
    63656368
    63666369    Copy(append);
    63676370    Clear();
     
    64236426
    64246427void PText::Paste()
    64256428{
    6426     if (Doc()->IsReadOnly()) THROW(("Document is read-only"));
     6429    if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only")));
    64276430    be_clipboard->Lock();
    64286431
    64296432    try
     
    64586461
    64596462void PText::Clear()
    64606463{
    6461     if (Doc()->IsReadOnly()) THROW(("Document is read-only"));
     6464    if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only")));
    64626465
    64636466    int size = abs(fCaret - fAnchor);
    64646467    if (size)
     
    65116514    if (fDoneCmds.size())
    65126515    {
    65136516        mbar->FindItem(msg_Undo)->SetEnabled(true);
    6514         char s[64] = "Undo ";
    6515         strcat(s, fDoneCmds.top()->Desc());
    6516         mbar->FindItem(msg_Undo)->SetLabel(s);
     6517        BString str1(B_TRANSLATE("Undo %1"));
     6518        str1.ReplaceFirst("%1", fDoneCmds.top()->Desc());
     6519        mbar->FindItem(msg_Undo)->SetLabel(str1.String());
    65176520    }
    65186521    else
    65196522        mbar->FindItem(msg_Undo)->SetEnabled(false);
     
    65216524    if (fUndoneCmds.size())
    65226525    {
    65236526        mbar->FindItem(msg_Redo)->SetEnabled(true);
    6524         char s[64] = "Redo ";
    6525         strcat(s, fUndoneCmds.top()->Desc());
    6526         mbar->FindItem(msg_Redo)->SetLabel(s);
     6527        BString str2(B_TRANSLATE("Redo %2"));
     6528        str2.ReplaceFirst("%2", fUndoneCmds.top()->Desc());
     6529        mbar->FindItem(msg_Redo)->SetLabel(str2.String());
    65276530    }
    65286531    else
    65296532        mbar->FindItem(msg_Redo)->SetEnabled(false);
  • Sources/CFtpStream.cpp

     
    3333    Created: 03/31/98 14:29:11
    3434*/
    3535
     36#include <Catalog.h>
     37
    3638#include "pe.h"
    3739#include "CFtpStream.h"
    3840#include "CLogin.h"
     
    4951#endif
    5052#include <netdb.h>
    5153
     54#undef B_TRANSLATE_CONTEXT
     55#define B_TRANSLATE_CONTEXT "C Ftp Stream"
     56
    5257#ifndef __HAIKU__
    5358typedef int socklen_t;
    5459#endif
     
    145150URLData& URLData::operator+= (const char *relPath)
    146151{
    147152    if (!IsValid())
    148         THROW(("Url is not valid in the first place!"));
     153        THROW((B_TRANSLATE("Url is not valid in the first place!")));
    149154   
    150155    if (strchr(relPath, '/') == NULL)
    151156    {
     
    180185
    181186void URLData::PrintToStream()
    182187{
    183     printf("URL:\n\tServer=%s,\n\tDirectory=%s,\n\tFile=%s,\n\tUsername=%s\n",
     188    printf(B_TRANSLATE("URL:\n\tServer=%s,\n\tDirectory=%s,\n\tFile=%s,\n\tUsername=%s\n"),
    184189        fServer, fPath, fFile, fUsername);
    185190} /* URLData::PrintToStream */
    186191
     
    202207static void GetReply(struct SOCK *sock, int& r, char* msg)
    203208{
    204209    if (! s_gets(msg, 1024, sock))
    205         THROW(("Read error"));
     210        THROW((B_TRANSLATE("Read error")));
    206211
    207212    char *m;
    208213    r = strtoul(msg, &m, 10);
     
    213218        do
    214219        {
    215220            if (! s_gets(msg, 1024, sock))
    216                 THROW(("Read error"));
     221                THROW((B_TRANSLATE("Read error")));
    217222            r2 = strtoul(msg, &m, 10);
    218223        }
    219224        while (m == NULL || r2 != r || *m != ' ');
     
    222227
    223228inline void FailSockErr(int e)
    224229{
    225     if (e < 0) THROW(("Network error: %s", strerror(errno)));
     230    if (e < 0) THROW((B_TRANSLATE("Network error: %s"), strerror(errno)));
    226231} /* FailSockErr */
    227232
    228233void CFtpStream::Retrieve()
     
    244249    try
    245250    {
    246251        if (! fURL.IsValid())
    247             THROW(("The data to connect is not complete"));
     252            THROW((B_TRANSLATE("The data to connect is not complete")));
    248253       
    249254        ctrl = socket(AF_INET, SOCK_STREAM, 0);
    250255        if (ctrl < 0)
    251             THROW(("Failed to get socket: %s", strerror(errno)));
     256            THROW((B_TRANSLATE("Failed to get socket: %s"), strerror(errno)));
    252257        data = socket(AF_INET, SOCK_STREAM, 0);
    253258        if (data < 0)
    254             THROW(("Failed to get socket: %s", strerror(errno)));
     259            THROW((B_TRANSLATE("Failed to get socket: %s"), strerror(errno)));
    255260       
    256261        csSock = s_open(ctrl, "r+");
    257262       
    258263        struct hostent *host;
    259264        if ((host = gethostbyname(fURL.Server())) == NULL)
    260             THROW(("Failed to get server address: %s", strerror(errno)));
     265            THROW((B_TRANSLATE("Failed to get server address: %s"), strerror(errno)));
    261266       
    262267        struct sockaddr_in sa;
    263268        sa.sin_family = AF_INET;
     
    291296            {
    292297                case 1:
    293298                    if ((r / 100) != 2)
    294                         THROW(("Connect failed: %s", msg));
    295                     s_printf(csSock, "user %s\r\n", username.c_str());
     299                        THROW((B_TRANSLATE("Connect failed: %s"), msg));
     300                    s_printf(csSock, B_TRANSLATE("user %s\r\n"), username.c_str());
    296301                    state = 2;
    297302                    break;
    298303               
    299304                case 2:
    300305                    if ((r / 100) == 3)
    301306                    {
    302                         s_printf(csSock, "pass %s\r\n", password.c_str());
     307                        s_printf(csSock, B_TRANSLATE("pass %s\r\n"), password.c_str());
    303308                        state = 3;
    304309                        break;
    305310                    }
    306311                    else if ((r / 100) != 2 && (r / 100) != 5)
    307                         THROW(("Failed to login: %s", msg));
     312                        THROW((B_TRANSLATE("Failed to login: %s"), msg));
    308313
    309314                    // fall thru
    310315               
     
    328333                            THROW((0));
    329334                    }
    330335                    else if (state == 3 && (r / 100) != 2)
    331                         THROW(("Failed to login: %s", msg));
     336                        THROW((B_TRANSLATE("Failed to login: %s"), msg));
    332337                    else if (strlen(fURL.Path()))
    333338                    {
    334339                        s_printf(csSock, "cwd %s\r\n", fURL.Path());
     
    341346                case 4:
    342347                {
    343348                    if (state == 4 && (r / 100) != 2)
    344                         THROW(("Failed to change directory: %s", msg));
     349                        THROW((B_TRANSLATE("Failed to change directory: %s"), msg));
    345350                   
    346351                    if (fPassive) {
    347352                        // switch to passive mode
     
    364369                        // fetch ip-address from cmd-socket:
    365370                        FailSockErr(getsockname(csSock->sSocket, (struct sockaddr *)&sa, &size));
    366371                        unsigned char *sap = (unsigned char *)&sa.sin_addr.s_addr;
    367                         s_printf(csSock, "port %d,%d,%d,%d,%d,%d\r\n", sap[0], sap[1], sap[2], sap[3], pap[0], pap[1]);
     372                        s_printf(csSock, B_TRANSLATE("port %d,%d,%d,%d,%d,%d\r\n"), sap[0], sap[1], sap[2], sap[3], pap[0], pap[1]);
    368373                    }
    369374                    state = 5;
    370375                    break;
     
    374379                        unsigned int sap[4];
    375380                        unsigned int pap[2];
    376381                        if ((r / 100) != 2)
    377                             THROW(("Pasv command failed: %s", msg));
     382                            THROW((B_TRANSLATE("Pasv command failed: %s"), msg));
    378383                        char* pos = strchr(msg,'(');
    379384                        if (!pos)
    380                             THROW(("Answer to Pasv has unknown format: %s", msg));
     385                            THROW((B_TRANSLATE("Answer to Pasv has unknown format: %s"), msg));
    381386                        int cnt = sscanf(pos+1, "%u,%u,%u,%u,%u,%u",
    382387                                              &sap[0], &sap[1], &sap[2], &sap[3],
    383388                                              &pap[0], &pap[1]);
    384389                        if (cnt != 6)
    385                             THROW(("Could not parse answer to Pasv (%d of 6): %s",
     390                            THROW((B_TRANSLATE("Could not parse answer to Pasv (%d of 6): %s"),
    386391                                     cnt, msg));
    387392                        char ipAddr[20];
    388393                        sprintf(ipAddr, "%d.%d.%d.%d", sap[0], sap[1], sap[2], sap[3]);
     
    391396                        FailOSErr(connect(data, (struct sockaddr *)&saData, sizeof(saData)));
    392397                    } else {
    393398                        if ((r / 100) != 2)
    394                             THROW(("Port command failed: %s", msg));
     399                            THROW((B_TRANSLATE("Port command failed: %s"), msg));
    395400                    }
    396401                    if (action == 1)
    397402                    {
     
    436441                        state = 8;
    437442                    }
    438443                    else
    439                         THROW(("Failed to retrieve file: %s", msg));
     444                        THROW((B_TRANSLATE("Failed to retrieve file: %s"), msg));
    440445                    break;
    441446                   
    442447                case 7:
     
    463468                        state = 8;
    464469                    }
    465470                    else
    466                         THROW(("Failed to store file: %s", msg));
     471                        THROW((B_TRANSLATE("Failed to store file: %s"), msg));
    467472                    break;
    468473
    469474                case 8:
    470475                    if ((r / 100) != 2)
    471                         THROW(("Failed to %s file: %s", action == 1 ? "retrieve" : "store",  msg));
    472                     s_printf(csSock, "quit\r\n");
     476                      if (action == 1)
     477                        THROW((B_TRANSLATE("Failed to retrieve file: %s"), msg));
     478                      else
     479                        THROW((B_TRANSLATE("Failed to store file: %s"), msg));
     480                    s_printf(csSock, THROW(B_TRANSLATE("quit\r\n")));
    473481                    state = 0;
    474482                    break;
    475483
  • Sources/CInfoDialog.cpp

     
    3333    Created: 10/28/97 09:19:58
    3434*/
    3535
     36#include <Catalog.h>
     37
    3638#include "pe.h"
    3739#include "CInfoDialog.h"
    3840#include "PMessages.h"
     
    4749#include "MAlert.h"
    4850#include "Prefs.h"
    4951
     52#undef B_TRANSLATE_CONTEXT
     53#define B_TRANSLATE_CONTEXT "C Info Dialog"
     54
    5055CInfoDialog::CInfoDialog(BRect frame, const char *name, window_type type, int flags,
    5156            BWindow *owner, BPositionIO* data)
    5257    : HDialog(frame, name, type, flags, owner, data)
     
    100105    {
    101106        BMenuItem *item;
    102107        fTypes->AddSeparatorItem();
    103         fTypes->AddItem(item = new BMenuItem("<undefined>", new BMessage(msg_FieldChanged)));
     108        fTypes->AddItem(item = new BMenuItem(B_TRANSLATE("<undefined>"), new BMessage(msg_FieldChanged)));
    104109        item->SetMarked(true);
    105110    }
    106111
     
    121126    else
    122127    {
    123128        //SetEnabled("mime", false);
    124         SetText("time", "Not Saved");
     129        SetText("time", B_TRANSLATE("Not Saved"));
    125130    }
    126131
    127132    mf = dynamic_cast<BMenuField*>(FindView("font"));
     
    311316
    312317    if (strcmp(fTypes->FindMarked()->Label(), "undefined") == 0)
    313318    {
    314         MWarningAlert a("Please choose a real mime type");
     319        MWarningAlert a(B_TRANSLATE("Please choose a real mime type"));
    315320        a.Go();
    316321    }
    317322
  • Sources/PDoc.cpp

     
    3535
    3636#include "pe.h"
    3737
     38#include <Catalog.h>
     39
    3840#include <fs_attr.h>
    3941
    4042#include "CCharObject.h"
     
    7779#include "Scripting.h"
    7880#include "Utils.h"
    7981
     82#undef B_TRANSLATE_CONTEXT
     83#define B_TRANSLATE_CONTEXT "P Doc"
     84
    8085static long sDocCount = 0;
    8186
    8287const float
     
    9196    fWindowMenuLength = -1;
    9297    fToolBar = NULL;
    9398
    94     InitWindow(doc ? doc->name : "Untitled");
     99    InitWindow(doc ? doc->name : B_TRANSLATE("Untitled"));
    95100
    96101    if (IsReadOnly())
    97102        fButtonBar->SetOn(msg_ReadOnly, true);
     
    131136    fWindowMenuLength = -1;
    132137    fToolBar = NULL;
    133138
    134     InitWindow("Untitled");
     139    InitWindow(B_TRANSLATE("Untitled"));
    135140
    136141    Read();
    137142
     
    207212        i++;
    208213    }
    209214
    210     if (!fRecent) THROW(("Resources damaged?"));
     215    if (!fRecent) THROW((B_TRANSLATE("Resources damaged?")));
    211216
    212217    b.top += fMBar->Frame().bottom + 1;
    213218    r = b;
     
    348353        return;
    349354    if (IsDirty())
    350355    {
    351         MInfoAlert a(
     356        MInfoAlert a(B_TRANSLATE(
    352357            "This will re-read the document's contents from disk,\n"
    353358            "so all changes will be lost!\n\n"
    354             "Do you want to continue?", "OK", "Cancel");
     359            "Do you want to continue?"), B_TRANSLATE("OK"),
     360            B_TRANSLATE("Cancel"));
    355361        if (a.Go() != 1)
    356362            return;
    357363    }
     
    441447            BMenuItem *item = m->FindMarked();
    442448            FailNil(item);
    443449
    444             if (strcmp(item->Label(), "<undefined>"))
     450            if (strcmp(item->Label(), B_TRANSLATE("<undefined>")))
    445451            {
    446452                gPrefs->SetPrefInt("LastSavedMimeType", m->IndexOf(item));
    447453                SetMimeType(item->Label(), false);
     
    874880    if (lock.IsLocked())
    875881    {
    876882        BView *background = savePanel->ChildAt(0);
    877         FailNilMsg(background, "Error building FilePanel");
     883        FailNilMsg(background, B_TRANSLATE("Error building FilePanel"));
    878884
    879885        BButton *cancel = dynamic_cast<BButton*>(background->FindView("cancel button"));
    880         FailNilMsg(cancel, "Error building FilePanel");
     886        FailNilMsg(cancel, B_TRANSLATE("Error building FilePanel"));
    881887
    882888        BView *textview = background->FindView("text view");
    883         FailNilMsg(textview, "Error building FilePanel");
     889        FailNilMsg(textview, B_TRANSLATE("Error building FilePanel"));
    884890
    885891        BMenu *menu = HResources::GetMenu(rid_Menu_FpMimetypes, true);
    886         FailNilMsg(menu, "Error building FilePanel");
     892        FailNilMsg(menu, B_TRANSLATE("Error building FilePanel"));
    887893        menu->SetFont(be_plain_font);
    888894        menu->SetRadioMode(true);
    889895
     
    893899        be_plain_font->GetHeight(&fh);
    894900        rect.bottom = rect.top + fh.descent + fh.ascent + 5.0;
    895901
    896         BMenuField *menuField = new BMenuField(rect, "mime", "Type:",
     902        BMenuField *menuField = new BMenuField(rect, "mime", B_TRANSLATE("Type:"),
    897903            menu, B_FOLLOW_BOTTOM | B_FOLLOW_LEFT);
    898         FailNilMsg(menuField, "Error building FilePanel");
    899         menuField->SetDivider(be_plain_font->StringWidth("Type:") + 7);
     904        FailNilMsg(menuField, B_TRANSLATE("Error building FilePanel"));
     905        menuField->SetDivider(be_plain_font->StringWidth(B_TRANSLATE("Type:")) + 7);
    900906        menuField->MenuBar()->ResizeToPreferred();
    901907        menuField->ResizeToPreferred();
    902908
     
    946952        {
    947953            p = MimeType();
    948954            if (!p || !p[0])
    949                 p = "<undefined>";
     955                p = B_TRANSLATE("<undefined>");
    950956            menu->AddItem(item = new BMenuItem(p, NULL));
    951957            item->SetMarked(true);
    952958        }
     
    11941200            return;
    11951201        }
    11961202    }
    1197     THROW(("Extension %s not found!", ext));
     1203    THROW((B_TRANSLATE("Extension %s not found!"), ext));
    11981204} /* PDoc::PerformExtension */
    11991205
    12001206void PDoc::InstantiateAddOns()
     
    13991405                    MAlert *a;
    14001406
    14011407                    if (URL())
    1402                         a  = new MInfoAlert("In order to display this page in a browser you need to "
     1408                        a  = new MInfoAlert(B_TRANSLATE("In order to display this page in a browser you need to "
    14031409                        "save this document on a local disk first.\n\n"
    1404                         "Save changes to this document first?", "Save", "Cancel");
     1410                        "Save changes to this document first?"), B_TRANSLATE("Save"), B_TRANSLATE("Cancel"));
    14051411                    else
    1406                         a = new MInfoAlert("Save changes to this document first?", "Save", "Cancel");
     1412                        a = new MInfoAlert(B_TRANSLATE("Save changes to this document first?"), B_TRANSLATE("Save"), B_TRANSLATE("Cancel"));
    14071413
    14081414                    if (a->Go() == 1)
    14091415                    {
     
    14361442
    14371443            case msg_GoToLine:
    14381444            {
    1439                 DialogCreator<CGoToLine>::CreateDialog("Go To Line", this);
     1445                DialogCreator<CGoToLine>::CreateDialog(B_TRANSLATE("Go To Line"), this);
    14401446                break;
    14411447            }
    14421448
     
    15401546                r.right = r.left + 400;
    15411547                r.bottom = r.top + 150;
    15421548
    1543                 new CDiffWindow(r, "Differences");
     1549                new CDiffWindow(r, B_TRANSLATE("Differences"));
    15441550                break;
    15451551            }
    15461552
     
    15741580                }
    15751581                else
    15761582                {
    1577                     MInfoAlert a(prjWin->ErrorMsg(), "Hmmm...");
     1583                    MInfoAlert a(prjWin->ErrorMsg(), B_TRANSLATE("Hmmm..."));
    15781584                    a.Go();
    15791585                }
    15801586                break;
     
    18341840        while (system_time() < longEnough);
    18351841    }
    18361842
    1837     BPopUpMenu popup("Recent");
     1843    BPopUpMenu popup(B_TRANSLATE("Recent"));
    18381844    BMenuItem *item;
    18391845
    18401846    MenusBeginning();
     
    18491855    popup.SetFont(be_plain_font);
    18501856
    18511857    if (popup.CountItems() == 0)
    1852         popup.AddItem(new BMenuItem("Empty", NULL));
     1858        popup.AddItem(new BMenuItem(B_TRANSLATE("Empty"), NULL));
    18531859
    18541860    BRect r;
    18551861
     
    18671873{
    18681874    entry_ref ide;
    18691875    if (be_roster->FindApp("application/x-mw-BeIDE", &ide))
    1870         THROW(("BeIDE was not found"));
     1876        THROW((B_TRANSLATE("BeIDE was not found")));
    18711877
    18721878    if (be_roster->IsRunning(&ide))
    18731879        be_roster->ActivateApp(be_roster->TeamFor(&ide));
    18741880    else if (be_roster->Launch(&ide) != B_OK)
    1875         THROW(("Could not launch BeIDE"));
     1881        THROW((B_TRANSLATE("Could not launch BeIDE")));
    18761882} /* PDoc::IDEBringToFront */
    18771883
    18781884void PDoc::IDEAddFile()
     
    18911897    IDEBringToFront();
    18921898    SendToIDE(msg, &reply);
    18931899    if (reply.HasInt32("error"))
    1894         THROW(("An error occured adding the file"));
     1900        THROW((B_TRANSLATE("An error occured adding the file")));
    18951901} /* PDoc::IDEAddFile */
    18961902
    18971903void PDoc::IDERemoveFile()
     
    19101916    IDEBringToFront();
    19111917    SendToIDE(msg, &reply);
    19121918    if (reply.HasInt32("error"))
    1913         THROW(("An error occured removing the file"));
     1919        THROW((B_TRANSLATE("An error occured removing the file")));
    19141920} /* PDoc::IDERemoveFile */
    19151921
    19161922void PDoc::IDEMake()
     
    19251931
    19261932    entry_ref ide;
    19271933    if (be_roster->FindApp("application/x-mw-BeIDE", &ide))
    1928         THROW(("BeIDE was not found"));
     1934        THROW((B_TRANSLATE("BeIDE was not found")));
    19291935
    19301936    if (be_roster->IsRunning(&ide))
    19311937    {
     
    19331939        msgr.SendMessage(&msg);
    19341940    }
    19351941    else
    1936         THROW(("BeIDE is not running"));
     1942        THROW((B_TRANSLATE("BeIDE is not running")));
    19371943} /* PDoc::IDEMake */
    19381944
    19391945void PDoc::IDEProject2Group()
     
    19491955    SendToIDE(msg, &reply);
    19501956
    19511957    if (reply.HasInt32("error"))
    1952         THROW(("An error occured while retrieving the project files"));
     1958        THROW((B_TRANSLATE("An error occured while retrieving the project files")));
    19531959    else
    19541960    {
    19551961        PGroupWindow *gw = new PGroupWindow;
     
    19761982} /* PDoc::IDEProject2Group */
    19771983
    19781984const long cmd_AndyFeature = 4000;
    1979 const char kFileName[] = "File", kTextFileRef[] = "TextRef";
     1985const char kFileName[] = B_TRANSLATE("File"), kTextFileRef[] = B_TRANSLATE("TextRef");
    19801986
    19811987/* [zooey]: deactivated, see my comment in OpenPartner()
    19821988bool PDoc::IDEOpenSourceHeader(entry_ref& ref)
  • Sources/PItalicMenuItem.cpp

     
    3434#include "pe.h"
    3535#include "PItalicMenuItem.h"
    3636
     37#undef B_TRANSLATE_CONTEXT
     38#define B_TRANSLATE_CONTEXT "P Italic Menu Item"
     39
    3740PItalicMenuItem::PItalicMenuItem(const char *label, BMessage *message, char shortcut, uint32 modifiers)
    3841    : BMenuItem(label, message, shortcut, modifiers)
    3942{
     
    4851    font_family ff;
    4952    font_style fs;
    5053    font.GetFamilyAndStyle(&ff, &fs);
    51     font.SetFamilyAndStyle(ff, "Italic");
     54    font.SetFamilyAndStyle(ff, B_TRANSLATE("Italic"));
    5255   
    5356    Menu()->SetFont(&font);
    5457   
  • Sources/Utils.cpp

     
    3636#include "Utils.h"
    3737#include "HError.h"
    3838
     39#include <Catalog.h>
     40
     41#undef B_TRANSLATE_CONTEXT
     42#define B_TRANSLATE_CONTEXT "Utils"
     43
    3944//uchar gSelectedMap[256];
    4045//
    4146//void InitSelectedMap()
     
    9499   
    95100    if (!valid)
    96101    {
    97         puts("Invalid region:");
     102        puts(B_TRANSLATE("Invalid region:"));
    98103        rgn.PrintToStream();
    99104
    100105        FILE *f = fopen("pe.log", "w");
     
    104109        time_t t;
    105110        time(&t);
    106111
    107         fprintf(f, "---\ndate: %sInvalid region in pe:\n", ctime(&t));
     112        fprintf(f, B_TRANSLATE("---\ndate: %sInvalid region in pe:\n"), ctime(&t));
    108113       
    109114        BRect b = rgn.Frame();
    110        
    111         fprintf(f, "Frame(%s): %g, %g, %g, %g\n", b.IsValid() ? "valid" : "invalid",
    112             b.left, b.top, b.right, b.bottom);
    113115
     116        if (b.IsValid())
     117          fprintf(f, B_TRANSLATE("Frame(valid): %g, %g, %g, %g\n"), b.left, b.top, b.right, b.bottom);
     118        else
     119          fprintf(f, B_TRANSLATE("Frame(invalid): %g, %g, %g, %g\n"), b.left, b.top, b.right, b.bottom);
     120
    114121        int i;
    115122       
    116123        for (i = 0; i < rgn.CountRects(); i++)
    117124        {
    118125            b = rgn.RectAt(i);
    119             fprintf(f, "Frame(%s): %g, %g, %g, %g\n", b.IsValid() ? "valid" : "invalid",
    120                 b.left, b.top, b.right, b.bottom);
     126            if (b.IsValid())
     127              fprintf(f, B_TRANSLATE("Frame(valid): %g, %g, %g, %g\n"), b.left, b.top, b.right, b.bottom);
     128            else
     129              fprintf(f, B_TRANSLATE("Frame(invalid): %g, %g, %g, %g\n"), b.left, b.top, b.right, b.bottom);
     130
    121131        }
    122132       
    123133        if (rgn.Frame().IsValid())
    124             fputs("Frame was valid", f);
     134            fputs(B_TRANSLATE("Frame was valid"), f);
    125135        else
    126136        {
    127             fputs("Frame Invalid", f);
     137            fputs(B_TRANSLATE("Frame Invalid"), f);
    128138            valid = true;
    129139        }
    130140       
     
    146156    {
    147157        // tracker is not running and we pass the message trough launching it
    148158        if (be_roster->Launch(trackerSignature, &msg) < B_OK)
    149             THROW(("Tracker not running???"));
     159            THROW((B_TRANSLATE("Tracker not running???")));
    150160    }
    151161    else
    152162    {
     
    159169{
    160170    entry_ref ide;
    161171    if (be_roster->FindApp("application/x-mw-BeIDE", &ide))
    162         THROW(("BeIDE was not found"));
     172        THROW((B_TRANSLATE("BeIDE was not found")));
    163173
    164174    if (be_roster->IsRunning(&ide))
    165175    {
     
    167177        msgr.SendMessage(const_cast<BMessage*>(&msg), reply);
    168178    }
    169179    else
    170         THROW(("BeIDE is not running"));   
     180        THROW((B_TRANSLATE("BeIDE is not running")));   
    171181} /* SendToIDE */
    172182
    173183void RelativePath(const entry_ref& a, const entry_ref& b, char* path)
  • Sources/HError.h

     
    3838
    3939#include "HLibHekkel.h"
    4040
     41#include <Catalog.h>
     42
    4143#include <cerrno>
    4244#include <syslog.h>
    4345
     46#undef B_TRANSLATE_CONTEXT
     47#define B_TRANSLATE_CONTEXT "H Error"
     48
    4449#if DEBUG
    4550#   define ASSERT_OR_THROW(x)       ASSERT(x); if (!(x)) throw HErr("Assertion failed at %s:%d: %s", __FILE__, __LINE__, #x)
    4651#else
    4752#   define ASSERT_OR_THROW(x)       if (!(x)) throw HErr("Assertion failed at %s:%d: %s", __FILE__, __LINE__, #x)
    4853#endif
    4954
    50 IMPEXP_LIBHEKKEL const char kDefaultMessage[] = "An OS error occurred: %s";
     55IMPEXP_LIBHEKKEL const char kDefaultMessage[] = B_TRANSLATE("An OS error occurred: %s");
    5156
    5257class IMPEXP_LIBHEKKEL HErr
    5358{
  • Sources/HPreferences.cpp

     
    3838#include "HError.h"
    3939#include "Prefs.h"
    4040
     41#include <Catalog.h>
     42
    4143#define BLOCK       BAutolock lock(fLock); if (! lock.IsLocked()) return
    4244
     45#undef B_TRANSLATE_CONTEXT
     46#define B_TRANSLATE_CONTEXT "h Preference"
     47
    4348HPreferences *gPrefs = NULL;
    4449
    4550HPreferences::HPreferences(const char *preffilename)
     
    320325    f = fopen(fFile, "w");
    321326   
    322327    if (!f)
    323         throw HErr("Could not create settings file");
     328        throw HErr(B_TRANSLATE("Could not create settings file"));
    324329   
    325330    PrefMap::iterator pi;
    326331   
  • Sources/CFtpDialog.cpp

     
    3333    Created: 11/14/98 13:50:36
    3434*/
    3535
     36#include <Catalog.h>
     37
    3638#include "pe.h"
    3739#include "PApp.h"
    3840#include "CFtpDialog.h"
     
    5658typedef int socklen_t;
    5759#endif
    5860
     61#undef B_TRANSLATE_CONTEXT
     62#define B_TRANSLATE_CONTEXT "C Ftp Dialog"
     63
    5964static string sfPassword;
    6065
    6166const unsigned long
     
    202207
    203208void CFtpDialog::Layout(void)
    204209{
    205     fServerName->ResizeLocalized("Host:");
    206     fUserName->ResizeLocalized("Username:");
    207     fPassword->ResizeLocalized("Password:");
    208     fUsePassive->ResizeLocalized("Passive Mode");
    209     fConnectButton->ResizeLocalized("Connect");
    210     fCancelButton->ResizeLocalized("Cancel");
    211     fOkButton->ResizeLocalized("Open");
    212     fShowDotted->ResizeLocalized("Show All!");
     210    fServerName->ResizeLocalized(B_TRANSLATE("Host:"));
     211    fUserName->ResizeLocalized(B_TRANSLATE("Username:"));
     212    fPassword->ResizeLocalized(B_TRANSLATE("Password:"));
     213    fUsePassive->ResizeLocalized(B_TRANSLATE("Passive Mode"));
     214    fConnectButton->ResizeLocalized(B_TRANSLATE("Connect"));
     215    fCancelButton->ResizeLocalized(B_TRANSLATE("Cancel"));
     216    fOkButton->ResizeLocalized(B_TRANSLATE("Open"));
     217    fShowDotted->ResizeLocalized(B_TRANSLATE("Show All!"));
    213218    fDirectoryField->ResizeLocalized();
    214219    fFileName->ResizeLocalized();
    215220
     
    302307    else
    303308        fFileName->SetText(name);
    304309
    305     fOkButton->SetLabel("Save");
     310    fOkButton->SetLabel(B_TRANSLATE("Save"));
    306311
    307     SetTitle("Save on Server");
     312    SetTitle(B_TRANSLATE("Save on Server"));
    308313} // CFtpDialog::MakeItSave
    309314
    310315bool CFtpDialog::OkClicked()
     
    456461void CFtpDialog::GetReply()
    457462{
    458463    if (! s_gets(fReply, 1024, fSocketFD))
    459         THROW(("Read error"));
     464        THROW((B_TRANSLATE("Read error")));
    460465
    461466    char *m;
    462467    int r = strtoul(fReply, &m, 10);
     
    467472        do
    468473        {
    469474            if (! s_gets(fReply, 1024, fSocketFD))
    470                 THROW(("Read error"));
     475                THROW((B_TRANSLATE("Read error")));
    471476            r2 = strtoul(fReply, &m, 10);
    472477        }
    473478        while (m == NULL || r2 != r || *m != ' ');
     
    476481
    477482inline void FailSockErr(int e)
    478483{
    479     if (e < 0) THROW(("Network error: %s", strerror(errno)));
     484    if (e < 0) THROW((B_TRANSLATE("Network error: %s"), strerror(errno)));
    480485} /* FailSockErr */
    481486
    482487void CFtpDialog::Connect()
     
    491496
    492497        fSocket = socket(AF_INET, SOCK_STREAM, 0);
    493498        if (fSocket < 0)
    494             THROW(("Failed to get socket: %s", strerror(errno)));
     499            THROW((B_TRANSLATE("Failed to get socket: %s"),
     500                   strerror(errno)));
    495501
    496502        fSocketFD = s_open(fSocket, "r+");
    497503        FailNil(fSocketFD);
     
    500506
    501507        struct hostent *host;
    502508        if ((host = gethostbyname(GetText("srvr"))) == NULL)
    503             THROW(("Failed to get server address: %s", strerror(errno)));
     509            THROW((B_TRANSLATE("Failed to get server address: %s"),
     510                   strerror(errno)));
    504511
    505512        struct sockaddr_in sa;
    506513        sa.sin_family = AF_INET;
     
    518525            {
    519526                case 1:
    520527                    if (*fReply != '2')
    521                         THROW(("Connect failed: %s", fReply));
     528                        THROW((
     529                        B_TRANSLATE("Connect failed: %s"), fReply));
    522530                    s_printf(fSocketFD, "user %s\r\n", GetText("user"));
    523531                    state = 2;
    524532                    break;
     
    531539                        break;
    532540                    }
    533541                    else if (*fReply != '2' && *fReply != '5')
    534                         THROW(("Failed to login: %s", fReply));
     542                        THROW((
     543                        B_TRANSLATE("Failed to login: %s"), fReply));
    535544
    536545                    // fall thru
    537546
    538547                case 3:
    539548                    if (*fReply == '5')
    540                         THROW(("Incorrect username/password.\n%s", fReply));
     549                        THROW((
     550                        B_TRANSLATE("Incorrect username/password.\n%s"), fReply));
    541551                    if (state == 3 && *fReply != '2')
    542                         THROW(("Failed to login: %s", fReply));
     552                        THROW((B_TRANSLATE("Failed to login: %s"), fReply));
    543553
    544554                    state = 0;
    545555                    break;
     
    612622
    613623        data = socket(AF_INET, SOCK_STREAM, 0);
    614624        if (data < 0)
    615             THROW(("Failed to get socket: %s", strerror(errno)));
     625            THROW((B_TRANSLATE("Failed to get socket: %s"),
     626                   strerror(errno)));
    616627
    617628        memset(&saData, 0, sizeof(saData));
    618629        saData.sin_family = AF_INET;
     
    642653                                            &size));
    643654            unsigned char *sap = (unsigned char *)&saCmd.sin_addr.s_addr;
    644655            // combine both into the PORT-command:
    645             s_printf(fSocketFD, "port %d,%d,%d,%d,%d,%d\r\n", sap[0], sap[1],
     656            s_printf(fSocketFD, B_TRANSLATE("port %d,%d,%d,%d,%d,%d\r\n"), sap[0], sap[1],
    646657                        sap[2], sap[3], pap[0], pap[1]);
    647658        }
    648659
     
    660671                        unsigned int sap[4];
    661672                        unsigned int pap[2];
    662673                        if (*fReply != '2')
    663                             THROW(("Pasv command failed: %s", fReply));
     674                            THROW((B_TRANSLATE("Pasv command failed: %s"), fReply));
    664675                        char* pos = strchr(fReply,'(');
    665676                        if (!pos)
    666                             THROW(("Answer to Pasv has unknown format: %s", fReply));
     677                            THROW((B_TRANSLATE("Answer to Pasv has unknown format: %s"), fReply));
    667678                        int cnt = sscanf(pos+1, "%u,%u,%u,%u,%u,%u",
    668679                                              &sap[0], &sap[1], &sap[2], &sap[3],
    669680                                              &pap[0], &pap[1]);
    670681                        if (cnt != 6)
    671                             THROW(("Could not parse answer to Pasv (%d of 6): %s",
     682                            THROW((B_TRANSLATE("Could not parse answer to Pasv (%d of 6): %s"),
    672683                                     cnt, fReply));
    673684                        char ipAddr[20];
    674685                        sprintf(ipAddr, "%d.%d.%d.%d", sap[0], sap[1], sap[2], sap[3]);
     
    678689                        dsf = s_open(data, "r+");
    679690                    } else {
    680691                        if (*fReply != '2')
    681                             THROW(("Port command failed: %s", fReply));
     692                            THROW((B_TRANSLATE("Port command failed: %s"), fReply));
    682693                    }
    683694                    s_printf(fSocketFD, "list\r\n");
    684695                    state = 2;
     
    712723                                    delete item;
    713724                            }
    714725                            if (entryCount == 0)
    715                                 THROW(("Could not get listing."));
     726                                THROW((B_TRANSLATE("Could not get listing.")));
    716727
    717728                            fListView->Invalidate();
    718729                            UpdateIfNeeded();
     
    731742                        state = 3;
    732743                    }
    733744                    else
    734                         THROW(("Failed to get listing: %s", fReply));
     745                        THROW((B_TRANSLATE("Failed to get listing: %s"), fReply));
    735746                    break;
    736747
    737748                case 3:
    738749                    if (*fReply != '2')
    739                         THROW(("Something went wrong fetching the directory listing"));
     750                        THROW((B_TRANSLATE("Something went wrong fetching the directory listing")));
    740751                    state = 0;
    741752                    break;
    742753            }
     
    766777        GetReply();
    767778
    768779        if (*fReply != '2')
    769             THROW(("Changing directory failed.\n%s", fReply));
     780            THROW((B_TRANSLATE("Changing directory failed.\n%s"), fReply));
    770781
    771782        ListDirectory();
    772783    }
     
    793804        GetReply();
    794805
    795806        if (*fReply != '2')
    796             THROW(("Could not get current working directory.\n%s", fReply));
     807            THROW((B_TRANSLATE("Could not get current working directory.\n%s"), fReply));
    797808
    798809        char *e;
    799810        int n;
  • Sources/CRegex.cpp

     
    33    Copyright 2005 Oliver Tappe - published under the MIT license.
    44*/
    55
     6#include <Catalog.h>
     7
    68#include "pe.h"
    79
    810#include "CRegex.h"
    911
     12#undef B_TRANSLATE_CONTEXT
     13#define B_TRANSLATE_CONTEXT "C Regex"
     14
    1015const status_t krx_NoMatch = PCRE_ERROR_NOMATCH;
    1116const status_t krx_NotBOL = PCRE_NOTBOL;
    1217const status_t krx_NotEOL = PCRE_NOTEOL;
     
    152157{
    153158    if (!patt || !strlen(patt))
    154159    {
    155         fErrorStr = "Pattern is empty!";
     160        fErrorStr = B_TRANSLATE("Pattern is empty!");
    156161        return B_BAD_VALUE;
    157162    }
    158163    uint32 options = PCRE_UTF8 | PCRE_MULTILINE;
  • Sources/MAlert.cpp

     
    55
    66#include "MAlert.h"
    77
     8#include <Catalog.h>
    89#include <Beep.h>
    910
    1011
     12#undef B_TRANSLATE_CONTEXT
     13#define B_TRANSLATE_CONTEXT "M Alert"
    1114
     15
    1216bool MAlert::sAlertIsNoisy = FALSE;
    1317
    1418bool
     
    5963    else
    6064    {
    6165        fNumButtons = 1;
    62         a1 = "OK";
     66        a1 = B_TRANSLATE("OK");
    6367        a2 = NULL;
    6468        a3 = NULL;
    6569    }
    66     fAlert = new BAlert("Alert", message, a1, a2, a3,
     70    fAlert = new BAlert(B_TRANSLATE("Alert"), message, a1, a2, a3,
    6771        B_WIDTH_AS_USUAL, type);
    6872
    6973    // The Escape key shall trigger the second button from the right
  • Sources/PAbout.cpp

     
    4343#   include "PApp.h"
    4444#endif
    4545
     46#include <Catalog.h>
     47
     48#undef B_TRANSLATE_CONTEXT
     49#define B_TRANSLATE_CONTEXT "P About"
     50
    4651const char kAboutText[] =
     52        B_TRANSLATE_MARK(
    4753        "Pe 2.4.3 Open Source Version\n\n"
    4854        "a high performance editor\n"
    4955        "created by Maarten Hekkelman.\n"
     
    7682        "Oscar Lesta\n"
    7783        "Rainer Riedl\n"
    7884        "Stephan Aßmus\n\n\n"
    79         "...and thanks to everyone we forgot, too!\n\n";
     85        "...and thanks to everyone we forgot, too!\n\n");
    8086
    8187#ifdef __HAIKU__
    82 const char kAboutText2[] = "Haiku Rules!";
     88const char kAboutText2[] = B_TRANSLATE_MARK("Haiku Rules!");
    8389#else
    84 const char kAboutText2[] = "BeOS Rules!";
     90const char kAboutText2[] = B_TRANSLATE_MARK("BeOS Rules!");
    8591#endif
    8692
    8793#if STANDALONE
  • Sources/CLanguageAddOn.cpp

     
    3333    Created: 12/07/97 22:53:14 by Maarten Hekkelman
    3434*/
    3535
     36#include <Catalog.h>
     37
    3638#include "pe.h"
    3739#include "PText.h"
    3840#include "PApp.h"
     
    4648#include "HError.h"
    4749#include "HColorUtils.h"
    4850
     51#undef B_TRANSLATE_CONTEXT
     52#define B_TRANSLATE_CONTEXT ""
     53
    4954CLanguageProxy::CLanguageProxy(CLanguageInterface& intf, const char *text, int size,
    5055    int *starts, rgb_color *colors)
    5156    : fText(text)
     
    114119void CLanguageProxy::AddFunction(const char *name, const char *match,
    115120    int offset, bool italic, const char *params)
    116121{
    117     FailNilMsg(fFunctionScanHandler, "Not a valid call in this context");
     122    FailNilMsg(fFunctionScanHandler, B_TRANSLATE("Not a valid call in this context"));
    118123    fFunctionScanHandler->AddFunction(name, match, offset, italic, fNestLevel, params);
    119124} /* CLanguageProxy::AddFunction */
    120125
    121126void CLanguageProxy::AddInclude(const char *name, const char *open, bool italic)
    122127{
    123     FailNilMsg(fFunctionScanHandler, "Not a valid call in this context");
     128    FailNilMsg(fFunctionScanHandler, B_TRANSLATE("Not a valid call in this context"));
    124129    fFunctionScanHandler->AddInclude(name, open, italic);
    125130} /* CLanguageProxy::AddFunction */
    126131
    127132void CLanguageProxy::AddSeparator(const char* nm)
    128133{
    129     FailNilMsg(fFunctionScanHandler, "Not a valid call in this context");
     134    FailNilMsg(fFunctionScanHandler, B_TRANSLATE("Not a valid call in this context"));
    130135    BString name;
    131136    if (nm) {
    132137        while(isspace(*nm) || *nm=='-')
  • Sources/PMessageWindow.cpp

     
    4545#include "HDefines.h"
    4646#include "PMessages.h"
    4747
     48#include <Catalog.h>
     49
     50#undef B_TRANSLATE_CONTEXT
     51#define B_TRANSLATE_CONTEXT "P Message Window"
     52
    4853BBitmap *PMessageItem::sfInfoIcon = NULL;
    4954BBitmap *PMessageItem::sfInfoIconSelected = NULL;
    5055BBitmap *PMessageItem::sfErrorIcon = NULL;
     
    5762    unsigned char *icon;
    5863   
    5964    icon = (unsigned char *)HResources::GetResource('MICN', id);
    60     if (!icon) THROW(("Missing or corrupted MICN resource #%d", id));
     65    if (!icon) THROW((B_TRANSLATE("Missing or corrupted MICN resource #%d"), id));
    6166   
    6267    normal = new BBitmap(BRect(0, 0, 15, 15), B_COLOR_8_BIT);
    6368    FailNil(normal);
  • Sources/PTextBuffer.cpp

     
    3636#include "Utils.h"
    3737#include "HError.h"
    3838
     39#include <Catalog.h>
     40
     41#undef B_TRANSLATE_CONTEXT
     42#define B_TRANSLATE_CONTEXT "P Text Buffer"
     43
    3944const int
    4045    kBlockSize = 2048;
    4146
     
    222227{
    223228    char t[4];
    224229    memcpy(t, fText + fPhysicalSize, 4);
    225     printf("logical size: %d, physical size: %d, gap: %d, gapsize: %d, trailer: %4.4s\n",
     230    printf(B_TRANSLATE("logical size: %d, physical size: %d, gap: %d, gapsize: %d, trailer: %4.4s\n"),
    226231        fLogicalSize, fPhysicalSize, fGap, fGapSize, t);
    227232} /* PTextBuffer::PrintToStream */
    228233
  • Sources/HLazyObject.cpp

     
    3535
    3636#include "pe.h"
    3737#include "HLazyObject.h"
     38
     39#include <Catalog.h>
     40
    3841#include <memory>
    3942
     43#undef B_TRANSLATE_CONTEXT
     44#define B_TRANSLATE_CONTEXT "H Lazy Object"
     45
    4046HLazyObject::HLazyObject(BLooper *looper)
    4147{
    4248    looper->AddHandler(this);
     
    8187        default:
    8288        {
    8389            BMessage reply;
    84             reply.AddString("Error", "Don't know what to do with this message");
     90            reply.AddString("Error", B_TRANSLATE("Don't know what to do with this message"));
    8591            msg->SendReply(&reply);
    8692            break;
    8793        }
     
    9399    BMessage reply;
    94100   
    95101    char s[256];
    96     sprintf(s, "Sorry, but I don't have a property called \"%s\"", property);
     102    sprintf(s, B_TRANSLATE("Sorry, but I don't have a property called \"%s\""), property);
    97103    reply.AddString("Error", s);
    98104
    99105    msg->SendReply(&reply);
     
    104110    BMessage reply;
    105111
    106112    char s[256];
    107     sprintf(s, "Sorry, but I don't have a property called \"%s\"", property);
     113    sprintf(s, B_TRANSLATE("Sorry, but I don't have a property called \"%s\""), property);
    108114    reply.AddString("Error", s);
    109115
    110116    msg->SendReply(&reply);
  • Sources/PProjectWindow.cpp

     
    3535
    3636#include "pe.h"
    3737
     38#include <Catalog.h>
    3839#include <stack>
    3940
    4041#include <fs_attr.h>
     
    6061#include "ResourcesToolbars.h"
    6162#include "Utils.h"
    6263
     64#undef B_TRANSLATE_CONTEXT
     65#define B_TRANSLATE_CONTEXT "P Project Window"
     66
    6367const unsigned long msg_Done = 'done';
    6468
    6569PProjectWindow*
     
    271275    try
    272276    {
    273277        if (!fPrjFile)
    274             THROW(("No project available"));
     278            THROW((B_TRANSLATE("No project available")));
    275279
    276280        fPrjFile->Save();
    277281        SetDirty(false);
     
    315319
    316320const char* PProjectWindow::DefaultName() const
    317321{
    318     return "Untitled Project";
     322    return B_TRANSLATE("Untitled Project");
    319323}
    320324
    321325const char* PProjectWindow::ErrorMsg() const
     
    406410        }
    407411
    408412        fPanel = new BFilePanel(B_OPEN_PANEL, new BMessenger(this), &ref);
    409         fPanel->SetButtonLabel(B_DEFAULT_BUTTON, "Add");
     413        fPanel->SetButtonLabel(B_DEFAULT_BUTTON, B_TRANSLATE("Add"));
    410414        fPanel->Show();
    411415    }
    412416} /* PProjectWindow::AddFiles */
     
    434438                    = dynamic_cast<CProjectGroupItem*>(projectItem->ModelItem());
    435439                if (projectGroupItem) {
    436440                    BAlert* alert
    437                         = new BAlert( "Pe Message",
    438                                           "You can't remove a group-item",
    439                                           "Ah, Ok", NULL, NULL,
     441                        = new BAlert( B_TRANSLATE("Pe Message"),
     442                                          B_TRANSLATE("You can't remove a group-item"),
     443                                          B_TRANSLATE("Ah, Ok"), NULL, NULL,
    440444                                          B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
    441445                                          B_WARNING_ALERT);
    442446                    alert->SetShortcut( 0, B_ESCAPE);