Ticket #7233: pe-Sources-localization.patch
File pe-Sources-localization.patch, 95.6 KB (added by , 13 years ago) |
---|
-
Sources/Pe.rdef
1 /* 2 * Pe.rdef 3 */ 4 5 resource app_signature "application/x-vnd.Haiku-Pe"; 6 7 resource 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
33 33 Created: 09/19/97 10:49:36 34 34 */ 35 35 36 #include <Catalog.h> 37 36 38 #include "pe.h" 37 39 #include "PText.h" 38 40 #include "CLanguageInterface.h" … … 49 51 #include <algorithm> 50 52 51 53 54 #undef B_TRANSLATE_CONTEXT 55 #define B_TRANSLATE_CONTEXT "C Language Interface" 56 52 57 using std::map; 53 58 54 59 … … 76 81 77 82 ext::ext(const char *e) 78 83 { 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)); 80 85 81 86 strcpy(t, e); 82 87 } /* CLanguageInterface::ext::ext */ … … 99 104 if (sfWordBreakTable == NULL) 100 105 { 101 106 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!"))); 103 108 } 104 109 105 110 // fImage = -1; … … 108 113 fScanForFunctions = NULL; 109 114 fColorLine = NULL; 110 115 fFindNextWord = NULL; 111 fLanguage = "None";116 fLanguage = B_TRANSLATE("None"); 112 117 fExtensions = ""; 113 118 fKeywordFile = NULL; 114 119 fLineCommentStart = fLineCommentEnd = ""; … … 121 126 if (sfWordBreakTable == NULL) 122 127 { 123 128 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!"))); 125 130 } 126 131 127 132 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))); 129 134 130 135 if (get_image_symbol(fImage, "Balance", B_SYMBOL_TYPE_TEXT, (void**)&fBalance) != B_OK) 131 136 fBalance = NULL; … … 144 149 get_image_symbol(fImage, "kInterfaceVersion", B_SYMBOL_TYPE_DATA, (void**)&versionPtr); 145 150 fInterfaceVersion = versionPtr ? *versionPtr : 1; 146 151 if (fInterfaceVersion < 2) { 147 BString err( "Unsupported Language:\n");152 BString err(B_TRANSLATE("Unsupported Language:\n")); 148 153 err << path; 149 154 THROW((err.String())); 150 155 } … … 207 212 if (next > B_ERROR && 208 213 (err = get_image_symbol(next, "kLanguageName", B_SYMBOL_TYPE_DATA, (void**)&l)) == B_OK) 209 214 { 210 if (strlen(l) > 28) THROW(( "Language name too long"));215 if (strlen(l) > 28) THROW((B_TRANSLATE("Language name too long"))); 211 216 CLanguageInterface *intf = new CLanguageInterface(plug, next); 212 217 fInterfaces.push_back(intf); 213 218 … … 573 578 { 574 579 char extPref[64]; 575 580 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)); 577 582 strcpy(extPref, fLanguage); 578 583 strcat(extPref, ".ext"); 579 584 … … 592 597 593 598 void CLanguageInterface::ChooseDefault() 594 599 { 595 const char *d = gPrefs->GetPrefString(prf_S_DefLang, "None");600 const char *d = gPrefs->GetPrefString(prf_S_DefLang, B_TRANSLATE("None")); 596 601 vector<CLanguageInterface*>::iterator i; 597 602 598 603 for (i = fInterfaces.begin(); i != fInterfaces.end(); i++) … … 705 710 706 711 BEntry e; 707 712 FailOSErrMsg(e.SetTo(p.String(), B_FILE_NODE), 708 "Settings directory was not found?");713 B_TRANSLATE("Settings directory was not found?")); 709 714 710 715 BString keywords; 711 716 if (!e.Exists()) … … 723 728 size_t s; 724 729 const char *r = (const char*)res.LoadResource('KeyW', fKeywordFile, &s); 725 730 726 if (!r) THROW(( "Missing resource"));731 if (!r) THROW((B_TRANSLATE("Missing resource"))); 727 732 728 733 BFile txtfile(p.String(), B_CREATE_FILE | B_READ_WRITE); 729 734 CheckedWrite(txtfile, r, s); -
Sources/HStream.h
40 40 41 41 #include "HError.h" 42 42 43 #include <Catalog.h> 44 45 #undef B_TRANSLATE_CONTEXT 46 #define B_TRANSLATE_CONTEXT "H Stream" 47 43 48 template <class S> 44 49 class HStream 45 50 { … … 109 114 inline IMPEXP_LIBHEKKEL BPositionIO& operator>>(BPositionIO& s, D& d) 110 115 { 111 116 if (s.Read(&d, sizeof(D)) != sizeof(D)) 112 throw HErr( "Error reading");117 throw HErr(B_TRANSLATE("Error reading")); 113 118 return s; 114 119 } /* operator>> */ 115 120 … … 123 128 inline IMPEXP_LIBHEKKEL BPositionIO& operator<<(BPositionIO& s, const D& d) 124 129 { 125 130 if (s.Write(&d, sizeof(D)) != sizeof(D)) 126 throw HErr( "Error writing");131 throw HErr(B_TRANSLATE("Error writing")); 127 132 return s; 128 133 } /* operator<< */ 129 134 … … 132 137 { 133 138 int sl = strlen(string) + 1; 134 139 if (stream.Write(string, sl) != sl) 135 throw HErr( "Error writing");140 throw HErr(B_TRANSLATE("Error writing")); 136 141 return stream; 137 142 } /* operator<< */ 138 143 -
Sources/utf-support.cpp
35 35 36 36 #include "pe.h" 37 37 38 #include <Catalog.h> 38 39 #include <String.h> 39 40 40 41 #include "HAppResFile.h" … … 42 43 #include "ResourcesUtf.h" 43 44 #include "utf-support.h" 44 45 46 #undef B_TRANSLATE_CONTEXT 47 #define B_TRANSLATE_CONTEXT "Utf Support" 48 45 49 unsigned char *alphaTable, *numTable, *alnumTable; 46 50 47 51 unsigned short *mappings[11]; … … 272 276 int maptounicode(int charset, char ch) 273 277 { 274 278 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)); 276 280 277 281 return mappings[charset - 1][(int)(unsigned char)ch]; 278 282 } /* maptounicode */ … … 408 412 if (IsSupportedEncoding(encoding)) 409 413 return gEncodings[encoding]; 410 414 else 411 return "<unknown encoding>";415 return B_TRANSLATE("<unknown encoding>"); 412 416 } 413 417 414 418 CTextEncodingConverter::CTextEncodingConverter() -
Sources/CListBox.cpp
33 33 Created: 10/20/97 20:08:37 34 34 */ 35 35 36 #include <Catalog.h> 37 36 38 #include "pe.h" 37 39 #include "CListBox.h" 38 40 #include "PMessages.h" … … 41 43 #include "HDefines.h" 42 44 #include "HDialog.h" 43 45 46 #undef B_TRANSLATE_CONTEXT 47 #define B_TRANSLATE_CONTEXT "C List Box" 48 44 49 const unsigned long 45 50 msg_LBAdd = 'lbAd', 46 51 msg_LBChange = 'lbCn', … … 67 72 float dy = 30 * gFactor; 68 73 b.bottom = b.top + 20 * gFactor; 69 74 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))); 71 76 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))); 73 78 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))); 75 80 76 81 fSelfChange = false; 77 82 } // CListBox::CListBox -
Sources/PGlossyWindow.cpp
45 45 #include "HPreferences.h" 46 46 #include "Prefs.h" 47 47 48 #include <Catalog.h> 49 50 #undef B_TRANSLATE_CONTEXT 51 #define B_TRANSLATE_CONTEXT "P Glossy Window" 52 48 53 PGlossyWindow *gGlossyWindow = NULL; 49 54 50 55 class PGlossyItem : public BListItem { … … 117 122 118 123 PGlossyWindow::PGlossyWindow() 119 124 : BWindow(gPrefs->GetPrefRect(prf_R_GlossaryPosition, BRect(100, 100, 200, 300)), 120 "Glossary", B_TITLED_WINDOW,125 B_TRANSLATE("Glossary"), B_TITLED_WINDOW, 121 126 B_WILL_ACCEPT_FIRST_CLICK | B_NOT_ZOOMABLE) 122 127 { 123 128 BRect r(Bounds()); … … 248 253 249 254 file >> s; 250 255 251 if (strncmp(s, "### ", 4)) THROW(( "Invalid glossary file"));256 if (strncmp(s, "### ", 4)) THROW((B_TRANSLATE("Invalid glossary file"))); 252 257 253 258 file >> s; 254 259 while (*s && strncmp(s, "##", 2) == 0) -
Sources/CMimeBox.cpp
33 33 Created: 10/23/97 09:38:06 34 34 */ 35 35 36 #include <Catalog.h> 37 36 38 #include "pe.h" 37 39 #include "CListBox.h" 38 40 #include "CMimeBox.h" … … 43 45 #include "HPreferences.h" 44 46 #include "Prefs.h" 45 47 48 #undef B_TRANSLATE_CONTEXT 49 #define B_TRANSLATE_CONTEXT "C Mime Box" 50 46 51 const unsigned long 47 52 msg_MimeChanged = 'MChg', 48 53 msg_MimeFind = 'MFnd', … … 156 161 r.bottom = Bounds().bottom; 157 162 158 163 // r.right -= 70; 159 AddChild(fEdit = new BTextControl(r, "edit mime", "Mimetype:",164 AddChild(fEdit = new BTextControl(r, "edit mime", B_TRANSLATE("Mimetype:"), 160 165 NULL, new BMessage(msg_MimeChanged))); 161 166 162 fEdit->SetDivider(be_plain_font->StringWidth( "Mimetype:") + 4);167 fEdit->SetDivider(be_plain_font->StringWidth(B_TRANSLATE("Mimetype:")) + 4); 163 168 fEdit->SetModificationMessage(new BMessage(msg_MimeChanged)); 164 169 165 170 r.left = r.right + 10; 166 171 r.right = r.left + 60; 167 172 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))); 169 174 170 175 fAdd->SetEnabled(false); 171 176 fChange->SetEnabled(false); … … 285 290 { 286 291 fPanel = new BFilePanel(B_OPEN_PANEL, new BMessenger(this), 287 292 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")); 289 294 fPanel->Show(); 290 295 } 291 296 break; -
Sources/PStatus.cpp
33 33 34 34 #include "pe.h" 35 35 36 #include <Catalog.h> 37 36 38 #include "PText.h" 37 39 #include "PStatus.h" 38 40 #include "Utils.h" … … 43 45 #include "HError.h" 44 46 #include "HDefines.h" 45 47 48 #undef B_TRANSLATE_CONTEXT 49 #define B_TRANSLATE_CONTEXT "P Status" 50 46 51 PStatus::PStatus(BRect frame, PText *txt) 47 52 : BView(frame, "status", B_FOLLOW_BOTTOM | B_FOLLOW_LEFT, B_WILL_DRAW) 48 53 { … … 135 140 136 141 if (fPath) 137 142 { 138 BPopUpMenu popup( "no title");143 BPopUpMenu popup(B_TRANSLATE("no title")); 139 144 popup.SetFont(be_plain_font); 140 145 141 146 char *s = strdup(fPath), *d; -
Sources/PGroupWindow.cpp
33 33 34 34 #include "pe.h" 35 35 36 #include <Catalog.h> 36 37 #include <fs_attr.h> 37 38 #include <String.h> 38 39 … … 54 55 #include "ResourcesToolbars.h" 55 56 #include "Utils.h" 56 57 58 #undef B_TRANSLATE_CONTEXT 59 #define B_TRANSLATE_CONTEXT "P Group Window" 57 60 58 61 const unsigned long msg_Done = 'done'; 59 62 … … 258 261 try 259 262 { 260 263 if (docText.Compare("### pe Group File\n", 18) != 0) 261 THROW(( "Not a group file!"));264 THROW((B_TRANSLATE("Not a group file!"))); 262 265 263 266 if (!EntryRef()) 264 THROW(( "Can only read local groups"));267 THROW((B_TRANSLATE("Can only read local groups"))); 265 268 266 269 node_ref nref; 267 270 nref.device = EntryRef()->device; … … 397 400 398 401 const char* PGroupWindow::DefaultName() const 399 402 { 400 return "Untitled Group";403 return B_TRANSLATE("Untitled Group"); 401 404 } 402 405 403 406 PEntryItem* PGroupWindow::AddRef(entry_ref& ref) … … 437 440 } 438 441 439 442 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")); 441 444 fPanel->Show(); 442 445 } 443 446 } /* PGroupWindow::AddFiles */ -
Sources/CGlossary.cpp
33 33 Created: 09/10/97 15:20:13 34 34 */ 35 35 36 #include <Catalog.h> 37 36 38 #include "pe.h" 37 39 #include "CGlossary.h" 38 40 #include "PApp.h" … … 40 42 #include "Utils.h" 41 43 #include "HError.h" 42 44 45 #undef B_TRANSLATE_CONTEXT 46 #define B_TRANSLATE_CONTEXT "C Glossary" 47 43 48 CGlossary *gGlossary; 44 49 45 50 CGlossary::CGlossary() … … 180 185 181 186 fgets(s, 255, file); 182 187 183 if (strncmp(s, "### ", 4)) THROW(( "Invalid glossary file"));188 if (strncmp(s, "### ", 4)) THROW((B_TRANSLATE("Invalid glossary file"))); 184 189 185 190 fgets(s, 255, file); 186 191 while (!feof(file) && strncmp(s, "##", 2) == 0) … … 208 213 else if (tolower(*kp) == 'f') 209 214 key |= strtol(kp + 1, &kp, 10) + 1 | 0x0100; 210 215 else 211 THROW(( "Incorrect Glossary File, unrecognized keyword %s", kp));216 THROW((B_TRANSLATE("Incorrect Glossary File, unrecognized keyword %s"), kp)); 212 217 213 218 kp = strtok(NULL, " -\n"); 214 219 } -
Sources/HDialog.h
36 36 #ifndef HDIALOG_H 37 37 #define HDIALOG_H 38 38 39 #include <Catalog.h> 40 39 41 #include "HLibHekkel.h" 40 42 41 43 #include "HStream.h" 42 44 #include "HAppResFile.h" 43 45 #include "HPreferences.h" 44 46 47 #undef B_TRANSLATE_CONTEXT 48 #define B_TRANSLATE_CONTEXT "H Dialog" 49 45 50 struct IMPEXP_LIBHEKKEL dRect { 46 51 short left, top, right, bottom; 47 52 … … 79 84 { 80 85 size_t size; 81 86 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")); 83 88 BMemoryIO buf(p, size); 84 89 85 90 T *d = CreateDialog(owner, buf, placement); -
Sources/PCmd.cpp
43 43 #include "PApp.h" 44 44 #include "PErrorWindow.h" 45 45 46 #include <Catalog.h> 47 48 #undef B_TRANSLATE_CONTEXT 49 #define B_TRANSLATE_CONTEXT "P Cmd" 50 46 51 PCmd::PCmd(const char *str, PText *txt) 47 52 { 48 53 fStr = strdup(str); … … 72 77 #pragma mark - Copy 73 78 74 79 PCutCmd::PCutCmd(PText *txt, int append) 75 : PCmd( "Cut", txt)80 : PCmd(B_TRANSLATE("Cut"), txt) 76 81 { 77 82 fSavedTxt = NULL; 78 83 fAnchor = txt->Anchor(); … … 112 117 #pragma mark - 113 118 114 119 PClearCmd::PClearCmd(PText *txt) 115 : PCmd( "Clear", txt)120 : PCmd(B_TRANSLATE("Clear"), txt) 116 121 { 117 122 fSavedTxt = NULL; 118 123 fAnchor = txt->Anchor(); … … 151 156 #pragma mark - 152 157 153 158 PPasteCmd::PPasteCmd(PText *txt) 154 : PCmd( "Paste", txt)159 : PCmd(B_TRANSLATE("Paste"), txt) 155 160 { 156 161 fSavedTxt = NULL; 157 162 } /* PPasteCmd::PPasteCmd */ … … 214 219 215 220 #pragma mark --- Typing Command --- 216 221 PTypingCmd::PTypingCmd(PText *txt) 217 : PCmd( "Typing", txt)222 : PCmd(B_TRANSLATE("Typing"), txt) 218 223 { 219 224 } /* PTypingCmd::PTypingCmd */ 220 225 … … 353 358 #pragma mark --- Drop Command --- 354 359 355 360 PDropCmd::PDropCmd(PText *txt, const char *data, ssize_t dataLen, int srcLoc, int dstLoc) 356 : PCmd( "Drop", txt)361 : PCmd(B_TRANSLATE("Drop"), txt) 357 362 { 358 363 fData = (char *)malloc(fDataLen = dataLen); 359 364 FailNil(fData); … … 518 523 #pragma mark --- PReplaceCmd 519 524 520 525 PReplaceCmd::PReplaceCmd(PText *txt, int offset, int size, bool findNext, bool backward) 521 : PCmd( "Replace", txt)526 : PCmd(B_TRANSLATE("Replace"), txt) 522 527 { 523 528 fOffset = offset; 524 529 fSize = size; … … 593 598 #pragma mark --- PReplaceAllCmd 594 599 595 600 PReplaceAllCmd::PReplaceAllCmd(PText *txt) 596 : PCmd( "Replace All", txt)601 : PCmd(B_TRANSLATE("Replace All"), txt) 597 602 { 598 603 fFind = strdup(gFindDialog->FindString()); 599 604 fRepl = strdup(gFindDialog->ReplaceString()); … … 706 711 kBufferSize = 1024; 707 712 708 713 PScriptCmd::PScriptCmd(PText *txt, const char *script) 709 : PCmd( "Script", txt)714 : PCmd(B_TRANSLATE("Script"), txt) 710 715 { 711 716 char buf[PATH_MAX]; 712 717 … … 958 963 } /* PShiftCmd::LastLine */ 959 964 960 965 PShiftLeftCmd::PShiftLeftCmd(PText *txt) 961 : PShiftCmd( "Shift Left", txt)966 : PShiftCmd(B_TRANSLATE("Shift Left"), txt) 962 967 { 963 968 // count the involved hard lines 964 969 int firstLine = FirstLine(); … … 1061 1066 1062 1067 1063 1068 PShiftRightCmd::PShiftRightCmd(PText *txt) 1064 : PShiftCmd( "Shift Right", txt)1069 : PShiftCmd(B_TRANSLATE("Shift Right"), txt) 1065 1070 { 1066 1071 } /* PShiftRightCmd::PShiftRightCmd */ 1067 1072 … … 1112 1117 #pragma mark --- Twiddle Command --- 1113 1118 1114 1119 PTwiddleCmd::PTwiddleCmd(PText *txt) 1115 : PCmd( "Twiddle", txt)1120 : PCmd(B_TRANSLATE("Twiddle"), txt) 1116 1121 { 1117 1122 fFrom = std::min(fText->Caret(), fText->Anchor()); 1118 1123 fTo = std::max(fText->Caret(), fText->Anchor()); … … 1183 1188 1184 1189 PCommentCmd::PCommentCmd(PText *txt, bool comment, 1185 1190 const char *before, const char *after) 1186 : PCmd(comment ? "Comment" : "Uncomment", txt)1191 : PCmd(comment ? B_TRANSLATE("Comment") : B_TRANSLATE("Uncomment"), txt) 1187 1192 { 1188 1193 fComment = comment; 1189 1194 1190 1195 fFrom = std::min(fText->Caret(), fText->Anchor()); 1191 1196 fTo = std::max(fText->Caret(), fText->Anchor()); 1192 1197 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"))); 1194 1199 1195 1200 strcpy(fBefore, before); 1196 1201 strcpy(fAfter, after); … … 1318 1323 #pragma mark --- Wrap Command --- 1319 1324 1320 1325 PWrapCmd::PWrapCmd(PText *txt) 1321 : PCmd( "Wrap", txt)1326 : PCmd(B_TRANSLATE("Wrap"), txt) 1322 1327 { 1323 1328 fCaret = txt->Caret(); 1324 1329 fAnchor = txt->Anchor(); … … 1358 1363 #pragma mark --- Unwrap Command --- 1359 1364 1360 1365 PUnwrapCmd::PUnwrapCmd(PText *txt) 1361 : PCmd( "Unwrap", txt)1366 : PCmd(B_TRANSLATE("Unwrap"), txt) 1362 1367 { 1363 1368 fCaret = txt->Caret(); 1364 1369 fAnchor = txt->Anchor(); … … 1405 1410 #pragma mark --- Justify Command --- 1406 1411 1407 1412 PJustifyCmd::PJustifyCmd(PText *txt) 1408 : PCmd( "Justify", txt)1413 : PCmd(B_TRANSLATE("Justify"), txt) 1409 1414 { 1410 1415 } /* PJustifyCmd::PJustifyCmd */ 1411 1416 … … 1484 1489 #pragma mark --- Change Case Command --- 1485 1490 1486 1491 PChangeCaseCmd::PChangeCaseCmd(PText *txt, int newCase) 1487 : PCmd( "Change Case", txt)1492 : PCmd(B_TRANSLATE("Change Case"), txt) 1488 1493 { 1489 1494 fText->GetSelectedText(fSavedText); 1490 1495 … … 1603 1608 #pragma mark --- Change Encoding Command --- 1604 1609 1605 1610 PEncodingCmd::PEncodingCmd(PText *txt, int from, int to) 1606 : PCmd( "Change Encoding", txt)1611 : PCmd(B_TRANSLATE("Change Encoding"), txt) 1607 1612 { 1608 1613 fSourceEncoding = from; 1609 1614 fDestEncoding = to; -
Sources/CDocIO.cpp
6 6 7 7 #include "pe.h" 8 8 9 #include <Catalog.h> 9 10 #include <NodeMonitor.h> 10 11 #include <fs_attr.h> 11 12 #include <String.h> … … 18 19 #include "MAlert.h" 19 20 #include "Prefs.h" 20 21 22 #undef B_TRANSLATE_CONTEXT 23 #define B_TRANSLATE_CONTEXT "C Doc IO" 24 21 25 static void ConvertLinebreaks(BString& str, int fromType, int toType) 22 26 { 23 27 const char* lbStr[] = { … … 347 351 { 348 352 BString err; 349 353 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 355 360 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.")); 361 366 fDoc->SetErrorMsg(err.String()); 362 367 return false; 363 368 } … … 381 386 { 382 387 fDoc->HighlightErrorPos(fConv.ErrorPos()); 383 388 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")); 390 396 a.Go(); 391 397 return false; 392 398 } … … 463 469 int bytesRead = file.Read(buf, size); 464 470 docText.UnlockBuffer(size); 465 471 if (bytesRead < size) 466 THROW(("A read error occurred: %s", strerror(errno))); 472 THROW((B_TRANSLATE("A read error occurred: %s"), 473 strerror(errno))); 467 474 } 468 475 469 476 if (readAttributes) … … 742 749 && _HasFileContentsChanged(file)) 743 750 { 744 751 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")); 747 757 748 758 if (a.Go() == 1) 749 759 { … … 876 886 int sz = ftp.ReadAt(0, buf, size); 877 887 docText.UnlockBuffer(size); 878 888 if (sz < size) 879 THROW(("A read error occurred: %s", strerror(errno))); 889 THROW((B_TRANSLATE("A read error occurred: %s"), 890 strerror(errno))); 880 891 881 892 if (readAttributes) 882 893 { -
Sources/HAppResFile.cpp
33 33 Created: 02-06-02 34 34 */ 35 35 36 #include <Catalog.h> 37 36 38 #include "pe.h" 37 39 #include "HAppResFile.h" 38 40 #include "HError.h" 39 41 #include "HStream.h" 40 42 #include "ResourcesMenus.h" 41 43 44 #undef B_TRANSLATE_CONTEXT 45 #define B_TRANSLATE_CONTEXT "H App Res File" 46 42 47 using namespace HResources; 43 48 44 49 BResources *gAppResFile = NULL; … … 76 81 { 77 82 size_t size; 78 83 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!")); 80 85 81 86 BMemoryIO buf(m, size); 82 87 BPositionIO& data = buf; -
Sources/HDialog.cpp
35 35 36 36 #include "pe.h" 37 37 38 #include <Catalog.h> 38 39 #include <Slider.h> 39 40 40 41 #include "HDialog.h" … … 46 47 #include "HError.h" 47 48 #include "MAlert.h" 48 49 50 #undef B_TRANSLATE_CONTEXT 51 #define B_TRANSLATE_CONTEXT "H Dialog" 52 49 53 const unsigned long 50 54 msg_AddDialog = 'ADlg', 51 55 msg_RemoveDialog = 'RDlg'; … … 358 362 359 363 if (isnan(d)) 360 364 { 361 MWarningAlert a( "Invalid number entered");365 MWarningAlert a(B_TRANSLATE("Invalid number entered")); 362 366 a.Go(); 363 367 FindView(name)->MakeFocus(true); 364 368 return false; … … 510 514 if (sFieldMap && sFieldMap->find(kind) != sFieldMap->end()) 511 515 (*sFieldMap)[kind](kind, data, inside); 512 516 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); 514 518 } 515 519 } 516 520 } /* HDialog::CreateField */ … … 544 548 int HDialog::GetValue(const char *id) const 545 549 { 546 550 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)); 548 552 549 553 // according to stroustrup I shouldn't do this: 550 554 … … 558 562 else if (typeid(*v) == typeid(BSlider)) 559 563 return static_cast<BSlider*>(v)->Value(); 560 564 561 THROW(( "view '%s' not of valid type", id));565 THROW((B_TRANSLATE("view '%s' not of valid type"), id)); 562 566 return 0; 563 567 } // HDialog::GetValue 564 568 565 569 void HDialog::SetValue(const char *id, int value) 566 570 { 567 571 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)); 569 573 570 574 if (typeid(*v) == typeid(BMenuField)) 571 575 { … … 588 592 return; 589 593 } 590 594 591 THROW(( "view '%s' not found", id));595 THROW((B_TRANSLATE("view '%s' not found"), id)); 592 596 } // HDialog::SetValue 593 597 594 598 void HDialog::SetLabel(const char *id, const char *label) … … 597 601 if (control) 598 602 control->SetLabel(label); 599 603 else 600 THROW(( "Control '%s' not found", id));604 THROW((B_TRANSLATE("Control '%s' not found"), id)); 601 605 } // HDialog::SetLabel 602 606 603 607 filter_result HDialog::KeyDownFilter(BMessage* msg, BHandler**, -
Sources/CDoc.cpp
35 35 36 36 #include "pe.h" 37 37 38 #include <Catalog.h> 38 39 #include <String.h> 39 40 40 41 #include "CDoc.h" … … 47 48 #include "PMessages.h" 48 49 #include "Prefs.h" 49 50 51 #undef B_TRANSLATE_CONTEXT 52 #define B_TRANSLATE_CONTEXT "C Doc" 53 50 54 doclist CDoc::sfDocList; 51 55 vector<char*> CDoc::sfTenLastDocs; 52 56 … … 126 130 void CDoc::Read(bool readAttributes) 127 131 { 128 132 if (!fDocIO) 129 THROW(( "No file available"));133 THROW((B_TRANSLATE("No file available"))); 130 134 131 135 fDocIO->ReadDoc(readAttributes); 132 136 } … … 136 140 try 137 141 { 138 142 if (!fDocIO) 139 THROW(( "No file available"));143 THROW((B_TRANSLATE("No file available"))); 140 144 // Only save directly if the file is writable and if we already 141 145 // have a place (entry) for the file 142 146 if (!fReadOnly && (!fDocIO->IsLocal() || EntryRef())) … … 171 175 w->Lock(); 172 176 173 177 char s[256]; 174 sprintf(s, "Save %s as:", Name());178 sprintf(s, B_TRANSLATE("Save %s as:"), Name()); 175 179 176 180 w->SetTitle(s); 177 181 fSavePanel->SetSaveText(Name()); … … 270 274 w->Lock(); 271 275 272 276 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()); 274 278 275 279 w->SetTitle(s); 276 280 fSavePanel->SetSaveText(Name()); … … 336 340 void CDoc::Revert() 337 341 { 338 342 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()); 340 345 341 MInfoAlert a(title, "Cancel", "OK");346 MInfoAlert a(title, B_TRANSLATE("Cancel"), B_TRANSLATE("OK")); 342 347 if (a == 2) 343 348 { 344 349 Read(); … … 350 355 { 351 356 if ((readOnly && fDirty) || !EntryRef()) 352 357 { 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")); 354 359 a.Go(); 355 360 } 356 361 else … … 402 407 403 408 const char* CDoc::DefaultName() const 404 409 { 405 return "Untitled";410 return B_TRANSLATE("Untitled"); 406 411 } 407 412 408 413 const char* CDoc::Name() const -
Sources/CUrlOpener.cpp
33 33 Created: 04/26/98 21:16:08 34 34 */ 35 35 36 #include <Catalog.h> 37 36 38 #include "pe.h" 37 39 #include "PApp.h" 38 40 #include "CUrlOpener.h" … … 40 42 #include "CFtpStream.h" 41 43 #include "PDoc.h" 42 44 45 #undef B_TRANSLATE_CONTEXT 46 #define B_TRANSLATE_CONTEXT "C Url Opener" 47 43 48 CUrlOpener::CUrlOpener(const char *url) 44 49 : fURL(url) 45 50 { … … 62 67 URLData& url = fURL; 63 68 64 69 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())); 66 71 67 72 bool ok; 68 73 -
Sources/CStdErrBox.cpp
33 33 Created: 02/22/98 22:12:11 34 34 */ 35 35 36 #include <Catalog.h> 37 36 38 #include "pe.h" 37 39 #include "CListBox.h" 38 40 #include "CStdErrBox.h" … … 42 44 #include "HPreferences.h" 43 45 #include "Prefs.h" 44 46 47 #undef B_TRANSLATE_CONTEXT 48 #define B_TRANSLATE_CONTEXT "C Std Err Box" 49 45 50 const unsigned long 46 51 msg_ChangedPattern = 'ECnm'; 47 52 … … 108 113 109 114 BTextControl *t; 110 115 111 AddChild(t = new BTextControl(r, "SEpt", "Pattern:",116 AddChild(t = new BTextControl(r, "SEpt", B_TRANSLATE("Pattern:"), 112 117 NULL, new BMessage(msg_ChangedPattern))); 113 118 114 119 t->SetDivider(40 * gFactor); … … 117 122 r.OffsetBy(0, 20 * gFactor); 118 123 r.right = r.left + r.Width() / 2 - 10 * gFactor; 119 124 120 AddChild(t = new BTextControl(r, "SEfl", "File:",125 AddChild(t = new BTextControl(r, "SEfl", B_TRANSLATE("File:"), 121 126 NULL, new BMessage(msg_ChangedPattern))); 122 127 123 128 t->SetDivider(40 * gFactor); … … 125 130 126 131 r.OffsetBy(0, 20 * gFactor); 127 132 128 AddChild(t = new BTextControl(r, "SEln", "Line:",133 AddChild(t = new BTextControl(r, "SEln", B_TRANSLATE("Line:"), 129 134 NULL, new BMessage(msg_ChangedPattern))); 130 135 131 136 t->SetDivider(40 * gFactor); … … 134 139 r.OffsetBy(r.Width() + 10 * gFactor, -20 * gFactor); 135 140 r.right += 10 * gFactor; 136 141 137 AddChild(t = new BTextControl(r, "SEms", "Message:",142 AddChild(t = new BTextControl(r, "SEms", B_TRANSLATE("Message:"), 138 143 NULL, new BMessage(msg_ChangedPattern))); 139 144 140 145 t->SetDivider(50 * gFactor); … … 142 147 143 148 r.OffsetBy(0, 20 * gFactor); 144 149 145 AddChild(t = new BTextControl(r, "SEwa", "Warning:",150 AddChild(t = new BTextControl(r, "SEwa", B_TRANSLATE("Warning:"), 146 151 NULL, new BMessage(msg_ChangedPattern))); 147 152 148 153 t->SetDivider(50 * gFactor); -
Sources/Jamfile
3 3 4 4 SubDirHdrs $(OBJECTS_DIR) Sources ; 5 5 6 AddResources Pe : Pe.rdef ; 7 6 8 if $(OSPLAT) = X86 { 7 9 C++FLAGS += -Wno-sign-compare -Wno-overloaded-virtual ; 8 10 } else { … … 111 113 utf-support.cpp 112 114 Utils.cpp 113 115 : libhekkel.so pcre be $(STDC++LIB) tracker mail textencoding 116 $(HAIKU_LOCALE_LIBS) 114 117 ; 115 118 # </pe-src> 116 119 if $(OSPLAT) = X86 { … … 143 146 Rez Pe : [ FDirName $(TOP) Resources Now.r ] ; 144 147 145 148 MimeSet Pe ; 149 150 DoCatalogs 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
34 34 */ 35 35 36 36 #include "pe.h" 37 38 #include <Catalog.h> 39 37 40 #include <stdarg.h> 38 41 #include "HError.h" 39 42 #include "MAlert.h" 40 43 44 #undef B_TRANSLATE_CONTEXT 45 #define B_TRANSLATE_CONTEXT "H Error" 46 41 47 HErr::HErr() 42 48 { 43 49 } /* HErr::HErr */ … … 48 54 fMessage[0] = 0; 49 55 50 56 if (err == 0) 51 strcpy(fMessage, "No Error");57 strcpy(fMessage, B_TRANSLATE("No Error")); 52 58 else if (err < 0) 53 59 strcpy(fMessage, strerror(err)); 54 60 else 55 sprintf(fMessage, "An unknown error occured (nr: %d)", err);61 sprintf(fMessage, B_TRANSLATE("An unknown error occured (nr: %d)"), err); 56 62 57 63 //#if DEBUG 58 64 // if (err) -
Sources/CGrepBox.cpp
33 33 Created: 02/22/98 22:12:11 34 34 */ 35 35 36 #include <Catalog.h> 37 36 38 #include "pe.h" 37 39 #include "CListBox.h" 38 40 #include "CGrepBox.h" … … 41 43 #include "HDialog.h" 42 44 #include "Prefs.h" 43 45 46 #undef B_TRANSLATE_CONTEXT 47 #define B_TRANSLATE_CONTEXT "C Grep Box" 48 44 49 const unsigned long 45 50 msg_ChangedPattern = 'GCnm'; 46 51 … … 89 94 r.top = r.bottom + 10 * gFactor; 90 95 r.bottom = r.top + 16 * gFactor; 91 96 92 AddChild(fName = new BTextControl(r, "edit mime", "Name:",97 AddChild(fName = new BTextControl(r, "edit mime", B_TRANSLATE("Name:"), 93 98 NULL, new BMessage(msg_ChangedPattern))); 94 99 95 100 fName->SetDivider(40 * gFactor); … … 97 102 98 103 r.OffsetBy(0, 20 * gFactor); 99 104 100 AddChild(fFind = new BTextControl(r, "edit mime", "Find:",105 AddChild(fFind = new BTextControl(r, "edit mime", B_TRANSLATE("Find:"), 101 106 NULL, new BMessage(msg_ChangedPattern))); 102 107 103 108 fFind->SetDivider(40 * gFactor); … … 105 110 106 111 r.OffsetBy(0, 20 * gFactor); 107 112 108 AddChild(fReplace = new BTextControl(r, "edit mime", "Replace:",113 AddChild(fReplace = new BTextControl(r, "edit mime", B_TRANSLATE("Replace:"), 109 114 NULL, new BMessage(msg_ChangedPattern))); 110 115 111 116 fReplace->SetDivider(40 * gFactor); -
Sources/CFilterChoiceDialog.cpp
10 10 11 11 #include <Application.h> 12 12 #include <Beep.h> 13 #include <Catalog.h> 13 14 #include <ListItem.h> 14 15 #include <ListView.h> 15 16 #include <Screen.h> … … 23 24 #include "KeyBindings.h" 24 25 #include "Prefs.h" 25 26 27 #undef B_TRANSLATE_CONTEXT 28 #define B_TRANSLATE_CONTEXT "C Filter Choice Dialog" 29 26 30 // internal messages 27 31 enum { 28 32 MSG_COMMIT_REQUEST = 'fico', … … 407 411 FailNil(message); 408 412 BRect rect(bounds); 409 413 fFilterStringControl = new(std::nothrow) BTextControl(rect, "filter text", 410 "Filter", "", message,414 B_TRANSLATE("Filter"), "", message, 411 415 B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP, B_WILL_DRAW); 412 416 FailNil(fFilterStringControl); 413 417 fMainView->AddChild(fFilterStringControl); 414 418 BFont labelFont; 415 419 fFilterStringControl->GetFont(&labelFont); 416 fFilterStringControl->SetDivider(labelFont.StringWidth( "Filter#"));420 fFilterStringControl->SetDivider(labelFont.StringWidth(B_TRANSLATE("Filter#"))); 417 421 message = new BMessage(MSG_FILTER_MODIFIED); 418 422 FailNil(message); 419 423 fFilterStringControl->SetModificationMessage(message); -
Sources/CDocWindow.cpp
35 35 36 36 #include <algorithm> 37 37 38 #include <Catalog.h> 38 39 #include <NodeMonitor.h> 39 40 #include <fs_attr.h> 40 41 #include <String.h> … … 48 49 #include "PMessages.h" 49 50 #include "Prefs.h" 50 51 52 #undef B_TRANSLATE_CONTEXT 53 #define B_TRANSLATE_CONTEXT "C Doc Window" 51 54 52 55 int CDocWindow::sfNewCount = -1; 53 56 54 57 CDocWindow::CDocWindow(const entry_ref *doc) 55 : inheritedWindow(BRect(0,0,0,0), doc ? doc->name : "Untitled", B_DOCUMENT_WINDOW,56 58 : inheritedWindow(BRect(0,0,0,0), doc ? doc->name : 59 B_TRANSLATE("Untitled"), B_DOCUMENT_WINDOW, B_ASYNCHRONOUS_CONTROLS) 57 60 , inheritedDoc("", this, doc) 58 61 , fCloseWinAfterSave(false) 59 62 , fCloseAppAfterSave(false) … … 155 158 if (IsDirty()) 156 159 { 157 160 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()); 159 163 160 164 if (IsMinimized()) 161 165 Minimize(false); … … 163 167 164 168 UnlockLooper(); 165 169 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")); 167 173 168 174 int32 alertResult = alert.Go(); 169 175 … … 237 243 // now that the window is shown, we might have to show any error alongside 238 244 // it that may have ocurred during load (conversion failure): 239 245 if (HadError()) { 240 MInfoAlert a(ErrorMsg(), "I See");246 MInfoAlert a(ErrorMsg(), B_TRANSLATE("I See")); 241 247 a.Go(); 242 248 ClearErrorMsg(); 243 249 } -
Sources/CKeyMapper.cpp
33 33 Created: 10/07/97 21:53:17 34 34 */ 35 35 36 #include <Catalog.h> 37 36 38 #include "pe.h" 37 39 38 40 #include "HStream.h" … … 46 48 #include "ResourcesBindings.h" 47 49 #include "ResourcesUtf.h" 48 50 51 #undef B_TRANSLATE_CONTEXT 52 #define B_TRANSLATE_CONTEXT "C Key Mapper" 53 49 54 CKeyMapper* CKeyMapper::sfInstance = NULL; 50 55 51 56 void CKeyMapper::Init() … … 156 161 void CKeyMapper::ReadKeymap(keymap& kmap) 157 162 { 158 163 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"))); 160 165 161 166 FailOSErr(acquire_sem(kmsem)); 162 167 … … 209 214 b << cnt; 210 215 211 216 if (file.Write(b.Buffer(), b.BufferLength()) != b.BufferLength()) 212 THROW(( "Error writing keybindings"));217 THROW((B_TRANSLATE("Error writing keybindings"))); 213 218 } 214 219 else 215 220 FailOSErr(file.SetTo(&gPrefsDir, "keybindings", B_READ_ONLY)); … … 224 229 { 225 230 cnt = __swap_int32(cnt); 226 231 if (cnt != size / (sizeof(long) * 3)) 227 THROW(( "Invalid keybinding file!"));232 THROW((B_TRANSLATE("Invalid keybinding file!"))); 228 233 229 234 while (cnt--) 230 235 { -
Sources/CFindDialog.cpp
364 364 } // CFindDialog::Create 365 365 366 366 void 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:")); 380 380 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")); 383 383 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")); 393 393 fEdiName ->ResizeLocalized(); 394 394 395 395 // Hack: Somehow the Label isn't set (SetLabelFromMarked()) if we don't do this … … 529 529 530 530 if (cmd == msg_ReplaceAll) 531 531 { 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()) 533 537 { 534 538 case 1: return; 535 539 case 2: all = mrLeaveOpen; break; … … 1021 1025 fDirNameStack.push(strdup(dir)); 1022 1026 } 1023 1027 1024 if (!fCurrentDir) THROW(( "Directory not found: %s", dir));1028 if (!fCurrentDir) THROW((B_TRANSLATE("Directory not found: %s"), dir)); 1025 1029 1026 1030 struct dirent *dent; 1027 1031 struct stat stbuf; … … 1301 1305 if (w && *w) 1302 1306 m = static_cast<PMessageWindow*>(*w); 1303 1307 else 1304 m = new PMessageWindow( "Search Results");1308 m = new PMessageWindow(B_TRANSLATE("Search Results")); 1305 1309 1306 1310 BAutolock lock(m); 1307 1311 -
Sources/CGoToLine.cpp
33 33 Created: 10/10/97 20:44:22 34 34 */ 35 35 36 #include <Catalog.h> 37 36 38 #include "pe.h" 37 39 #include "PDoc.h" 38 40 #include "PText.h" 39 41 #include "CGoToLine.h" 40 42 #include "PMessages.h" 41 43 44 #undef B_TRANSLATE_CONTEXT 45 #define B_TRANSLATE_CONTEXT "C Go To Line" 46 42 47 CGoToLine::CGoToLine(BRect frame, const char *name, window_type type, int flags, 43 48 BWindow *owner) 44 49 : HDialog(frame, name, type, flags | B_NOT_RESIZABLE, owner) … … 77 82 78 83 void CGoToLine::Layout(void) 79 84 { 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")); 83 88 84 float div = fLine->StringWidth( "Line:")+20;89 float div = fLine->StringWidth(B_TRANSLATE("Line:"))+20; 85 90 fLine->SetDivider(div); 86 91 fLine->SetWidth(div+fLine->TextView()->StringWidth("1234567")+10); 87 92 -
Sources/CPathsBox.cpp
33 33 Created: 10/20/97 21:53:02 34 34 */ 35 35 36 #include <Catalog.h> 37 36 38 #include "pe.h" 37 39 #include "CListBox.h" 38 40 #include "CPathsBox.h" … … 43 45 #include "HDefines.h" 44 46 #include "HPreferences.h" 45 47 48 #undef B_TRANSLATE_CONTEXT 49 #define B_TRANSLATE_CONTEXT "C Paths Box" 50 46 51 typedef BListItem CListItem; 47 52 typedef BView LView; 48 53 … … 188 193 BStringItem *item; 189 194 FailOSErr(msg->FindPointer("item", (void**)&item)); 190 195 if (fList->IndexOf(item) < 0) 191 THROW(( "item was removed from list!"));196 THROW((B_TRANSLATE("item was removed from list!"))); 192 197 item->SetText(p.Path()); 193 198 } 194 199 … … 218 223 NULL, B_DIRECTORY_NODE, false, new BMessage(msg_AddPath)); 219 224 FailNil(fPanel); 220 225 221 fPanel->Window()->SetTitle( "Add Directory");226 fPanel->Window()->SetTitle(B_TRANSLATE("Add Directory")); 222 227 fPanel->Show(); 223 228 } /* CPathsBox::AddClicked */ 224 229 … … 243 248 &ref, B_DIRECTORY_NODE, false, msg); 244 249 FailNil(fPanel); 245 250 246 fPanel->Window()->SetTitle( "Change Directory");251 fPanel->Window()->SetTitle(B_TRANSLATE("Change Directory")); 247 252 fPanel->Show(); 248 253 } /* CPathsBox::ChangeClicked */ 249 254 -
Sources/CHtmlBar.cpp
33 33 Created: 03/09/98 23:14:35 34 34 */ 35 35 36 #include <Catalog.h> 37 36 38 #include "pe.h" 37 39 #include "CHtmlBar.h" 38 40 #include "PApp.h" … … 46 48 #include "ResourcesMisc.h" 47 49 #include "Prefs.h" 48 50 51 #undef B_TRANSLATE_CONTEXT 52 #define B_TRANSLATE_CONTEXT "C Html Bar" 53 49 54 CHtmlBar *CHtmlBar::sfInstance; 50 55 51 56 CHtmlBar* CHtmlBar::Instance() … … 70 75 71 76 CHtmlBar::CHtmlBar() 72 77 : BWindow(gPrefs->GetPrefRect(prf_R_HtmlPalettePos, BRect(20, 20, 120, 120)), 73 "HTML Palette",78 B_TRANSLATE("HTML Palette"), 74 79 B_FLOATING_WINDOW, 75 80 B_AVOID_FRONT | B_AVOID_FOCUS | B_WILL_ACCEPT_FIRST_CLICK | B_NOT_RESIZABLE | B_NOT_ZOOMABLE) 76 81 { … … 91 96 92 97 size_t size; 93 98 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"))); 95 100 } 96 101 catch (HErr& e) 97 102 { … … 102 107 else 103 108 p = HResources::GetResource(rtyp_Htmp, rid_Htmp_HtmlPalette, size); 104 109 105 if (p == NULL) THROW(( "Could not find a palette resource"));110 if (p == NULL) THROW((B_TRANSLATE("Could not find a palette resource"))); 106 111 107 112 BMemoryIO data(p, size); 108 113 BPositionIO& buf = data; -
Sources/PApp.cpp
37 37 38 38 static const char *rcsid = "$Id$"; 39 39 40 #include <Catalog.h> 41 40 42 #include "PApp.h" 41 43 #include "PDoc.h" 42 44 #include "PMessages.h" … … 63 65 #include "CProjectRoster.h" 64 66 #include "Prefs.h" 65 67 68 #undef B_TRANSLATE_CONTEXT 69 #define B_TRANSLATE_CONTEXT "P App" 70 66 71 BDirectory gAppDir, gCWD, gPrefsDir; 67 72 BFile gAppFile; 68 73 PApp *gApp; … … 137 142 : BApplication("application/x-vnd.beunited.pe") 138 143 { 139 144 #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")); 141 146 a.Go(); 142 147 #endif 143 148 … … 150 155 FailOSErr(find_directory(B_USER_SETTINGS_DIRECTORY, &settings, true)); 151 156 152 157 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 ?!?!?")); 154 159 if (!e.Contains("pe", B_DIRECTORY_NODE)) 155 160 FailOSErr(e.CreateDirectory("pe", &gPrefsDir)); 156 161 else … … 264 269 gRecentBufferSize = gPrefs->GetPrefInt(prf_I_RecentSize, 10); 265 270 RestoreRecentMenu(); 266 271 267 fFindDialog = DialogCreator<CFindDialog>::CreateDialog( "Find", NULL, PDoc::TopWindow());272 fFindDialog = DialogCreator<CFindDialog>::CreateDialog(B_TRANSLATE("Find"), NULL, PDoc::TopWindow()); 268 273 fFindDialog->Run(); 269 274 270 275 InitSelectedMap(); … … 555 560 556 561 static void Usage() 557 562 { 558 fprintf(stderr, "Usage: pe [\"+\"linenr] file1 file2 ...\n");563 fprintf(stderr, B_TRANSLATE("Usage: pe [\"+\"linenr] file1 file2 ...\n")); 559 564 } /* Usage */ 560 565 561 566 void PApp::ArgvReceived(int32 argc, const char *argv[], const char * cwd) … … 796 801 case msg_FindDifferences: 797 802 { 798 803 BRect r(100,100,500,250); 799 new CDiffWindow(r, "Differences");804 new CDiffWindow(r, B_TRANSLATE("Differences")); 800 805 break; 801 806 } 802 807 … … 935 940 if (fPrefsDialog) { 936 941 BAutolock lock(fPrefsDialog); 937 942 if (!lock.IsLocked()) { 938 THROW(( "Preferences panel failed to lock"));943 THROW((B_TRANSLATE("Preferences panel failed to lock"))); 939 944 break; 940 945 } 941 946 … … 951 956 fPrefsDialog->Activate(true); 952 957 } 953 958 else 954 THROW(( "Preferences panel failed to open"));959 THROW((B_TRANSLATE("Preferences panel failed to open"))); 955 960 break; 956 961 } 957 962 … … 1039 1044 be_roster->ActivateApp(team); 1040 1045 } 1041 1046 else if (be_roster->Launch(sig, &msg)) 1042 THROW(( "Could not launch browser"));1047 THROW((B_TRANSLATE("Could not launch browser"))); 1043 1048 } 1044 1049 catch (HErr& e) 1045 1050 { -
Sources/CPrefsDialog.cpp
34 34 Created: 10/20/97 20:28:28 35 35 */ 36 36 37 #include <Catalog.h> 38 37 39 #include "pe.h" 38 40 #include "CPrefsDialog.h" 39 41 #include "PMessages.h" … … 60 62 #include "Prefs.h" 61 63 #include "PrefControls.h" 62 64 65 #undef B_TRANSLATE_CONTEXT 66 #define B_TRANSLATE_CONTEXT "C Prefs Dialog" 67 63 68 typedef BStringItem CStringItem; 64 69 65 70 class MyItem : public CStringItem … … 234 239 BButton *ok = static_cast<BButton*>(FindView("ok ")); 235 240 if (ok->IsEnabled()) 236 241 { 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")); 238 243 if (a == 1) 239 244 OkClicked(); 240 245 else … … 392 397 intf->SetExtensions(fSuffixes[cookie - 1].c_str()); 393 398 394 399 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")); 396 401 CLanguageInterface::ChooseDefault(); 397 402 398 403 … … 608 613 609 614 CLanguageInterface *intf; 610 615 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")); 612 617 613 618 while ((intf = CLanguageInterface::NextIntf(cookie)) != NULL) 614 619 { … … 963 968 keymap::iterator ki = fKeymap.find(ks); 964 969 if (ki != fKeymap.end() && (*ki).second != mi->fOne) 965 970 { 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")); 968 973 if (a.Go() != 1) 969 974 return; 970 975 } -
Sources/CDiffWindow.cpp
50 50 #include "ResourcesToolbars.h" 51 51 #include "Prefs.h" 52 52 53 #include <Catalog.h> 54 55 #undef B_TRANSLATE_CONTEXT 56 #define B_TRANSLATE_CONTEXT "C Diff Window" 57 53 58 inline int compare(const char *a, const char *b) 54 59 { 55 60 return strcmp(a, b); … … 87 92 pt.x = FindView("ButtonBar")->Frame().right + 10; 88 93 pt.y = fh.ascent - 1; 89 94 90 strcpy(s, "File 1: "); 95 strcpy(s, B_TRANSLATE_WITH_COMMENT("File 1: ", 96 "There is a space after the colon.")); 91 97 if (e.SetTo(&dw->File1(), true) == B_OK && e.Exists()) 92 98 { 93 99 e.GetPath(&p); 94 100 strcat(s, p.Path()); 95 101 } 96 102 else 97 strcat(s, "<none>");103 strcat(s, B_TRANSLATE("<none>")); 98 104 99 105 DrawString(s, pt); 100 106 101 strcpy(s, "File 2: "); 107 strcpy(s, B_TRANSLATE_WITH_COMMENT("File 2: ", 108 "There is a space after the colon.")); 102 109 if (e.SetTo(&dw->File2(), true) == B_OK && e.Exists()) 103 110 { 104 111 e.GetPath(&p); 105 112 strcat(s, p.Path()); 106 113 } 107 114 else 108 strcat(s, "<none>");115 strcat(s, B_TRANSLATE("<none>")); 109 116 110 117 pt.y += fh.ascent + fh.descent - 1; 111 118 DrawString(s, pt); … … 308 315 msg->AddInt32("filenr", fileNr); 309 316 310 317 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")); 312 319 fPanel->Show(); 313 320 } 314 321 fButtonBar->SetDown(cmd, false); … … 321 328 while (system_time() < longEnough); 322 329 } 323 330 324 BPopUpMenu popup( "Recent");331 BPopUpMenu popup(B_TRANSLATE("Recent")); 325 332 BMenuItem *item; 326 333 char s[PATH_MAX]; 327 334 int i = 0; … … 332 339 popup.SetFont(be_plain_font); 333 340 334 341 if (popup.CountItems() == 0) 335 popup.AddItem(new BMenuItem( "Empty", NULL));342 popup.AddItem(new BMenuItem(B_TRANSLATE("Empty"), NULL)); 336 343 337 344 BRect r; 338 345 … … 359 366 PDoc *docA, *docB; 360 367 361 368 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"))); 363 370 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"))); 365 372 366 373 vector<int> va, vb; 367 374 … … 391 398 392 399 if (fScript->CountItems() == 0) 393 400 { 394 MInfoAlert a( "Files are identical");401 MInfoAlert a(B_TRANSLATE("Files are identical")); 395 402 a.Go(); 396 403 return; 397 404 } … … 525 532 FailOSErr(BEntry(&file, true).GetPath(&p)); 526 533 527 534 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())); 529 536 530 537 char *txt; 531 538 size_t size; … … 655 662 656 663 BRect r(100,100,500,250); 657 664 658 CDiffWindow *ndw = new CDiffWindow(r, "Differences");665 CDiffWindow *ndw = new CDiffWindow(r, B_TRANSLATE("Differences")); 659 666 660 667 BMessage msg(msg_Add2Files); 661 668 msg.AddRef("refs", &f1); … … 821 828 if (fA1 == fA2) 822 829 { 823 830 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); 825 833 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); 827 836 } 828 837 else if (fB1 == fB2) 829 838 { 830 839 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); 832 842 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); 834 845 } 835 846 else 836 847 { 837 848 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); 839 851 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); 841 854 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); 843 857 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); 845 860 } 846 861 847 862 if (IsSelected()) … … 872 887 switch (fWhere) 873 888 { 874 889 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; 877 894 } 878 895 879 896 if (IsSelected()) … … 910 927 docB = dynamic_cast<PDoc*>(gApp->OpenWindow(fFile2)); 911 928 } 912 929 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"))); 915 932 } // CDiffWindow::GetDocs -
Sources/PText.cpp
35 35 36 36 #include "pe.h" 37 37 38 #include <Catalog.h> 38 39 #include <signal.h> 39 40 #include <PrintJob.h> 40 41 #include <String.h> … … 68 69 #include "ResourcesMenus.h" 69 70 #include "Prefs.h" 70 71 72 #undef B_TRANSLATE_CONTEXT 73 #define B_TRANSLATE_CONTEXT "P Text" 74 71 75 #if defined(__BEOS__) && defined(__INTEL__) 72 76 // [zooey]: BeOS' glib is messing up iscntrl, as it reports all values>127 as 73 77 // being control-chars, too (but they are *not*). We fix that: … … 1157 1161 1158 1162 void PText::Insert(const char *bytes, int numBytes, int offset) 1159 1163 { 1160 if (Doc()->IsReadOnly()) THROW(( "Document is read-only"));1164 if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only"))); 1161 1165 1162 1166 ASSERT(numBytes >= 0); 1163 1167 ASSERT(offset >= 0); … … 1177 1181 1178 1182 void PText::Delete(int from, int to) 1179 1183 { 1180 if (Doc()->IsReadOnly()) THROW(( "Document is read-only"));1184 if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only"))); 1181 1185 1182 1186 ASSERT(from >= 0); 1183 1187 ASSERT(to > from); … … 1196 1200 1197 1201 void PText::BackspaceKeyDown() 1198 1202 { 1199 if (Doc()->IsReadOnly()) THROW(( "Document is read-only"));1203 if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only"))); 1200 1204 1201 1205 if (fAnchor == fCaret) 1202 1206 { … … 1242 1246 1243 1247 void PText::DeleteKeyDown() 1244 1248 { 1245 if (Doc()->IsReadOnly()) THROW(( "Document is read-only"));1249 if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only"))); 1246 1250 1247 1251 if (fAnchor == fCaret) 1248 1252 { … … 1281 1285 1282 1286 void PText::CharKeyDown(const char *bytes, int numBytes) 1283 1287 { 1284 if (Doc()->IsReadOnly()) THROW(( "Document is read-only"));1288 if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only"))); 1285 1289 1286 1290 bool keepContext = OffsetIsOutsideOfContextArea(fCaret); 1287 1291 … … 1352 1356 1353 1357 void PText::TypeString(const char *string) 1354 1358 { 1355 if (Doc()->IsReadOnly()) THROW(( "Document is read-only"));1359 if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only"))); 1356 1360 1357 1361 CharKeyDown(string, strlen(string)); 1358 1362 fStatus->SetOffset(fCaret); … … 1955 1959 1956 1960 BMessage drag(B_SIMPLE_DATA); 1957 1961 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"))); 1959 1963 1960 1964 fDragStart = min(fAnchor, fCaret); 1961 1965 sfDragSource = this; … … 2217 2221 { 2218 2222 BPopUpMenu popup("copy or move"); 2219 2223 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)); 2222 2226 BMenuItem *item = popup.Go(msg->DropPoint(), false, true); 2223 2227 2224 2228 if (!item) … … 2469 2473 2470 2474 if (includes.IsEmpty() && functions.IsEmpty()) 2471 2475 { 2472 popup->AddItem(new BMenuItem( "Nothing Found", NULL));2476 popup->AddItem(new BMenuItem(B_TRANSLATE("Nothing Found"), NULL)); 2473 2477 } 2474 2478 else 2475 2479 { … … 2551 2555 2552 2556 BMenuItem* fontItem = fMainPopUp->FindItem(msg_ToggleFont); 2553 2557 int fontKind = kAltFont; 2554 // TODO: what about localized item names?!?2555 2558 switch (fFontKind) { 2556 2559 case kNormalFont: 2557 fontItem->SetLabel( "Alternate Font");2560 fontItem->SetLabel(B_TRANSLATE("Alternate Font")); 2558 2561 fontItem->SetMarked(false); 2559 2562 fontKind = kAltFont; 2560 2563 break; 2561 2564 case kAltFont: 2562 fontItem->SetLabel( "Alternate Font");2565 fontItem->SetLabel(B_TRANSLATE("Alternate Font")); 2563 2566 fontItem->SetMarked(true); 2564 2567 fontKind = kNormalFont; 2565 2568 break; 2566 2569 case kIndividualFont: 2567 2570 default: 2568 fontItem->SetLabel( "Individual Font");2571 fontItem->SetLabel(B_TRANSLATE("Individual Font")); 2569 2572 fontItem->SetMarked(true); 2570 2573 fontKind = kNormalFont; 2571 2574 break; … … 3407 3410 switch (bytes[0]) 3408 3411 { 3409 3412 case B_FUNCTION_KEY: 3410 if (Doc()->IsReadOnly()) THROW(( "Document is read-only"));3413 if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only"))); 3411 3414 3412 3415 key |= 0x0100; 3413 3416 … … 3434 3437 3435 3438 default: 3436 3439 { 3437 if (Doc()->IsReadOnly()) THROW(( "Document is read-only"));3440 if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only"))); 3438 3441 3439 3442 if (gGlossary->IsGlossaryShortcut(ch, modifiers)) 3440 3443 { … … 3802 3805 RedrawDirtyLines(); 3803 3806 break; 3804 3807 case kmsg_ExchangeMarkAndPoint: 3805 if (fMark == -1) THROW(( "Mark not set"));3808 if (fMark == -1) THROW((B_TRANSLATE("Mark not set"))); 3806 3809 newCaret = fMark; 3807 3810 if (fAnchor != fCaret) 3808 3811 newAnchor = newCaret; 3809 3812 SetMark(fCaret); 3810 3813 break; 3811 3814 case kmsg_CutRegion: 3812 if (fMark == -1) THROW(( "Mark not set"));3815 if (fMark == -1) THROW((B_TRANSLATE("Mark not set"))); 3813 3816 fAnchor = fMark; 3814 3817 RegisterCommand(new PCutCmd(this)); 3815 3818 fMark = newCaret = newAnchor = fCaret; 3816 3819 break; 3817 3820 case kmsg_CopyRegion: 3818 if (fMark == -1) THROW(( "Mark not set"));3821 if (fMark == -1) THROW((B_TRANSLATE("Mark not set"))); 3819 3822 fAnchor = fMark; 3820 3823 Copy(); 3821 3824 break; 3822 3825 case kmsg_ClearRegion: 3823 if (fMark == -1) THROW(( "Mark not set"));3826 if (fMark == -1) THROW((B_TRANSLATE("Mark not set"))); 3824 3827 fAnchor = fMark; 3825 3828 RegisterCommand(new PClearCmd(this)); 3826 3829 fMark = newCaret = newAnchor = fCaret; … … 4647 4650 { 4648 4651 if (fExec) 4649 4652 { 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!")); 4651 4654 a.Go(); 4652 4655 return; 4653 4656 } … … 6028 6031 6029 6032 FailOSErr(msg->FindRef("refs", &ref)); 6030 6033 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!"))); 6032 6035 6033 6036 BPath p; 6034 6037 FailOSErr(e.GetPath(&p)); … … 6361 6364 6362 6365 void PText::Cut(int append) 6363 6366 { 6364 if (Doc()->IsReadOnly()) THROW(( "Document is read-only"));6367 if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only"))); 6365 6368 6366 6369 Copy(append); 6367 6370 Clear(); … … 6423 6426 6424 6427 void PText::Paste() 6425 6428 { 6426 if (Doc()->IsReadOnly()) THROW(( "Document is read-only"));6429 if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only"))); 6427 6430 be_clipboard->Lock(); 6428 6431 6429 6432 try … … 6458 6461 6459 6462 void PText::Clear() 6460 6463 { 6461 if (Doc()->IsReadOnly()) THROW(( "Document is read-only"));6464 if (Doc()->IsReadOnly()) THROW((B_TRANSLATE("Document is read-only"))); 6462 6465 6463 6466 int size = abs(fCaret - fAnchor); 6464 6467 if (size) … … 6511 6514 if (fDoneCmds.size()) 6512 6515 { 6513 6516 mbar->FindItem(msg_Undo)->SetEnabled(true); 6514 char s[64] = "Undo ";6515 str cat(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()); 6517 6520 } 6518 6521 else 6519 6522 mbar->FindItem(msg_Undo)->SetEnabled(false); … … 6521 6524 if (fUndoneCmds.size()) 6522 6525 { 6523 6526 mbar->FindItem(msg_Redo)->SetEnabled(true); 6524 char s[64] = "Redo ";6525 str cat(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()); 6527 6530 } 6528 6531 else 6529 6532 mbar->FindItem(msg_Redo)->SetEnabled(false); -
Sources/CFtpStream.cpp
33 33 Created: 03/31/98 14:29:11 34 34 */ 35 35 36 #include <Catalog.h> 37 36 38 #include "pe.h" 37 39 #include "CFtpStream.h" 38 40 #include "CLogin.h" … … 49 51 #endif 50 52 #include <netdb.h> 51 53 54 #undef B_TRANSLATE_CONTEXT 55 #define B_TRANSLATE_CONTEXT "C Ftp Stream" 56 52 57 #ifndef __HAIKU__ 53 58 typedef int socklen_t; 54 59 #endif … … 145 150 URLData& URLData::operator+= (const char *relPath) 146 151 { 147 152 if (!IsValid()) 148 THROW(( "Url is not valid in the first place!"));153 THROW((B_TRANSLATE("Url is not valid in the first place!"))); 149 154 150 155 if (strchr(relPath, '/') == NULL) 151 156 { … … 180 185 181 186 void URLData::PrintToStream() 182 187 { 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"), 184 189 fServer, fPath, fFile, fUsername); 185 190 } /* URLData::PrintToStream */ 186 191 … … 202 207 static void GetReply(struct SOCK *sock, int& r, char* msg) 203 208 { 204 209 if (! s_gets(msg, 1024, sock)) 205 THROW(( "Read error"));210 THROW((B_TRANSLATE("Read error"))); 206 211 207 212 char *m; 208 213 r = strtoul(msg, &m, 10); … … 213 218 do 214 219 { 215 220 if (! s_gets(msg, 1024, sock)) 216 THROW(( "Read error"));221 THROW((B_TRANSLATE("Read error"))); 217 222 r2 = strtoul(msg, &m, 10); 218 223 } 219 224 while (m == NULL || r2 != r || *m != ' '); … … 222 227 223 228 inline void FailSockErr(int e) 224 229 { 225 if (e < 0) THROW(( "Network error: %s", strerror(errno)));230 if (e < 0) THROW((B_TRANSLATE("Network error: %s"), strerror(errno))); 226 231 } /* FailSockErr */ 227 232 228 233 void CFtpStream::Retrieve() … … 244 249 try 245 250 { 246 251 if (! fURL.IsValid()) 247 THROW(( "The data to connect is not complete"));252 THROW((B_TRANSLATE("The data to connect is not complete"))); 248 253 249 254 ctrl = socket(AF_INET, SOCK_STREAM, 0); 250 255 if (ctrl < 0) 251 THROW(( "Failed to get socket: %s", strerror(errno)));256 THROW((B_TRANSLATE("Failed to get socket: %s"), strerror(errno))); 252 257 data = socket(AF_INET, SOCK_STREAM, 0); 253 258 if (data < 0) 254 THROW(( "Failed to get socket: %s", strerror(errno)));259 THROW((B_TRANSLATE("Failed to get socket: %s"), strerror(errno))); 255 260 256 261 csSock = s_open(ctrl, "r+"); 257 262 258 263 struct hostent *host; 259 264 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))); 261 266 262 267 struct sockaddr_in sa; 263 268 sa.sin_family = AF_INET; … … 291 296 { 292 297 case 1: 293 298 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()); 296 301 state = 2; 297 302 break; 298 303 299 304 case 2: 300 305 if ((r / 100) == 3) 301 306 { 302 s_printf(csSock, "pass %s\r\n", password.c_str());307 s_printf(csSock, B_TRANSLATE("pass %s\r\n"), password.c_str()); 303 308 state = 3; 304 309 break; 305 310 } 306 311 else if ((r / 100) != 2 && (r / 100) != 5) 307 THROW(( "Failed to login: %s", msg));312 THROW((B_TRANSLATE("Failed to login: %s"), msg)); 308 313 309 314 // fall thru 310 315 … … 328 333 THROW((0)); 329 334 } 330 335 else if (state == 3 && (r / 100) != 2) 331 THROW(( "Failed to login: %s", msg));336 THROW((B_TRANSLATE("Failed to login: %s"), msg)); 332 337 else if (strlen(fURL.Path())) 333 338 { 334 339 s_printf(csSock, "cwd %s\r\n", fURL.Path()); … … 341 346 case 4: 342 347 { 343 348 if (state == 4 && (r / 100) != 2) 344 THROW(( "Failed to change directory: %s", msg));349 THROW((B_TRANSLATE("Failed to change directory: %s"), msg)); 345 350 346 351 if (fPassive) { 347 352 // switch to passive mode … … 364 369 // fetch ip-address from cmd-socket: 365 370 FailSockErr(getsockname(csSock->sSocket, (struct sockaddr *)&sa, &size)); 366 371 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]); 368 373 } 369 374 state = 5; 370 375 break; … … 374 379 unsigned int sap[4]; 375 380 unsigned int pap[2]; 376 381 if ((r / 100) != 2) 377 THROW(( "Pasv command failed: %s", msg));382 THROW((B_TRANSLATE("Pasv command failed: %s"), msg)); 378 383 char* pos = strchr(msg,'('); 379 384 if (!pos) 380 THROW(( "Answer to Pasv has unknown format: %s", msg));385 THROW((B_TRANSLATE("Answer to Pasv has unknown format: %s"), msg)); 381 386 int cnt = sscanf(pos+1, "%u,%u,%u,%u,%u,%u", 382 387 &sap[0], &sap[1], &sap[2], &sap[3], 383 388 &pap[0], &pap[1]); 384 389 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"), 386 391 cnt, msg)); 387 392 char ipAddr[20]; 388 393 sprintf(ipAddr, "%d.%d.%d.%d", sap[0], sap[1], sap[2], sap[3]); … … 391 396 FailOSErr(connect(data, (struct sockaddr *)&saData, sizeof(saData))); 392 397 } else { 393 398 if ((r / 100) != 2) 394 THROW(( "Port command failed: %s", msg));399 THROW((B_TRANSLATE("Port command failed: %s"), msg)); 395 400 } 396 401 if (action == 1) 397 402 { … … 436 441 state = 8; 437 442 } 438 443 else 439 THROW(( "Failed to retrieve file: %s", msg));444 THROW((B_TRANSLATE("Failed to retrieve file: %s"), msg)); 440 445 break; 441 446 442 447 case 7: … … 463 468 state = 8; 464 469 } 465 470 else 466 THROW(( "Failed to store file: %s", msg));471 THROW((B_TRANSLATE("Failed to store file: %s"), msg)); 467 472 break; 468 473 469 474 case 8: 470 475 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"))); 473 481 state = 0; 474 482 break; 475 483 -
Sources/CInfoDialog.cpp
33 33 Created: 10/28/97 09:19:58 34 34 */ 35 35 36 #include <Catalog.h> 37 36 38 #include "pe.h" 37 39 #include "CInfoDialog.h" 38 40 #include "PMessages.h" … … 47 49 #include "MAlert.h" 48 50 #include "Prefs.h" 49 51 52 #undef B_TRANSLATE_CONTEXT 53 #define B_TRANSLATE_CONTEXT "C Info Dialog" 54 50 55 CInfoDialog::CInfoDialog(BRect frame, const char *name, window_type type, int flags, 51 56 BWindow *owner, BPositionIO* data) 52 57 : HDialog(frame, name, type, flags, owner, data) … … 100 105 { 101 106 BMenuItem *item; 102 107 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))); 104 109 item->SetMarked(true); 105 110 } 106 111 … … 121 126 else 122 127 { 123 128 //SetEnabled("mime", false); 124 SetText("time", "Not Saved");129 SetText("time", B_TRANSLATE("Not Saved")); 125 130 } 126 131 127 132 mf = dynamic_cast<BMenuField*>(FindView("font")); … … 311 316 312 317 if (strcmp(fTypes->FindMarked()->Label(), "undefined") == 0) 313 318 { 314 MWarningAlert a( "Please choose a real mime type");319 MWarningAlert a(B_TRANSLATE("Please choose a real mime type")); 315 320 a.Go(); 316 321 } 317 322 -
Sources/PDoc.cpp
35 35 36 36 #include "pe.h" 37 37 38 #include <Catalog.h> 39 38 40 #include <fs_attr.h> 39 41 40 42 #include "CCharObject.h" … … 77 79 #include "Scripting.h" 78 80 #include "Utils.h" 79 81 82 #undef B_TRANSLATE_CONTEXT 83 #define B_TRANSLATE_CONTEXT "P Doc" 84 80 85 static long sDocCount = 0; 81 86 82 87 const float … … 91 96 fWindowMenuLength = -1; 92 97 fToolBar = NULL; 93 98 94 InitWindow(doc ? doc->name : "Untitled");99 InitWindow(doc ? doc->name : B_TRANSLATE("Untitled")); 95 100 96 101 if (IsReadOnly()) 97 102 fButtonBar->SetOn(msg_ReadOnly, true); … … 131 136 fWindowMenuLength = -1; 132 137 fToolBar = NULL; 133 138 134 InitWindow( "Untitled");139 InitWindow(B_TRANSLATE("Untitled")); 135 140 136 141 Read(); 137 142 … … 207 212 i++; 208 213 } 209 214 210 if (!fRecent) THROW(( "Resources damaged?"));215 if (!fRecent) THROW((B_TRANSLATE("Resources damaged?"))); 211 216 212 217 b.top += fMBar->Frame().bottom + 1; 213 218 r = b; … … 348 353 return; 349 354 if (IsDirty()) 350 355 { 351 MInfoAlert a( 356 MInfoAlert a(B_TRANSLATE( 352 357 "This will re-read the document's contents from disk,\n" 353 358 "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")); 355 361 if (a.Go() != 1) 356 362 return; 357 363 } … … 441 447 BMenuItem *item = m->FindMarked(); 442 448 FailNil(item); 443 449 444 if (strcmp(item->Label(), "<undefined>"))450 if (strcmp(item->Label(), B_TRANSLATE("<undefined>"))) 445 451 { 446 452 gPrefs->SetPrefInt("LastSavedMimeType", m->IndexOf(item)); 447 453 SetMimeType(item->Label(), false); … … 874 880 if (lock.IsLocked()) 875 881 { 876 882 BView *background = savePanel->ChildAt(0); 877 FailNilMsg(background, "Error building FilePanel");883 FailNilMsg(background, B_TRANSLATE("Error building FilePanel")); 878 884 879 885 BButton *cancel = dynamic_cast<BButton*>(background->FindView("cancel button")); 880 FailNilMsg(cancel, "Error building FilePanel");886 FailNilMsg(cancel, B_TRANSLATE("Error building FilePanel")); 881 887 882 888 BView *textview = background->FindView("text view"); 883 FailNilMsg(textview, "Error building FilePanel");889 FailNilMsg(textview, B_TRANSLATE("Error building FilePanel")); 884 890 885 891 BMenu *menu = HResources::GetMenu(rid_Menu_FpMimetypes, true); 886 FailNilMsg(menu, "Error building FilePanel");892 FailNilMsg(menu, B_TRANSLATE("Error building FilePanel")); 887 893 menu->SetFont(be_plain_font); 888 894 menu->SetRadioMode(true); 889 895 … … 893 899 be_plain_font->GetHeight(&fh); 894 900 rect.bottom = rect.top + fh.descent + fh.ascent + 5.0; 895 901 896 BMenuField *menuField = new BMenuField(rect, "mime", "Type:",902 BMenuField *menuField = new BMenuField(rect, "mime", B_TRANSLATE("Type:"), 897 903 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); 900 906 menuField->MenuBar()->ResizeToPreferred(); 901 907 menuField->ResizeToPreferred(); 902 908 … … 946 952 { 947 953 p = MimeType(); 948 954 if (!p || !p[0]) 949 p = "<undefined>";955 p = B_TRANSLATE("<undefined>"); 950 956 menu->AddItem(item = new BMenuItem(p, NULL)); 951 957 item->SetMarked(true); 952 958 } … … 1194 1200 return; 1195 1201 } 1196 1202 } 1197 THROW(( "Extension %s not found!", ext));1203 THROW((B_TRANSLATE("Extension %s not found!"), ext)); 1198 1204 } /* PDoc::PerformExtension */ 1199 1205 1200 1206 void PDoc::InstantiateAddOns() … … 1399 1405 MAlert *a; 1400 1406 1401 1407 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 " 1403 1409 "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")); 1405 1411 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")); 1407 1413 1408 1414 if (a->Go() == 1) 1409 1415 { … … 1436 1442 1437 1443 case msg_GoToLine: 1438 1444 { 1439 DialogCreator<CGoToLine>::CreateDialog( "Go To Line", this);1445 DialogCreator<CGoToLine>::CreateDialog(B_TRANSLATE("Go To Line"), this); 1440 1446 break; 1441 1447 } 1442 1448 … … 1540 1546 r.right = r.left + 400; 1541 1547 r.bottom = r.top + 150; 1542 1548 1543 new CDiffWindow(r, "Differences");1549 new CDiffWindow(r, B_TRANSLATE("Differences")); 1544 1550 break; 1545 1551 } 1546 1552 … … 1574 1580 } 1575 1581 else 1576 1582 { 1577 MInfoAlert a(prjWin->ErrorMsg(), "Hmmm...");1583 MInfoAlert a(prjWin->ErrorMsg(), B_TRANSLATE("Hmmm...")); 1578 1584 a.Go(); 1579 1585 } 1580 1586 break; … … 1834 1840 while (system_time() < longEnough); 1835 1841 } 1836 1842 1837 BPopUpMenu popup( "Recent");1843 BPopUpMenu popup(B_TRANSLATE("Recent")); 1838 1844 BMenuItem *item; 1839 1845 1840 1846 MenusBeginning(); … … 1849 1855 popup.SetFont(be_plain_font); 1850 1856 1851 1857 if (popup.CountItems() == 0) 1852 popup.AddItem(new BMenuItem( "Empty", NULL));1858 popup.AddItem(new BMenuItem(B_TRANSLATE("Empty"), NULL)); 1853 1859 1854 1860 BRect r; 1855 1861 … … 1867 1873 { 1868 1874 entry_ref ide; 1869 1875 if (be_roster->FindApp("application/x-mw-BeIDE", &ide)) 1870 THROW(( "BeIDE was not found"));1876 THROW((B_TRANSLATE("BeIDE was not found"))); 1871 1877 1872 1878 if (be_roster->IsRunning(&ide)) 1873 1879 be_roster->ActivateApp(be_roster->TeamFor(&ide)); 1874 1880 else if (be_roster->Launch(&ide) != B_OK) 1875 THROW(( "Could not launch BeIDE"));1881 THROW((B_TRANSLATE("Could not launch BeIDE"))); 1876 1882 } /* PDoc::IDEBringToFront */ 1877 1883 1878 1884 void PDoc::IDEAddFile() … … 1891 1897 IDEBringToFront(); 1892 1898 SendToIDE(msg, &reply); 1893 1899 if (reply.HasInt32("error")) 1894 THROW(( "An error occured adding the file"));1900 THROW((B_TRANSLATE("An error occured adding the file"))); 1895 1901 } /* PDoc::IDEAddFile */ 1896 1902 1897 1903 void PDoc::IDERemoveFile() … … 1910 1916 IDEBringToFront(); 1911 1917 SendToIDE(msg, &reply); 1912 1918 if (reply.HasInt32("error")) 1913 THROW(( "An error occured removing the file"));1919 THROW((B_TRANSLATE("An error occured removing the file"))); 1914 1920 } /* PDoc::IDERemoveFile */ 1915 1921 1916 1922 void PDoc::IDEMake() … … 1925 1931 1926 1932 entry_ref ide; 1927 1933 if (be_roster->FindApp("application/x-mw-BeIDE", &ide)) 1928 THROW(( "BeIDE was not found"));1934 THROW((B_TRANSLATE("BeIDE was not found"))); 1929 1935 1930 1936 if (be_roster->IsRunning(&ide)) 1931 1937 { … … 1933 1939 msgr.SendMessage(&msg); 1934 1940 } 1935 1941 else 1936 THROW(( "BeIDE is not running"));1942 THROW((B_TRANSLATE("BeIDE is not running"))); 1937 1943 } /* PDoc::IDEMake */ 1938 1944 1939 1945 void PDoc::IDEProject2Group() … … 1949 1955 SendToIDE(msg, &reply); 1950 1956 1951 1957 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"))); 1953 1959 else 1954 1960 { 1955 1961 PGroupWindow *gw = new PGroupWindow; … … 1976 1982 } /* PDoc::IDEProject2Group */ 1977 1983 1978 1984 const long cmd_AndyFeature = 4000; 1979 const char kFileName[] = "File", kTextFileRef[] = "TextRef";1985 const char kFileName[] = B_TRANSLATE("File"), kTextFileRef[] = B_TRANSLATE("TextRef"); 1980 1986 1981 1987 /* [zooey]: deactivated, see my comment in OpenPartner() 1982 1988 bool PDoc::IDEOpenSourceHeader(entry_ref& ref) -
Sources/PItalicMenuItem.cpp
34 34 #include "pe.h" 35 35 #include "PItalicMenuItem.h" 36 36 37 #undef B_TRANSLATE_CONTEXT 38 #define B_TRANSLATE_CONTEXT "P Italic Menu Item" 39 37 40 PItalicMenuItem::PItalicMenuItem(const char *label, BMessage *message, char shortcut, uint32 modifiers) 38 41 : BMenuItem(label, message, shortcut, modifiers) 39 42 { … … 48 51 font_family ff; 49 52 font_style fs; 50 53 font.GetFamilyAndStyle(&ff, &fs); 51 font.SetFamilyAndStyle(ff, "Italic");54 font.SetFamilyAndStyle(ff, B_TRANSLATE("Italic")); 52 55 53 56 Menu()->SetFont(&font); 54 57 -
Sources/Utils.cpp
36 36 #include "Utils.h" 37 37 #include "HError.h" 38 38 39 #include <Catalog.h> 40 41 #undef B_TRANSLATE_CONTEXT 42 #define B_TRANSLATE_CONTEXT "Utils" 43 39 44 //uchar gSelectedMap[256]; 40 45 // 41 46 //void InitSelectedMap() … … 94 99 95 100 if (!valid) 96 101 { 97 puts( "Invalid region:");102 puts(B_TRANSLATE("Invalid region:")); 98 103 rgn.PrintToStream(); 99 104 100 105 FILE *f = fopen("pe.log", "w"); … … 104 109 time_t t; 105 110 time(&t); 106 111 107 fprintf(f, "---\ndate: %sInvalid region in pe:\n", ctime(&t));112 fprintf(f, B_TRANSLATE("---\ndate: %sInvalid region in pe:\n"), ctime(&t)); 108 113 109 114 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);113 115 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 114 121 int i; 115 122 116 123 for (i = 0; i < rgn.CountRects(); i++) 117 124 { 118 125 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 121 131 } 122 132 123 133 if (rgn.Frame().IsValid()) 124 fputs( "Frame was valid", f);134 fputs(B_TRANSLATE("Frame was valid"), f); 125 135 else 126 136 { 127 fputs( "Frame Invalid", f);137 fputs(B_TRANSLATE("Frame Invalid"), f); 128 138 valid = true; 129 139 } 130 140 … … 146 156 { 147 157 // tracker is not running and we pass the message trough launching it 148 158 if (be_roster->Launch(trackerSignature, &msg) < B_OK) 149 THROW(( "Tracker not running???"));159 THROW((B_TRANSLATE("Tracker not running???"))); 150 160 } 151 161 else 152 162 { … … 159 169 { 160 170 entry_ref ide; 161 171 if (be_roster->FindApp("application/x-mw-BeIDE", &ide)) 162 THROW(( "BeIDE was not found"));172 THROW((B_TRANSLATE("BeIDE was not found"))); 163 173 164 174 if (be_roster->IsRunning(&ide)) 165 175 { … … 167 177 msgr.SendMessage(const_cast<BMessage*>(&msg), reply); 168 178 } 169 179 else 170 THROW(( "BeIDE is not running"));180 THROW((B_TRANSLATE("BeIDE is not running"))); 171 181 } /* SendToIDE */ 172 182 173 183 void RelativePath(const entry_ref& a, const entry_ref& b, char* path) -
Sources/HError.h
38 38 39 39 #include "HLibHekkel.h" 40 40 41 #include <Catalog.h> 42 41 43 #include <cerrno> 42 44 #include <syslog.h> 43 45 46 #undef B_TRANSLATE_CONTEXT 47 #define B_TRANSLATE_CONTEXT "H Error" 48 44 49 #if DEBUG 45 50 # define ASSERT_OR_THROW(x) ASSERT(x); if (!(x)) throw HErr("Assertion failed at %s:%d: %s", __FILE__, __LINE__, #x) 46 51 #else 47 52 # define ASSERT_OR_THROW(x) if (!(x)) throw HErr("Assertion failed at %s:%d: %s", __FILE__, __LINE__, #x) 48 53 #endif 49 54 50 IMPEXP_LIBHEKKEL const char kDefaultMessage[] = "An OS error occurred: %s";55 IMPEXP_LIBHEKKEL const char kDefaultMessage[] = B_TRANSLATE("An OS error occurred: %s"); 51 56 52 57 class IMPEXP_LIBHEKKEL HErr 53 58 { -
Sources/HPreferences.cpp
38 38 #include "HError.h" 39 39 #include "Prefs.h" 40 40 41 #include <Catalog.h> 42 41 43 #define BLOCK BAutolock lock(fLock); if (! lock.IsLocked()) return 42 44 45 #undef B_TRANSLATE_CONTEXT 46 #define B_TRANSLATE_CONTEXT "h Preference" 47 43 48 HPreferences *gPrefs = NULL; 44 49 45 50 HPreferences::HPreferences(const char *preffilename) … … 320 325 f = fopen(fFile, "w"); 321 326 322 327 if (!f) 323 throw HErr( "Could not create settings file");328 throw HErr(B_TRANSLATE("Could not create settings file")); 324 329 325 330 PrefMap::iterator pi; 326 331 -
Sources/CFtpDialog.cpp
33 33 Created: 11/14/98 13:50:36 34 34 */ 35 35 36 #include <Catalog.h> 37 36 38 #include "pe.h" 37 39 #include "PApp.h" 38 40 #include "CFtpDialog.h" … … 56 58 typedef int socklen_t; 57 59 #endif 58 60 61 #undef B_TRANSLATE_CONTEXT 62 #define B_TRANSLATE_CONTEXT "C Ftp Dialog" 63 59 64 static string sfPassword; 60 65 61 66 const unsigned long … … 202 207 203 208 void CFtpDialog::Layout(void) 204 209 { 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!")); 213 218 fDirectoryField->ResizeLocalized(); 214 219 fFileName->ResizeLocalized(); 215 220 … … 302 307 else 303 308 fFileName->SetText(name); 304 309 305 fOkButton->SetLabel( "Save");310 fOkButton->SetLabel(B_TRANSLATE("Save")); 306 311 307 SetTitle( "Save on Server");312 SetTitle(B_TRANSLATE("Save on Server")); 308 313 } // CFtpDialog::MakeItSave 309 314 310 315 bool CFtpDialog::OkClicked() … … 456 461 void CFtpDialog::GetReply() 457 462 { 458 463 if (! s_gets(fReply, 1024, fSocketFD)) 459 THROW(( "Read error"));464 THROW((B_TRANSLATE("Read error"))); 460 465 461 466 char *m; 462 467 int r = strtoul(fReply, &m, 10); … … 467 472 do 468 473 { 469 474 if (! s_gets(fReply, 1024, fSocketFD)) 470 THROW(( "Read error"));475 THROW((B_TRANSLATE("Read error"))); 471 476 r2 = strtoul(fReply, &m, 10); 472 477 } 473 478 while (m == NULL || r2 != r || *m != ' '); … … 476 481 477 482 inline void FailSockErr(int e) 478 483 { 479 if (e < 0) THROW(( "Network error: %s", strerror(errno)));484 if (e < 0) THROW((B_TRANSLATE("Network error: %s"), strerror(errno))); 480 485 } /* FailSockErr */ 481 486 482 487 void CFtpDialog::Connect() … … 491 496 492 497 fSocket = socket(AF_INET, SOCK_STREAM, 0); 493 498 if (fSocket < 0) 494 THROW(("Failed to get socket: %s", strerror(errno))); 499 THROW((B_TRANSLATE("Failed to get socket: %s"), 500 strerror(errno))); 495 501 496 502 fSocketFD = s_open(fSocket, "r+"); 497 503 FailNil(fSocketFD); … … 500 506 501 507 struct hostent *host; 502 508 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))); 504 511 505 512 struct sockaddr_in sa; 506 513 sa.sin_family = AF_INET; … … 518 525 { 519 526 case 1: 520 527 if (*fReply != '2') 521 THROW(("Connect failed: %s", fReply)); 528 THROW(( 529 B_TRANSLATE("Connect failed: %s"), fReply)); 522 530 s_printf(fSocketFD, "user %s\r\n", GetText("user")); 523 531 state = 2; 524 532 break; … … 531 539 break; 532 540 } 533 541 else if (*fReply != '2' && *fReply != '5') 534 THROW(("Failed to login: %s", fReply)); 542 THROW(( 543 B_TRANSLATE("Failed to login: %s"), fReply)); 535 544 536 545 // fall thru 537 546 538 547 case 3: 539 548 if (*fReply == '5') 540 THROW(("Incorrect username/password.\n%s", fReply)); 549 THROW(( 550 B_TRANSLATE("Incorrect username/password.\n%s"), fReply)); 541 551 if (state == 3 && *fReply != '2') 542 THROW(( "Failed to login: %s", fReply));552 THROW((B_TRANSLATE("Failed to login: %s"), fReply)); 543 553 544 554 state = 0; 545 555 break; … … 612 622 613 623 data = socket(AF_INET, SOCK_STREAM, 0); 614 624 if (data < 0) 615 THROW(("Failed to get socket: %s", strerror(errno))); 625 THROW((B_TRANSLATE("Failed to get socket: %s"), 626 strerror(errno))); 616 627 617 628 memset(&saData, 0, sizeof(saData)); 618 629 saData.sin_family = AF_INET; … … 642 653 &size)); 643 654 unsigned char *sap = (unsigned char *)&saCmd.sin_addr.s_addr; 644 655 // 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], 646 657 sap[2], sap[3], pap[0], pap[1]); 647 658 } 648 659 … … 660 671 unsigned int sap[4]; 661 672 unsigned int pap[2]; 662 673 if (*fReply != '2') 663 THROW(( "Pasv command failed: %s", fReply));674 THROW((B_TRANSLATE("Pasv command failed: %s"), fReply)); 664 675 char* pos = strchr(fReply,'('); 665 676 if (!pos) 666 THROW(( "Answer to Pasv has unknown format: %s", fReply));677 THROW((B_TRANSLATE("Answer to Pasv has unknown format: %s"), fReply)); 667 678 int cnt = sscanf(pos+1, "%u,%u,%u,%u,%u,%u", 668 679 &sap[0], &sap[1], &sap[2], &sap[3], 669 680 &pap[0], &pap[1]); 670 681 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"), 672 683 cnt, fReply)); 673 684 char ipAddr[20]; 674 685 sprintf(ipAddr, "%d.%d.%d.%d", sap[0], sap[1], sap[2], sap[3]); … … 678 689 dsf = s_open(data, "r+"); 679 690 } else { 680 691 if (*fReply != '2') 681 THROW(( "Port command failed: %s", fReply));692 THROW((B_TRANSLATE("Port command failed: %s"), fReply)); 682 693 } 683 694 s_printf(fSocketFD, "list\r\n"); 684 695 state = 2; … … 712 723 delete item; 713 724 } 714 725 if (entryCount == 0) 715 THROW(( "Could not get listing."));726 THROW((B_TRANSLATE("Could not get listing."))); 716 727 717 728 fListView->Invalidate(); 718 729 UpdateIfNeeded(); … … 731 742 state = 3; 732 743 } 733 744 else 734 THROW(( "Failed to get listing: %s", fReply));745 THROW((B_TRANSLATE("Failed to get listing: %s"), fReply)); 735 746 break; 736 747 737 748 case 3: 738 749 if (*fReply != '2') 739 THROW(( "Something went wrong fetching the directory listing"));750 THROW((B_TRANSLATE("Something went wrong fetching the directory listing"))); 740 751 state = 0; 741 752 break; 742 753 } … … 766 777 GetReply(); 767 778 768 779 if (*fReply != '2') 769 THROW(( "Changing directory failed.\n%s", fReply));780 THROW((B_TRANSLATE("Changing directory failed.\n%s"), fReply)); 770 781 771 782 ListDirectory(); 772 783 } … … 793 804 GetReply(); 794 805 795 806 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)); 797 808 798 809 char *e; 799 810 int n; -
Sources/CRegex.cpp
3 3 Copyright 2005 Oliver Tappe - published under the MIT license. 4 4 */ 5 5 6 #include <Catalog.h> 7 6 8 #include "pe.h" 7 9 8 10 #include "CRegex.h" 9 11 12 #undef B_TRANSLATE_CONTEXT 13 #define B_TRANSLATE_CONTEXT "C Regex" 14 10 15 const status_t krx_NoMatch = PCRE_ERROR_NOMATCH; 11 16 const status_t krx_NotBOL = PCRE_NOTBOL; 12 17 const status_t krx_NotEOL = PCRE_NOTEOL; … … 152 157 { 153 158 if (!patt || !strlen(patt)) 154 159 { 155 fErrorStr = "Pattern is empty!";160 fErrorStr = B_TRANSLATE("Pattern is empty!"); 156 161 return B_BAD_VALUE; 157 162 } 158 163 uint32 options = PCRE_UTF8 | PCRE_MULTILINE; -
Sources/MAlert.cpp
5 5 6 6 #include "MAlert.h" 7 7 8 #include <Catalog.h> 8 9 #include <Beep.h> 9 10 10 11 12 #undef B_TRANSLATE_CONTEXT 13 #define B_TRANSLATE_CONTEXT "M Alert" 11 14 15 12 16 bool MAlert::sAlertIsNoisy = FALSE; 13 17 14 18 bool … … 59 63 else 60 64 { 61 65 fNumButtons = 1; 62 a1 = "OK";66 a1 = B_TRANSLATE("OK"); 63 67 a2 = NULL; 64 68 a3 = NULL; 65 69 } 66 fAlert = new BAlert( "Alert", message, a1, a2, a3,70 fAlert = new BAlert(B_TRANSLATE("Alert"), message, a1, a2, a3, 67 71 B_WIDTH_AS_USUAL, type); 68 72 69 73 // The Escape key shall trigger the second button from the right -
Sources/PAbout.cpp
43 43 # include "PApp.h" 44 44 #endif 45 45 46 #include <Catalog.h> 47 48 #undef B_TRANSLATE_CONTEXT 49 #define B_TRANSLATE_CONTEXT "P About" 50 46 51 const char kAboutText[] = 52 B_TRANSLATE_MARK( 47 53 "Pe 2.4.3 Open Source Version\n\n" 48 54 "a high performance editor\n" 49 55 "created by Maarten Hekkelman.\n" … … 76 82 "Oscar Lesta\n" 77 83 "Rainer Riedl\n" 78 84 "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"); 80 86 81 87 #ifdef __HAIKU__ 82 const char kAboutText2[] = "Haiku Rules!";88 const char kAboutText2[] = B_TRANSLATE_MARK("Haiku Rules!"); 83 89 #else 84 const char kAboutText2[] = "BeOS Rules!";90 const char kAboutText2[] = B_TRANSLATE_MARK("BeOS Rules!"); 85 91 #endif 86 92 87 93 #if STANDALONE -
Sources/CLanguageAddOn.cpp
33 33 Created: 12/07/97 22:53:14 by Maarten Hekkelman 34 34 */ 35 35 36 #include <Catalog.h> 37 36 38 #include "pe.h" 37 39 #include "PText.h" 38 40 #include "PApp.h" … … 46 48 #include "HError.h" 47 49 #include "HColorUtils.h" 48 50 51 #undef B_TRANSLATE_CONTEXT 52 #define B_TRANSLATE_CONTEXT "" 53 49 54 CLanguageProxy::CLanguageProxy(CLanguageInterface& intf, const char *text, int size, 50 55 int *starts, rgb_color *colors) 51 56 : fText(text) … … 114 119 void CLanguageProxy::AddFunction(const char *name, const char *match, 115 120 int offset, bool italic, const char *params) 116 121 { 117 FailNilMsg(fFunctionScanHandler, "Not a valid call in this context");122 FailNilMsg(fFunctionScanHandler, B_TRANSLATE("Not a valid call in this context")); 118 123 fFunctionScanHandler->AddFunction(name, match, offset, italic, fNestLevel, params); 119 124 } /* CLanguageProxy::AddFunction */ 120 125 121 126 void CLanguageProxy::AddInclude(const char *name, const char *open, bool italic) 122 127 { 123 FailNilMsg(fFunctionScanHandler, "Not a valid call in this context");128 FailNilMsg(fFunctionScanHandler, B_TRANSLATE("Not a valid call in this context")); 124 129 fFunctionScanHandler->AddInclude(name, open, italic); 125 130 } /* CLanguageProxy::AddFunction */ 126 131 127 132 void CLanguageProxy::AddSeparator(const char* nm) 128 133 { 129 FailNilMsg(fFunctionScanHandler, "Not a valid call in this context");134 FailNilMsg(fFunctionScanHandler, B_TRANSLATE("Not a valid call in this context")); 130 135 BString name; 131 136 if (nm) { 132 137 while(isspace(*nm) || *nm=='-') -
Sources/PMessageWindow.cpp
45 45 #include "HDefines.h" 46 46 #include "PMessages.h" 47 47 48 #include <Catalog.h> 49 50 #undef B_TRANSLATE_CONTEXT 51 #define B_TRANSLATE_CONTEXT "P Message Window" 52 48 53 BBitmap *PMessageItem::sfInfoIcon = NULL; 49 54 BBitmap *PMessageItem::sfInfoIconSelected = NULL; 50 55 BBitmap *PMessageItem::sfErrorIcon = NULL; … … 57 62 unsigned char *icon; 58 63 59 64 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)); 61 66 62 67 normal = new BBitmap(BRect(0, 0, 15, 15), B_COLOR_8_BIT); 63 68 FailNil(normal); -
Sources/PTextBuffer.cpp
36 36 #include "Utils.h" 37 37 #include "HError.h" 38 38 39 #include <Catalog.h> 40 41 #undef B_TRANSLATE_CONTEXT 42 #define B_TRANSLATE_CONTEXT "P Text Buffer" 43 39 44 const int 40 45 kBlockSize = 2048; 41 46 … … 222 227 { 223 228 char t[4]; 224 229 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"), 226 231 fLogicalSize, fPhysicalSize, fGap, fGapSize, t); 227 232 } /* PTextBuffer::PrintToStream */ 228 233 -
Sources/HLazyObject.cpp
35 35 36 36 #include "pe.h" 37 37 #include "HLazyObject.h" 38 39 #include <Catalog.h> 40 38 41 #include <memory> 39 42 43 #undef B_TRANSLATE_CONTEXT 44 #define B_TRANSLATE_CONTEXT "H Lazy Object" 45 40 46 HLazyObject::HLazyObject(BLooper *looper) 41 47 { 42 48 looper->AddHandler(this); … … 81 87 default: 82 88 { 83 89 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")); 85 91 msg->SendReply(&reply); 86 92 break; 87 93 } … … 93 99 BMessage reply; 94 100 95 101 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); 97 103 reply.AddString("Error", s); 98 104 99 105 msg->SendReply(&reply); … … 104 110 BMessage reply; 105 111 106 112 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); 108 114 reply.AddString("Error", s); 109 115 110 116 msg->SendReply(&reply); -
Sources/PProjectWindow.cpp
35 35 36 36 #include "pe.h" 37 37 38 #include <Catalog.h> 38 39 #include <stack> 39 40 40 41 #include <fs_attr.h> … … 60 61 #include "ResourcesToolbars.h" 61 62 #include "Utils.h" 62 63 64 #undef B_TRANSLATE_CONTEXT 65 #define B_TRANSLATE_CONTEXT "P Project Window" 66 63 67 const unsigned long msg_Done = 'done'; 64 68 65 69 PProjectWindow* … … 271 275 try 272 276 { 273 277 if (!fPrjFile) 274 THROW(( "No project available"));278 THROW((B_TRANSLATE("No project available"))); 275 279 276 280 fPrjFile->Save(); 277 281 SetDirty(false); … … 315 319 316 320 const char* PProjectWindow::DefaultName() const 317 321 { 318 return "Untitled Project";322 return B_TRANSLATE("Untitled Project"); 319 323 } 320 324 321 325 const char* PProjectWindow::ErrorMsg() const … … 406 410 } 407 411 408 412 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")); 410 414 fPanel->Show(); 411 415 } 412 416 } /* PProjectWindow::AddFiles */ … … 434 438 = dynamic_cast<CProjectGroupItem*>(projectItem->ModelItem()); 435 439 if (projectGroupItem) { 436 440 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, 440 444 B_WIDTH_AS_USUAL, B_OFFSET_SPACING, 441 445 B_WARNING_ALERT); 442 446 alert->SetShortcut( 0, B_ESCAPE);