From 43b77ba2d722cdb8a9437926f839c1dcbf3c0b89 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Sat, 9 Sep 2006 15:27:44 +0000 Subject: [PATCH] Change _() to return a docstring. Fixup callers with the help of lyx::to_utf8. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14952 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView_pimpl.C | 62 +++---- src/Chktex.C | 4 +- src/CutAndPaste.C | 16 +- src/LColor.C | 4 +- src/LaTeX.C | 8 +- src/MenuBackend.C | 28 +-- src/SpellBase.C | 2 +- src/ToolbarBackend.C | 2 +- src/buffer.C | 78 ++++---- src/buffer_funcs.C | 40 ++--- src/bufferlist.C | 32 ++-- src/bufferparams.C | 16 +- src/bufferview_funcs.C | 2 +- src/converter.C | 42 ++--- src/debug.C | 8 +- src/exporter.C | 30 ++-- src/format.C | 44 ++--- src/frontends/LyXView.C | 4 +- src/frontends/Toolbars.C | 4 +- src/frontends/WorkArea.C | 2 +- src/frontends/controllers/ControlAboutlyx.C | 18 +- src/frontends/controllers/ControlBibtex.C | 14 +- src/frontends/controllers/ControlBox.C | 24 +-- src/frontends/controllers/ControlErrorList.C | 6 +- src/frontends/controllers/ControlExternal.C | 4 +- src/frontends/controllers/ControlGraphics.C | 10 +- src/frontends/controllers/ControlInclude.C | 10 +- src/frontends/controllers/ControlLog.C | 16 +- src/frontends/controllers/ControlPrefs.C | 24 ++- src/frontends/controllers/ControlPrint.C | 5 +- .../controllers/ControlSpellchecker.C | 21 ++- src/frontends/controllers/ControlToc.C | 4 +- src/frontends/controllers/ControlViewSource.C | 2 +- src/frontends/controllers/biblio.C | 10 +- src/frontends/controllers/character.C | 90 +++++----- src/frontends/controllers/frnt_lang.C | 6 +- src/frontends/controllers/helper_funcs.C | 5 +- src/frontends/controllers/tex_helpers.C | 5 +- src/frontends/gtk/Dialogs.C | 34 ++-- src/frontends/gtk/GAboutlyx.C | 3 +- src/frontends/gtk/GBC.h | 4 +- src/frontends/gtk/GBibItem.C | 7 +- src/frontends/gtk/GBibtex.C | 3 +- src/frontends/gtk/GBox.C | 21 +-- src/frontends/gtk/GBranch.C | 4 +- src/frontends/gtk/GChanges.C | 18 +- src/frontends/gtk/GCharacter.C | 4 +- src/frontends/gtk/GCitation.C | 17 +- src/frontends/gtk/GDocument.C | 73 ++++---- src/frontends/gtk/GERT.C | 2 +- src/frontends/gtk/GErrorList.C | 4 +- src/frontends/gtk/GExternal.C | 90 +++++----- src/frontends/gtk/GFloat.C | 2 +- src/frontends/gtk/GGraphics.C | 8 +- src/frontends/gtk/GInclude.C | 2 +- src/frontends/gtk/GLog.C | 4 +- src/frontends/gtk/GMathDelim.C | 2 +- src/frontends/gtk/GMathPanel.C | 2 +- src/frontends/gtk/GMathsMatrix.C | 2 +- src/frontends/gtk/GNote.C | 2 +- src/frontends/gtk/GParagraph.C | 4 +- src/frontends/gtk/GPreferences.C | 28 +-- src/frontends/gtk/GRef.C | 10 +- src/frontends/gtk/GSearch.C | 28 +-- src/frontends/gtk/GSendto.C | 2 +- src/frontends/gtk/GShowFile.C | 4 +- src/frontends/gtk/GSpellchecker.C | 5 +- src/frontends/gtk/GTableCreate.C | 2 +- src/frontends/gtk/GTabular.C | 10 +- src/frontends/gtk/GTexinfo.C | 8 +- src/frontends/gtk/GThesaurus.C | 8 +- src/frontends/gtk/GToc.C | 6 +- src/frontends/gtk/GUrl.C | 2 +- src/frontends/gtk/GVSpace.C | 2 +- src/frontends/gtk/GWrap.C | 2 +- src/frontends/qt3/Alert_pimpl.C | 10 +- src/frontends/qt3/Dialogs.C | 4 +- src/frontends/qt3/FileDialog.C | 2 +- src/frontends/qt3/QAbout.C | 2 +- src/frontends/qt3/QBibitem.C | 2 +- src/frontends/qt3/QBibtex.C | 2 +- src/frontends/qt3/QBox.C | 2 +- src/frontends/qt3/QBranch.C | 2 +- src/frontends/qt3/QChanges.C | 6 +- src/frontends/qt3/QCharacter.C | 2 +- src/frontends/qt3/QCitation.C | 2 +- src/frontends/qt3/QDocument.C | 4 +- src/frontends/qt3/QDocumentDialog.C | 36 ++-- src/frontends/qt3/QERT.C | 2 +- src/frontends/qt3/QExternal.C | 2 +- src/frontends/qt3/QFloat.C | 2 +- src/frontends/qt3/QGraphics.C | 2 +- src/frontends/qt3/QInclude.C | 2 +- src/frontends/qt3/QMath.C | 6 +- src/frontends/qt3/QNote.C | 2 +- src/frontends/qt3/QParagraph.C | 6 +- src/frontends/qt3/QPrefs.C | 2 +- src/frontends/qt3/QPrefsDialog.C | 64 +++---- src/frontends/qt3/QPrint.C | 2 +- src/frontends/qt3/QRef.C | 2 +- src/frontends/qt3/QSearch.C | 2 +- src/frontends/qt3/QSendto.C | 2 +- src/frontends/qt3/QShowFile.C | 2 +- src/frontends/qt3/QSpellchecker.C | 2 +- src/frontends/qt3/QTabular.C | 2 +- src/frontends/qt3/QTabularCreate.C | 2 +- src/frontends/qt3/QTexinfo.C | 2 +- src/frontends/qt3/QThesaurus.C | 2 +- src/frontends/qt3/QToc.C | 2 +- src/frontends/qt3/QURL.C | 2 +- src/frontends/qt3/QVSpace.C | 2 +- src/frontends/qt3/QWrap.C | 2 +- src/frontends/qt3/Qt2BC.h | 3 +- src/frontends/qt3/validators.C | 6 +- src/frontends/qt4/Alert_pimpl.C | 10 +- src/frontends/qt4/Dialogs.C | 4 +- src/frontends/qt4/FileDialog.C | 2 +- src/frontends/qt4/QAbout.C | 2 +- src/frontends/qt4/QBibitem.C | 2 +- src/frontends/qt4/QBibtex.C | 2 +- src/frontends/qt4/QBox.C | 2 +- src/frontends/qt4/QBranch.C | 2 +- src/frontends/qt4/QChanges.C | 6 +- src/frontends/qt4/QCharacter.C | 2 +- src/frontends/qt4/QDocument.C | 2 +- src/frontends/qt4/QDocumentDialog.C | 32 ++-- src/frontends/qt4/QERT.C | 2 +- src/frontends/qt4/QExternal.C | 2 +- src/frontends/qt4/QFloat.C | 2 +- src/frontends/qt4/QGraphics.C | 2 +- src/frontends/qt4/QInclude.C | 2 +- src/frontends/qt4/QMath.C | 6 +- src/frontends/qt4/QNote.C | 2 +- src/frontends/qt4/QParagraph.C | 6 +- src/frontends/qt4/QPrefs.C | 2 +- src/frontends/qt4/QPrefsDialog.C | 70 ++++---- src/frontends/qt4/QPrint.C | 2 +- src/frontends/qt4/QRef.C | 2 +- src/frontends/qt4/QSearch.C | 2 +- src/frontends/qt4/QSendto.C | 2 +- src/frontends/qt4/QShowFile.C | 2 +- src/frontends/qt4/QSpellchecker.C | 2 +- src/frontends/qt4/QTabular.C | 2 +- src/frontends/qt4/QTabularCreate.C | 2 +- src/frontends/qt4/QTexinfo.C | 2 +- src/frontends/qt4/QThesaurus.C | 2 +- src/frontends/qt4/QVSpace.C | 2 +- src/frontends/qt4/QWrap.C | 2 +- src/frontends/qt4/Qt2BC.h | 3 +- src/frontends/qt4/UrlView.C | 2 +- src/frontends/qt4/qt_helpers.C | 4 +- src/frontends/qt4/validators.C | 6 +- src/gettext.C | 8 +- src/gettext.h | 4 +- src/importer.C | 8 +- src/insets/insetbase.C | 3 +- src/insets/insetbibtex.C | 17 +- src/insets/insetbox.C | 41 +++-- src/insets/insetbranch.C | 9 +- src/insets/insetcaption.C | 13 +- src/insets/insetcaption.h | 4 +- src/insets/insetcharstyle.C | 13 +- src/insets/insetenv.C | 3 +- src/insets/insetert.C | 6 +- src/insets/insetexternal.C | 3 +- src/insets/insetfloat.C | 17 +- src/insets/insetfloatlist.C | 6 +- src/insets/insetfoot.C | 9 +- src/insets/insetgraphics.C | 13 +- src/insets/insetinclude.C | 40 +++-- src/insets/insetindex.C | 6 +- src/insets/insetmarginal.C | 9 +- src/insets/insetnote.C | 28 +-- src/insets/insetoptarg.C | 9 +- src/insets/insetpagebreak.C | 7 +- src/insets/insetref.C | 3 +- src/insets/insettabular.C | 18 +- src/insets/insettext.C | 7 +- src/insets/insettoc.C | 5 +- src/insets/inseturl.C | 5 +- src/insets/insetvspace.C | 11 +- src/insets/insetwrap.C | 9 +- src/insets/render_graphic.C | 76 ++++---- src/insets/render_preview.C | 13 +- src/ispell.C | 22 +-- src/kbsequence.C | 2 +- src/lyx_cb.C | 60 +++---- src/lyx_main.C | 76 ++++---- src/lyxfind.C | 10 +- src/lyxfont.C | 24 +-- src/lyxfunc.C | 100 +++++------ src/lyxrc.C | 13 +- src/lyxvc.C | 22 +-- src/mathed/math_gridinset.C | 3 +- src/mathed/math_hullinset.C | 13 +- src/mathed/math_macrotemplate.C | 6 +- src/mathed/math_nestinset.C | 13 +- src/mathed/ref_inset.C | 3 +- src/output.C | 6 +- src/output_plaintext.C | 8 +- src/paragraph.C | 2 +- src/rowpainter.C | 2 +- src/support/filefilterlist.C | 3 +- src/support/package.C.in | 35 ++-- src/text.C | 168 +++++++++--------- src/text2.C | 12 +- src/text3.C | 16 +- src/vspace.C | 12 +- 208 files changed, 1375 insertions(+), 1216 deletions(-) diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index 7130d45617..136a45e19d 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -161,11 +161,11 @@ bool BufferView::Pimpl::loadLyXFile(string const & filename, bool tolastfiles) // File already open? if (bufferlist.exists(s)) { string const file = makeDisplayPath(s, 20); - string text = bformat(_("The document %1$s is already " - "loaded.\n\nDo you want to revert " - "to the saved version?"), file); - int const ret = Alert::prompt(_("Revert to saved document?"), - text, 0, 1, _("&Revert"), _("&Switch to document")); + string text = bformat(lyx::to_utf8(_("The document %1$s is already " + "loaded.\n\nDo you want to revert " + "to the saved version?")), file); + int const ret = Alert::prompt(lyx::to_utf8(_("Revert to saved document?")), + text, 0, 1, lyx::to_utf8(_("&Revert")), lyx::to_utf8(_("&Switch to document"))); if (ret != 0) { setBuffer(bufferlist.getBuffer(s)); @@ -186,11 +186,11 @@ bool BufferView::Pimpl::loadLyXFile(string const & filename, bool tolastfiles) return false; } } else { - string text = bformat(_("The document %1$s does not yet " - "exist.\n\nDo you want to create " - "a new document?"), s); - int const ret = Alert::prompt(_("Create new document?"), - text, 0, 1, _("&Create"), _("Cancel")); + string text = bformat(lyx::to_utf8(_("The document %1$s does not yet " + "exist.\n\nDo you want to create " + "a new document?")), s); + int const ret = Alert::prompt(lyx::to_utf8(_("Create new document?")), + text, 0, 1, lyx::to_utf8(_("&Create")), lyx::to_utf8(_("Cancel"))); if (ret == 0) { b = newFile(s, string(), true); @@ -604,7 +604,7 @@ void BufferView::Pimpl::savePosition(unsigned int i) cursor_.pos()); if (i > 0) // emit message signal. - bv_->message(bformat(_("Saved bookmark %1$d"), i)); + bv_->message(bformat(lyx::to_utf8(_("Saved bookmark %1$d")), i)); } @@ -638,7 +638,7 @@ void BufferView::Pimpl::restorePosition(unsigned int i) if (i > 0) // emit message signal. - bv_->message(bformat(_("Moved to bookmark %1$d"), i)); + bv_->message(bformat(lyx::to_utf8(_("Moved to bookmark %1$d")), i)); } @@ -708,16 +708,16 @@ void BufferView::Pimpl::menuInsertLyXFile(string const & filenm) initpath = trypath; } - FileDialog fileDlg(_("Select LyX document to insert"), + FileDialog fileDlg(lyx::to_utf8(_("Select LyX document to insert")), LFUN_FILE_INSERT, - make_pair(string(_("Documents|#o#O")), + make_pair(string(lyx::to_utf8(_("Documents|#o#O"))), string(lyxrc.document_path)), - make_pair(string(_("Examples|#E#e")), + make_pair(string(lyx::to_utf8(_("Examples|#E#e"))), string(addPath(package().system_support(), "examples")))); FileDialog::Result result = fileDlg.open(initpath, - FileFilterList(_("LyX Documents (*.lyx)")), + FileFilterList(lyx::to_utf8(_("LyX Documents (*.lyx)"))), string()); if (result.first == FileDialog::Later) @@ -728,7 +728,7 @@ void BufferView::Pimpl::menuInsertLyXFile(string const & filenm) // check selected filename if (filename.empty()) { // emit message signal. - bv_->message(_("Canceled.")); + bv_->message(lyx::to_utf8(_("Canceled."))); return; } } @@ -739,7 +739,7 @@ void BufferView::Pimpl::menuInsertLyXFile(string const & filenm) string const disp_fn = makeDisplayPath(filename); // emit message signal. - bv_->message(bformat(_("Inserting document %1$s..."), disp_fn)); + bv_->message(bformat(lyx::to_utf8(_("Inserting document %1$s...")), disp_fn)); string res; Buffer buf("", false); @@ -749,9 +749,9 @@ void BufferView::Pimpl::menuInsertLyXFile(string const & filenm) el = buf.errorList("Parse"); lyx::cap::pasteParagraphList(cursor_, buf.paragraphs(), buf.params().textclass, el); - res = _("Document %1$s inserted."); + res = lyx::to_utf8(_("Document %1$s inserted.")); } else - res = _("Could not insert document %1$s"); + res = lyx::to_utf8(_("Could not insert document %1$s")); // emit message signal. bv_->message(bformat(res, disp_fn)); @@ -957,10 +957,10 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & cmd) case LFUN_UNDO: if (available()) { - cur.message(_("Undo")); + cur.message(lyx::to_utf8(_("Undo"))); cur.clearSelection(); if (!textUndo(*bv_)) - cur.message(_("No further undo information")); + cur.message(lyx::to_utf8(_("No further undo information"))); update(); switchKeyMap(); } @@ -968,10 +968,10 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & cmd) case LFUN_REDO: if (available()) { - cur.message(_("Redo")); + cur.message(lyx::to_utf8(_("Redo"))); cur.clearSelection(); if (!textRedo(*bv_)) - cur.message(_("No further redo information")); + cur.message(lyx::to_utf8(_("No further redo information"))); update(); switchKeyMap(); } @@ -1182,20 +1182,20 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & cmd) string message; if (count != 1) { if (cur.selection()) - message = bformat(_("%1$d words in selection."), + message = bformat(lyx::to_utf8(_("%1$d words in selection.")), count); else - message = bformat(_("%1$d words in document."), + message = bformat(lyx::to_utf8(_("%1$d words in document.")), count); } else { if (cur.selection()) - message = _("One word in selection."); + message = lyx::to_utf8(_("One word in selection.")); else - message = _("One word in document."); + message = lyx::to_utf8(_("One word in document.")); } - Alert::information(_("Count words"), message); + Alert::information(lyx::to_utf8(_("Count words")), message); } break; @@ -1222,9 +1222,9 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & cmd) if (!cur.result().dispatched()) cur.dispatch(tmpcmd); - if (cur.result().dispatched()) + if (cur.result().dispatched()) cur.clearSelection(); - + break; } diff --git a/src/Chktex.C b/src/Chktex.C index 8ca81b294c..6ae01d7df8 100644 --- a/src/Chktex.C +++ b/src/Chktex.C @@ -64,9 +64,9 @@ int Chktex::scanLogFile(TeXErrors & terr) string const tmp = onlyFilename(changeExtension(file, ".log")); #if USE_BOOST_FORMAT - boost::format msg(_("ChkTeX warning id # %1$d")); + boost::format msg(lyx::to_utf8(_("ChkTeX warning id # %1$d"))); #else - string const msg(_("ChkTeX warning id # ")); + string const msg(lyx::to_utf8(_("ChkTeX warning id # "))); #endif ifstream ifs(tmp.c_str()); while (getline(ifs, token)) { diff --git a/src/CutAndPaste.C b/src/CutAndPaste.C index 8dc3e7be8a..32e862797c 100644 --- a/src/CutAndPaste.C +++ b/src/CutAndPaste.C @@ -91,7 +91,7 @@ public: // to the buffer language. if (p.ownerCode() == InsetBase::ERT_CODE) { p.changeLanguage(buffer_.params(), latex_language, - buffer_.getLanguage()); + buffer_.getLanguage()); } p.setInsetOwner(0); } @@ -403,11 +403,11 @@ void switchBetweenClasses(textclass_type c1, textclass_type c2, if (!hasLayout && name != tclass1.defaultLayoutName()) { string const s = bformat( - _("Layout had to be changed from\n%1$s to %2$s\n" - "because of class conversion from\n%3$s to %4$s"), + lyx::to_utf8(_("Layout had to be changed from\n%1$s to %2$s\n" + "because of class conversion from\n%3$s to %4$s")), name, it->layout()->name(), tclass1.name(), tclass2.name()); // To warn the user that something had to be done. - errorlist.push_back(ErrorItem(_("Changed Layout"), s, + errorlist.push_back(ErrorItem(lyx::to_utf8(_("Changed Layout")), s, it->id(), 0, it->size())); } @@ -425,14 +425,14 @@ void switchBetweenClasses(textclass_type c1, textclass_type c2, if (found_cs == tclass2.charstyles().end()) { // The character style is undefined in tclass2 inset.setUndefined(); - string const s = bformat(_( + string const s = bformat(lyx::to_utf8(_( "Character style %1$s is " "undefined because of class " - "conversion from\n%2$s to %3$s"), + "conversion from\n%2$s to %3$s")), name, tclass1.name(), tclass2.name()); // To warn the user that something had to be done. errorlist.push_back(ErrorItem( - _("Undefined character style"), + lyx::to_utf8(_("Undefined character style")), s, it.paragraph().id(), it.pos(), it.pos() + 1)); } else if (inset.undefined()) { @@ -500,7 +500,7 @@ void cutSelection(LCursor & cur, bool doclear, bool realcut) // faster we need to be more clever and probably also have more // calls to cur.bv().owner()->gui().selection().put. (Lgb) // cur.bv().owner()->gui().selection().put(cur.selectionAsString(true)); - + // make sure that the depth behind the selection are restored, too recordUndoSelection(cur); diff --git a/src/LColor.C b/src/LColor.C index 08badd8b10..b63f716fbd 100644 --- a/src/LColor.C +++ b/src/LColor.C @@ -177,7 +177,7 @@ string const LColor::getGUIName(LColor::color c) const { Pimpl::InfoTab::const_iterator it = pimpl_->infotab.find(c); if (it != pimpl_->infotab.end()) - return _(it->second.guiname); + return lyx::to_utf8(_(it->second.guiname)); return "none"; } @@ -254,7 +254,7 @@ LColor::color LColor::getFromGUIName(string const & guiname) const Pimpl::InfoTab::const_iterator it = pimpl_->infotab.begin(); Pimpl::InfoTab::const_iterator end = pimpl_->infotab.end(); for (; it != end; ++it) { - if (!compare_ascii_no_case(_(it->second.guiname), guiname)) + if (!compare_ascii_no_case(lyx::to_utf8(_(it->second.guiname)), guiname)) return it->first; } return LColor::inherit; diff --git a/src/LaTeX.C b/src/LaTeX.C index b2866bbd21..5c5a966eb4 100644 --- a/src/LaTeX.C +++ b/src/LaTeX.C @@ -84,7 +84,7 @@ namespace { string runMessage(unsigned int count) { - return bformat(_("Waiting for LaTeX run number %1$d"), count); + return bformat(lyx::to_utf8(_("Waiting for LaTeX run number %1$d")), count); } } // anon namespace @@ -278,7 +278,7 @@ int LaTeX::run(TeXErrors & terr) if (head.haschanged(onlyFilename(changeExtension(file, ".idx")))) { // no checks for now lyxerr[Debug::LATEX] << "Running MakeIndex." << endl; - message(_("Running MakeIndex.")); + message(lyx::to_utf8(_("Running MakeIndex."))); rerun |= runMakeIndex(onlyFilename(changeExtension(file, ".idx")), runparams); } @@ -290,7 +290,7 @@ int LaTeX::run(TeXErrors & terr) // tags is found -> run bibtex and set rerun = true; // no checks for now lyxerr[Debug::LATEX] << "Running BibTeX." << endl; - message(_("Running BibTeX.")); + message(lyx::to_utf8(_("Running BibTeX."))); updateBibtexDependencies(head, bibtex_info); rerun |= runBibTeX(bibtex_info); } else if (!had_depfile) { @@ -346,7 +346,7 @@ int LaTeX::run(TeXErrors & terr) if (head.haschanged(onlyFilename(changeExtension(file, ".idx")))) { // no checks for now lyxerr[Debug::LATEX] << "Running MakeIndex." << endl; - message(_("Running MakeIndex.")); + message(lyx::to_utf8(_("Running MakeIndex."))); rerun = runMakeIndex(onlyFilename(changeExtension(file, ".idx")), runparams); } diff --git a/src/MenuBackend.C b/src/MenuBackend.C index 10b2c99e0b..795ed667ce 100644 --- a/src/MenuBackend.C +++ b/src/MenuBackend.C @@ -269,7 +269,7 @@ Menu & Menu::read(LyXLex & lex) // fallback to md_item case md_item: { lex.next(true); - string const name = _(lex.getString()); + string const name = lyx::to_utf8(_(lex.getString())); lex.next(true); string const command = lex.getString(); FuncRequest func = lyxaction.lookupFunc(command); @@ -335,7 +335,7 @@ Menu & Menu::read(LyXLex & lex) // fallback to md_submenu case md_submenu: { lex.next(true); - string const mlabel = _(lex.getString()); + string const mlabel = lyx::to_utf8(_(lex.getString())); lex.next(true); string const mname = lex.getString(); add(MenuItem(MenuItem::Submenu, mlabel, mname, @@ -448,7 +448,7 @@ void expandDocuments(Menu & tomenu, LyXView const * view) Strings const names = bufferlist.getFileNames(); if (names.empty()) { - tomenu.add(MenuItem(MenuItem::Command, _("No Documents Open!"), + tomenu.add(MenuItem(MenuItem::Command, lyx::to_utf8(_("No Documents Open!")), FuncRequest(LFUN_NOACTION)), view); return; } @@ -469,7 +469,7 @@ void expandFormats(MenuItem::Kind kind, Menu & tomenu, LyXView const * view) { if (!view->buffer() && kind != MenuItem::ImportFormats) { tomenu.add(MenuItem(MenuItem::Command, - _("No Documents Open!"), + lyx::to_utf8(_("No Documents Open!")), FuncRequest(LFUN_NOACTION)), view); return; @@ -508,9 +508,9 @@ void expandFormats(MenuItem::Kind kind, Menu & tomenu, LyXView const * view) switch (kind) { case MenuItem::ImportFormats: if ((*fit)->name() == "text") - label = _("Plain Text as Lines"); + label = lyx::to_utf8(_("Plain Text as Lines")); else if ((*fit)->name() == "textparagraph") - label = _("Plain Text as Paragraphs"); + label = lyx::to_utf8(_("Plain Text as Paragraphs")); label += "..."; break; case MenuItem::ViewFormats: @@ -537,7 +537,7 @@ void expandFloatListInsert(Menu & tomenu, LyXView const * view) { if (!view->buffer()) { tomenu.add(MenuItem(MenuItem::Command, - _("No Documents Open!"), + lyx::to_utf8(_("No Documents Open!")), FuncRequest(LFUN_NOACTION)), view); return; @@ -549,7 +549,7 @@ void expandFloatListInsert(Menu & tomenu, LyXView const * view) FloatList::const_iterator end = floats.end(); for (; cit != end; ++cit) { tomenu.add(MenuItem(MenuItem::Command, - _(cit->second.listName()), + lyx::to_utf8(_(cit->second.listName())), FuncRequest(LFUN_FLOAT_LIST, cit->second.type())), view); @@ -561,7 +561,7 @@ void expandFloatInsert(Menu & tomenu, LyXView const * view) { if (!view->buffer()) { tomenu.add(MenuItem(MenuItem::Command, - _("No Documents Open!"), + lyx::to_utf8(_("No Documents Open!")), FuncRequest(LFUN_NOACTION)), view); return; @@ -573,7 +573,7 @@ void expandFloatInsert(Menu & tomenu, LyXView const * view) FloatList::const_iterator end = floats.end(); for (; cit != end; ++cit) { // normal float - string const label = _(cit->second.name()); + string const label = lyx::to_utf8(_(cit->second.name())); tomenu.add(MenuItem(MenuItem::Command, label, FuncRequest(LFUN_FLOAT_INSERT, cit->second.type())), @@ -586,7 +586,7 @@ void expandCharStyleInsert(Menu & tomenu, LyXView const * view) { if (!view->buffer()) { tomenu.add(MenuItem(MenuItem::Command, - _("No Documents Open!"), + lyx::to_utf8(_("No Documents Open!")), FuncRequest(LFUN_NOACTION)), view); return; @@ -675,7 +675,7 @@ void expandToc(Menu & tomenu, LyXView const * view) Buffer const * buf = view->buffer(); if (!buf) { tomenu.add(MenuItem(MenuItem::Command, - _("No Documents Open!"), + lyx::to_utf8(_("No Documents Open!")), FuncRequest(LFUN_NOACTION)), view); return; @@ -701,7 +701,7 @@ void expandToc(Menu & tomenu, LyXView const * view) FuncRequest(ccit->action()))); } string const & floatName = floatlist.getType(cit->first).listName(); - MenuItem item(MenuItem::Submenu, _(floatName)); + MenuItem item(MenuItem::Submenu, lyx::to_utf8(_(floatName))); item.submenu(menu.release()); tomenu.add(item); } @@ -710,7 +710,7 @@ void expandToc(Menu & tomenu, LyXView const * view) cit = toc_list.find("TOC"); if (cit == end) { tomenu.add(MenuItem(MenuItem::Command, - _("No Table of contents"), + lyx::to_utf8(_("No Table of contents")), FuncRequest()), view); } else { diff --git a/src/SpellBase.C b/src/SpellBase.C index 7b5b04e1bf..3fbe175154 100644 --- a/src/SpellBase.C +++ b/src/SpellBase.C @@ -45,5 +45,5 @@ string const SpellBase::nextMiss() string const SpellBase::error() { - return _("Native OS API not yet supported."); + return lyx::to_utf8(_("Native OS API not yet supported.")); } diff --git a/src/ToolbarBackend.C b/src/ToolbarBackend.C index fe848c6b83..b4cd8042fe 100644 --- a/src/ToolbarBackend.C +++ b/src/ToolbarBackend.C @@ -94,7 +94,7 @@ void ToolbarBackend::read(LyXLex & lex) switch (lex.lex()) { case TO_ADD: if (lex.next(true)) { - string const tooltip = _(lex.getString()); + string const tooltip = lyx::to_utf8(_(lex.getString())); lex.next(true); string const func_arg = lex.getString(); lyxerr[Debug::PARSER] diff --git a/src/buffer.C b/src/buffer.C index d92deff60c..21b8b37aaa 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -231,8 +231,8 @@ Buffer::~Buffer() closing(); if (!temppath().empty() && !destroyDir(temppath())) { - Alert::warning(_("Could not remove temporary directory"), - bformat(_("Could not remove the temporary directory %1$s"), temppath())); + Alert::warning(lyx::to_utf8(_("Could not remove temporary directory")), + bformat(lyx::to_utf8(_("Could not remove the temporary directory %1$s")), temppath())); } // Remove any previewed LaTeX snippets associated with this buffer. @@ -389,9 +389,9 @@ namespace { void unknownClass(string const & unknown) { - Alert::warning(_("Unknown document class"), - bformat(_("Using the default document class, because the " - "class %1$s is unknown."), unknown)); + Alert::warning(lyx::to_utf8(_("Unknown document class")), + bformat(lyx::to_utf8(_("Using the default document class, because the " + "class %1$s is unknown.")), unknown)); } } // anon @@ -445,18 +445,18 @@ int Buffer::readHeader(LyXLex & lex) unknownClass(unknown); } else { ++unknown_tokens; - string const s = bformat(_("Unknown token: " - "%1$s %2$s\n"), + string const s = bformat(lyx::to_utf8(_("Unknown token: " + "%1$s %2$s\n")), token, lex.getString()); - errorList.push_back(ErrorItem(_("Document header error"), + errorList.push_back(ErrorItem(lyx::to_utf8(_("Document header error")), s, -1, 0, 0)); } } } if (begin_header_line) { - string const s = _("\\begin_header is missing"); - errorList.push_back(ErrorItem(_("Document header error"), + string const s = lyx::to_utf8(_("\\begin_header is missing")); + errorList.push_back(ErrorItem(lyx::to_utf8(_("Document header error")), s, -1, 0, 0)); } @@ -475,8 +475,8 @@ bool Buffer::readDocument(LyXLex & lex) lex.next(); string const token = lex.getString(); if (token != "\\begin_document") { - string const s = _("\\begin_document is missing"); - errorList.push_back(ErrorItem(_("Document header error"), + string const s = lyx::to_utf8(_("\\begin_document is missing")); + errorList.push_back(ErrorItem(lyx::to_utf8(_("Document header error")), s, -1, 0, 0)); } @@ -486,7 +486,7 @@ bool Buffer::readDocument(LyXLex & lex) readHeader(lex); if (!params().getLyXTextClass().load(filePath())) { string theclass = params().getLyXTextClass().name(); - Alert::error(_("Can't load document class"), bformat( + Alert::error(lyx::to_utf8(_("Can't load document class")), bformat( "Using the default document class, because the " " class %1$s could not be loaded.", theclass)); params().textclass = 0; @@ -599,8 +599,8 @@ bool Buffer::readFile(LyXLex & lex, string const & filename) BOOST_ASSERT(!filename.empty()); if (!lex.isOK()) { - Alert::error(_("Document could not be read"), - bformat(_("%1$s could not be read."), filename)); + Alert::error(lyx::to_utf8(_("Document could not be read")), + bformat(lyx::to_utf8(_("%1$s could not be read.")), filename)); return false; } @@ -608,8 +608,8 @@ bool Buffer::readFile(LyXLex & lex, string const & filename) string const token(lex.getString()); if (!lex.isOK()) { - Alert::error(_("Document could not be read"), - bformat(_("%1$s could not be read."), filename)); + Alert::error(lyx::to_utf8(_("Document could not be read")), + bformat(lyx::to_utf8(_("%1$s could not be read.")), filename)); return false; } @@ -617,8 +617,8 @@ bool Buffer::readFile(LyXLex & lex, string const & filename) if (token != "\\lyxformat") { lyxerr << "Token: " << token << endl; - Alert::error(_("Document format failure"), - bformat(_("%1$s is not a LyX document."), + Alert::error(lyx::to_utf8(_("Document format failure")), + bformat(lyx::to_utf8(_("%1$s is not a LyX document.")), filename)); return false; } @@ -637,21 +637,21 @@ bool Buffer::readFile(LyXLex & lex, string const & filename) if (file_format != LYX_FORMAT) { string const tmpfile = tempName(); if (tmpfile.empty()) { - Alert::error(_("Conversion failed"), - bformat(_("%1$s is from an earlier" + Alert::error(lyx::to_utf8(_("Conversion failed")), + bformat(lyx::to_utf8(_("%1$s is from an earlier" " version of LyX, but a temporary" " file for converting it could" - " not be created."), + " not be created.")), filename)); return false; } string const lyx2lyx = libFileSearch("lyx2lyx", "lyx2lyx"); if (lyx2lyx.empty()) { - Alert::error(_("Conversion script not found"), - bformat(_("%1$s is from an earlier" + Alert::error(lyx::to_utf8(_("Conversion script not found")), + bformat(lyx::to_utf8(_("%1$s is from an earlier" " version of LyX, but the" " conversion script lyx2lyx" - " could not be found."), + " could not be found.")), filename)); return false; } @@ -668,10 +668,10 @@ bool Buffer::readFile(LyXLex & lex, string const & filename) cmd_ret const ret = runCommand(command_str); if (ret.first != 0) { - Alert::error(_("Conversion script failed"), - bformat(_("%1$s is from an earlier version" + Alert::error(lyx::to_utf8(_("Conversion script failed")), + bformat(lyx::to_utf8(_("%1$s is from an earlier version" " of LyX, but the lyx2lyx script" - " failed to convert it."), + " failed to convert it.")), filename)); return false; } else { @@ -683,9 +683,9 @@ bool Buffer::readFile(LyXLex & lex, string const & filename) } if (readDocument(lex)) { - Alert::error(_("Document format failure"), - bformat(_("%1$s ended unexpectedly, which means" - " that it is probably corrupted."), + Alert::error(lyx::to_utf8(_("Document format failure")), + bformat(lyx::to_utf8(_("%1$s ended unexpectedly, which means" + " that it is probably corrupted.")), filename)); } @@ -720,9 +720,9 @@ bool Buffer::save() const fs::copy_file(fileName(), s, false); } catch (fs::filesystem_error const & fe) { - Alert::error(_("Backup failure"), - bformat(_("LyX was not able to make a backup copy in %1$s.\n" - "Please check if the directory exists and is writeable."), + Alert::error(lyx::to_utf8(_("Backup failure")), + bformat(lyx::to_utf8(_("LyX was not able to make a backup copy in %1$s.\n" + "Please check if the directory exists and is writeable.")), fs::path(s).branch_path().native_directory_string())); lyxerr[Debug::DEBUG] << "Fs error: " << fe.what() << endl; @@ -1076,7 +1076,7 @@ int Buffer::runChktex() string const org_path = filePath(); Path p(path); // path to LaTeX file - message(_("Running chktex...")); + message(lyx::to_utf8(_("Running chktex..."))); // Generate the LaTeX file if neccessary OutputParams runparams; @@ -1089,8 +1089,8 @@ int Buffer::runChktex() int const res = chktex.run(terr); // run chktex if (res == -1) { - Alert::error(_("chktex failure"), - _("Could not run chktex successfully.")); + Alert::error(lyx::to_utf8(_("chktex failure")), + lyx::to_utf8(_("Could not run chktex successfully."))); } else if (res > 0) { // Fill-in the error list with the TeX errors bufferErrors(*this, terr, errorLists_["ChkTex"]); @@ -1391,9 +1391,7 @@ docstring const Buffer::B_(string const & l10n) const return pimpl_->messages->get(l10n); } - // FIXME UNICODE When _() is changed to return a docstring - // the from_utf8 can be removed - return lyx::from_utf8(_(l10n)); + return _(l10n); } diff --git a/src/buffer_funcs.C b/src/buffer_funcs.C index f796951aa2..0de992187c 100644 --- a/src/buffer_funcs.C +++ b/src/buffer_funcs.C @@ -74,9 +74,9 @@ bool readFile(Buffer * const b, string const & s) // File information about normal file if (!fs::exists(s)) { string const file = makeDisplayPath(s, 50); - string text = bformat(_("The specified document\n%1$s" - "\ncould not be read."), file); - Alert::error(_("Could not read document"), text); + string text = bformat(lyx::to_utf8(_("The specified document\n%1$s" + "\ncould not be read.")), file); + Alert::error(lyx::to_utf8(_("Could not read document")), text); return false; } @@ -88,12 +88,12 @@ bool readFile(Buffer * const b, string const & s) { string const file = makeDisplayPath(s, 20); string const text = - bformat(_("An emergency save of the document " + bformat(lyx::to_utf8(_("An emergency save of the document " "%1$s exists.\n\n" - "Recover emergency save?"), file); - switch (Alert::prompt(_("Load emergency save?"), text, 0, 2, - _("&Recover"), _("&Load Original"), - _("&Cancel"))) + "Recover emergency save?")), file); + switch (Alert::prompt(lyx::to_utf8(_("Load emergency save?")), text, 0, 2, + lyx::to_utf8(_("&Recover")), lyx::to_utf8(_("&Load Original")), + lyx::to_utf8(_("&Cancel")))) { case 0: // the file is not saved if we load the emergency file. @@ -114,12 +114,12 @@ bool readFile(Buffer * const b, string const & s) { string const file = makeDisplayPath(s, 20); string const text = - bformat(_("The backup of the document " + bformat(lyx::to_utf8(_("The backup of the document " "%1$s is newer.\n\nLoad the " - "backup instead?"), file); - switch (Alert::prompt(_("Load backup?"), text, 0, 2, - _("&Load backup"), _("Load &original"), - _("&Cancel") )) + "backup instead?")), file); + switch (Alert::prompt(lyx::to_utf8(_("Load backup?")), text, 0, 2, + lyx::to_utf8(_("&Load backup")), lyx::to_utf8(_("Load &original")), + lyx::to_utf8(_("&Cancel") ))) { case 0: // the file is not saved if we load the autosave file. @@ -157,10 +157,10 @@ bool loadLyXFile(Buffer * b, string const & s) // Here we probably should run if (LyXVC::file_not_found_hook(s)) { string const text = - bformat(_("Do you want to retrieve the document" - " %1$s from version control?"), file); - int const ret = Alert::prompt(_("Retrieve from version control?"), - text, 0, 1, _("&Retrieve"), _("&Cancel")); + bformat(lyx::to_utf8(_("Do you want to retrieve the document" + " %1$s from version control?")), file); + int const ret = Alert::prompt(lyx::to_utf8(_("Retrieve from version control?")), + text, 0, 1, lyx::to_utf8(_("&Retrieve")), lyx::to_utf8(_("&Cancel"))); if (ret == 0) { // How can we know _how_ to do the checkout? @@ -192,8 +192,8 @@ Buffer * newFile(string const & filename, string const & templatename, if (!tname.empty()) { if (!b->readFile(tname)) { string const file = makeDisplayPath(tname, 50); - string const text = bformat(_("The specified document template\n%1$s\ncould not be read."), file); - Alert::error(_("Could not read template"), text); + string const text = bformat(lyx::to_utf8(_("The specified document template\n%1$s\ncould not be read.")), file); + Alert::error(lyx::to_utf8(_("Could not read template")), text); bufferlist.release(b); return 0; } @@ -491,7 +491,7 @@ void setLabel(Buffer const & buf, ParIterator & it) // Doesn't work... yet. // FIXME UNICODE - s = bformat(_("%1$s #:"), lyx::to_utf8(buf.B_(fl.name()))); + s = bformat(lyx::to_utf8(_("%1$s #:")), lyx::to_utf8(buf.B_(fl.name()))); } else { // par->SetLayout(0); // FIXME UNICODE diff --git a/src/bufferlist.C b/src/bufferlist.C index 861bb6fb43..ae1057bfcf 100644 --- a/src/bufferlist.C +++ b/src/bufferlist.C @@ -78,10 +78,10 @@ bool BufferList::quitWriteBuffer(Buffer * buf) file = makeDisplayPath(buf->fileName(), 30); string const text = - bformat(_("The document %1$s has unsaved changes.\n\n" - "Do you want to save the document or discard the changes?"), file); - int const ret = Alert::prompt(_("Save changed document?"), - text, 0, 2, _("&Save"), _("&Discard"), _("&Cancel")); + bformat(lyx::to_utf8(_("The document %1$s has unsaved changes.\n\n" + "Do you want to save the document or discard the changes?")), file); + int const ret = Alert::prompt(lyx::to_utf8(_("Save changed document?")), + text, 0, 2, lyx::to_utf8(_("&Save")), lyx::to_utf8(_("&Discard")), lyx::to_utf8(_("&Cancel"))); if (ret == 0) { // FIXME: WriteAs can be asynch ! @@ -126,7 +126,7 @@ bool BufferList::quitWriteAll() // save file names to .lyx/session it = bstore.begin(); for (; it != end; ++it) { - // if master/slave are both open, do not save slave since it + // if master/slave are both open, do not save slave since it // will be automatically loaded when the master is loaded if ((*it)->getMasterBuffer() == (*it)) LyX::ref().session().addLastOpenedFile((*it)->fileName()); @@ -185,10 +185,10 @@ bool BufferList::close(Buffer * buf, bool const ask) fname = makeDisplayPath(buf->fileName(), 30); string const text = - bformat(_("The document %1$s has unsaved changes.\n\n" - "Do you want to save the document or discard the changes?"), fname); - int const ret = Alert::prompt(_("Save changed document?"), - text, 0, 2, _("&Save"), _("&Discard"), _("&Cancel")); + bformat(lyx::to_utf8(_("The document %1$s has unsaved changes.\n\n" + "Do you want to save the document or discard the changes?")), fname); + int const ret = Alert::prompt(lyx::to_utf8(_("Save changed document?")), + text, 0, 2, lyx::to_utf8(_("&Save")), lyx::to_utf8(_("&Discard")), lyx::to_utf8(_("&Cancel"))); if (ret == 0) { if (buf->isUnnamed()) { @@ -307,7 +307,7 @@ void BufferList::emergencyWrite(Buffer * buf) string const doc = buf->isUnnamed() ? onlyFilename(buf->fileName()) : buf->fileName(); - lyxerr << bformat(_("LyX: Attempting to save document %1$s"), doc) << endl; + lyxerr << bformat(lyx::to_utf8(_("LyX: Attempting to save document %1$s")), doc) << endl; // We try to save three places: // 1) Same place as document. Unless it is an unnamed doc. @@ -317,10 +317,10 @@ void BufferList::emergencyWrite(Buffer * buf) lyxerr << " " << s << endl; if (buf->writeFile(s)) { buf->markClean(); - lyxerr << _(" Save seems successful. Phew.") << endl; + lyxerr << lyx::to_utf8(_(" Save seems successful. Phew.")) << endl; return; } else { - lyxerr << _(" Save failed! Trying...") << endl; + lyxerr << lyx::to_utf8(_(" Save failed! Trying...")) << endl; } } @@ -330,11 +330,11 @@ void BufferList::emergencyWrite(Buffer * buf) lyxerr << ' ' << s << endl; if (buf->writeFile(s)) { buf->markClean(); - lyxerr << _(" Save seems successful. Phew.") << endl; + lyxerr << lyx::to_utf8(_(" Save seems successful. Phew.")) << endl; return; } - lyxerr << _(" Save failed! Trying...") << endl; + lyxerr << lyx::to_utf8(_(" Save failed! Trying...")) << endl; // 3) In "/tmp" directory. // MakeAbsPath to prepend the current @@ -344,10 +344,10 @@ void BufferList::emergencyWrite(Buffer * buf) lyxerr << ' ' << s << endl; if (buf->writeFile(s)) { buf->markClean(); - lyxerr << _(" Save seems successful. Phew.") << endl; + lyxerr << lyx::to_utf8(_(" Save seems successful. Phew.")) << endl; return; } - lyxerr << _(" Save failed! Bummer. Document is lost.") << endl; + lyxerr << lyx::to_utf8(_(" Save failed! Bummer. Document is lost.")) << endl; } diff --git a/src/bufferparams.C b/src/bufferparams.C index 8b105ec539..243a7df3a6 100644 --- a/src/bufferparams.C +++ b/src/bufferparams.C @@ -418,20 +418,20 @@ string const BufferParams::readToken(LyXLex & lex, string const & token) pp = textclasslist.addTextClass(classname, filepath); if (pp.first) { textclass = pp.second; - } else { + } else { textclass = 0; return classname; - } + } } // FIXME: isTeXClassAvailable will try to load the layout file, but will // fail because of the lack of path info. Warnings will be given although // the layout file will be correctly loaded later. if (!getLyXTextClass().isTeXClassAvailable()) { string const msg = - bformat(_("The document uses a missing " - "TeX class \"%1$s\".\n"), classname); - Alert::warning(_("Document class not available"), - msg + _("LyX will not be able to produce output.")); + bformat(lyx::to_utf8(_("The document uses a missing " + "TeX class \"%1$s\".\n")), classname); + Alert::warning(lyx::to_utf8(_("Document class not available")), + msg + lyx::to_utf8(_("LyX will not be able to produce output."))); } } else if (token == "\\begin_preamble") { readPreamble(lex); @@ -815,7 +815,7 @@ bool BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features, // end of \documentclass defs // font selection must be done before loading fontenc.sty - string const fonts = + string const fonts = loadFonts(features, fontsRoman, fontsSans, fontsTypewriter, fontsSC, fontsOSF, fontsSansScale, fontsTypewriterScale); @@ -824,7 +824,7 @@ bool BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features, texrow.newline(); } if (fontsDefaultFamily != "default") - os << "\\renewcommand{\\familydefault}{\\" + os << "\\renewcommand{\\familydefault}{\\" << fontsDefaultFamily << "}\n"; // this one is not per buffer if (lyxrc.fontenc != "default") { diff --git a/src/bufferview_funcs.C b/src/bufferview_funcs.C index 2125c5706b..8669126de9 100644 --- a/src/bufferview_funcs.C +++ b/src/bufferview_funcs.C @@ -300,7 +300,7 @@ void gotoInset(BufferView * bv, vector const & codes, { LCursor tmpcur = bv->cursor(); if (!findInset(tmpcur, codes, same_content)) { - bv->cursor().message(_("No more insets")); + bv->cursor().message(lyx::to_utf8(_("No more insets"))); return; } diff --git a/src/converter.C b/src/converter.C index 5dc703fed9..ad54732087 100644 --- a/src/converter.C +++ b/src/converter.C @@ -315,10 +315,10 @@ bool Converters::convert(Buffer const * buffer, return true; } } - Alert::error(_("Cannot convert file"), - bformat(_("No information for converting %1$s " - "format files to %2$s.\n" - "Define a convertor in the preferences."), + Alert::error(lyx::to_utf8(_("Cannot convert file")), + bformat(lyx::to_utf8(_("No information for converting %1$s " + "format files to %2$s.\n" + "Define a convertor in the preferences.")), from_format, to_format)); return false; } @@ -395,7 +395,7 @@ bool Converters::convert(Buffer const * buffer, lyxerr[Debug::FILES] << "Calling " << command << endl; if (buffer) - buffer->message(_("Executing command: ") + buffer->message(lyx::to_utf8(_("Executing command: ")) + command); Systemcall::Starttype const type = (dummy) @@ -435,13 +435,13 @@ bool Converters::convert(Buffer const * buffer, if (res) { if (conv.to == "program") { - Alert::error(_("Build errors"), - _("There were errors during the build process.")); + Alert::error(lyx::to_utf8(_("Build errors")), + lyx::to_utf8(_("There were errors during the build process."))); } else { // FIXME: this should go out of here. For example, here we cannot say if // it is a document (.lyx) or something else. Same goes for elsewhere. - Alert::error(_("Cannot convert file"), - bformat(_("An error occurred whilst running %1$s"), + Alert::error(lyx::to_utf8(_("Cannot convert file")), + bformat(lyx::to_utf8(_("An error occurred whilst running %1$s")), command.substr(0, 50))); } return false; @@ -464,8 +464,8 @@ bool Converters::convert(Buffer const * buffer, token_base, to_base); Mover const & mover = movers(conv.from); if (!mover.rename(from, to)) { - Alert::error(_("Cannot convert file"), - bformat(_("Could not move a temporary file from %1$s to %2$s."), + Alert::error(lyx::to_utf8(_("Cannot convert file")), + bformat(lyx::to_utf8(_("Could not move a temporary file from %1$s to %2$s.")), from, to)); return false; } @@ -503,10 +503,10 @@ bool Converters::move(string const & fmt, ? mover.copy(from2, to2) : mover.rename(from2, to2); if (!moved && no_errors) { - Alert::error(_("Cannot convert file"), + Alert::error(lyx::to_utf8(_("Cannot convert file")), bformat(copy ? - _("Could not copy a temporary file from %1$s to %2$s.") : - _("Could not move a temporary file from %1$s to %2$s."), + lyx::to_utf8(_("Could not copy a temporary file from %1$s to %2$s.")) : + lyx::to_utf8(_("Could not move a temporary file from %1$s to %2$s.")), from2, to2)); no_errors = false; } @@ -574,7 +574,7 @@ bool Converters::runLaTeX(Buffer const & buffer, string const & command, OutputParams const & runparams, ErrorList & errorList) { buffer.busy(true); - buffer.message(_("Running LaTeX...")); + buffer.message(lyx::to_utf8(_("Running LaTeX..."))); runparams.document_language = buffer.params().language->babel(); @@ -592,13 +592,13 @@ bool Converters::runLaTeX(Buffer const & buffer, string const & command, // check return value from latex.run(). if ((result & LaTeX::NO_LOGFILE)) { string const str = - bformat(_("LaTeX did not run successfully. " - "Additionally, LyX could not locate " - "the LaTeX log %1$s."), name); - Alert::error(_("LaTeX failed"), str); + bformat(lyx::to_utf8(_("LaTeX did not run successfully. " + "Additionally, LyX could not locate " + "the LaTeX log %1$s.")), name); + Alert::error(lyx::to_utf8(_("LaTeX failed")), str); } else if (result & LaTeX::NO_OUTPUT) { - Alert::warning(_("Output is empty"), - _("An empty output file was generated.")); + Alert::warning(lyx::to_utf8(_("Output is empty")), + lyx::to_utf8(_("An empty output file was generated."))); } diff --git a/src/debug.C b/src/debug.C index 2b4badfcfa..f27ee93942 100644 --- a/src/debug.C +++ b/src/debug.C @@ -107,9 +107,9 @@ void lyx_debug_trait::showLevel(ostream & os, lyx_debug_trait::type level) if (errorTags[i].level != Debug::ANY && errorTags[i].level != Debug::NONE && errorTags[i].level & level) { - // avoid _(...) re-entrance problem - string const s = _(errorTags[i].desc); - os << bformat(_("Debugging `%1$s' (%2$s)"), + // avoid lyx::to_utf8(_(...)) re-entrance problem + string const s = lyx::to_utf8(_(errorTags[i].desc)); + os << bformat(lyx::to_utf8(_("Debugging `%1$s' (%2$s)")), errorTags[i].name, s) << '\n'; } @@ -123,7 +123,7 @@ void lyx_debug_trait::showTags(ostream & os) for (int i = 0; i < numErrorTags ; ++i) os << setw(7) << static_cast(errorTags[i].level) << setw(10) << errorTags[i].name - << " " << _(errorTags[i].desc) << '\n'; + << " " << lyx::to_utf8(_(errorTags[i].desc)) << '\n'; os.flush(); } diff --git a/src/exporter.C b/src/exporter.C index 39ff619440..73e257be52 100644 --- a/src/exporter.C +++ b/src/exporter.C @@ -74,13 +74,13 @@ vector const Backends(Buffer const & buffer) int checkOverwrite(string const & filename) { if (fs::exists(filename)) { - string text = bformat(_("The file %1$s already exists.\n\n" - "Do you want to over-write that file?"), + string text = bformat(lyx::to_utf8(_("The file %1$s already exists.\n\n" + "Do you want to over-write that file?")), makeDisplayPath(filename)); - return Alert::prompt(_("Over-write file?"), + return Alert::prompt(lyx::to_utf8(_("Over-write file?")), text, 0, 2, - _("&Over-write"), _("Over-write &all"), - _("&Cancel export")); + lyx::to_utf8(_("&Over-write")), lyx::to_utf8(_("Over-write &all")), + lyx::to_utf8(_("&Cancel export"))); } return 0; } @@ -129,8 +129,8 @@ CopyStatus copyFile(string const & format, Mover const & mover = movers(format); if (!mover.copy(sourceFile, destFile, latexFile)) - Alert::error(_("Couldn't copy file"), - bformat(_("Copying %1$s to %2$s failed."), + Alert::error(lyx::to_utf8(_("Couldn't copy file")), + bformat(lyx::to_utf8(_("Copying %1$s to %2$s failed.")), makeDisplayPath(sourceFile), makeDisplayPath(destFile))); @@ -168,8 +168,8 @@ bool Exporter::Export(Buffer * buffer, string const & format, } } if (backend_format.empty()) { - Alert::error(_("Couldn't export file"), - bformat(_("No information for exporting the format %1$s."), + Alert::error(lyx::to_utf8(_("Couldn't export file")), + bformat(lyx::to_utf8(_("No information for exporting the format %1$s.")), formats.prettyName(format))); return false; } @@ -202,8 +202,8 @@ bool Exporter::Export(Buffer * buffer, string const & format, buffer->makeLaTeXFile(filename, string(), runparams); } else if (!lyxrc.tex_allows_spaces && contains(buffer->filePath(), ' ')) { - Alert::error(_("File name error"), - _("The directory path to the document cannot contain spaces.")); + Alert::error(lyx::to_utf8(_("File name error")), + lyx::to_utf8(_("The directory path to the document cannot contain spaces."))); return false; } else { runparams.nice = false; @@ -238,19 +238,19 @@ bool Exporter::Export(Buffer * buffer, string const & format, it->exportName, status == FORCE); } if (status == CANCEL) { - buffer->message(_("Document export cancelled.")); + buffer->message(lyx::to_utf8(_("Document export cancelled."))); } else if (fs::exists(tmp_result_file)) { // Finally copy the main file status = copyFile(format, tmp_result_file, result_file, result_file, status == FORCE); - buffer->message(bformat(_("Document exported as %1$s " - "to file `%2$s'"), + buffer->message(bformat(lyx::to_utf8(_("Document exported as %1$s " + "to file `%2$s'")), formats.prettyName(format), makeDisplayPath(result_file))); } else { // This must be a dummy converter like fax (bug 1888) - buffer->message(bformat(_("Document exported as %1$s"), + buffer->message(bformat(lyx::to_utf8(_("Document exported as %1$s")), formats.prettyName(format))); } } diff --git a/src/format.C b/src/format.C index a8fd1f2828..f4e88d68ad 100644 --- a/src/format.C +++ b/src/format.C @@ -93,7 +93,7 @@ bool operator<(Format const & a, Format const & b) Format::Format(string const & n, string const & e, string const & p, string const & s, string const & v, string const & ed, - bool d) + bool d) : name_(n), extension_(e), prettyname_(p), shortcut_(s), viewer_(v), editor_(ed), document_(d) {} @@ -162,7 +162,7 @@ string Formats::getFormatFromFile(string const & filename) const namespace { -string fixCommand(string const & cmd, string const & ext, +string fixCommand(string const & cmd, string const & ext, os::auto_open_mode mode) { // configure.py says we do not want a viewer/editor @@ -223,10 +223,10 @@ void Formats::add(string const & name, string const & extension, if (it == formatlist.end()) formatlist.push_back(Format(name, extension, prettyname, shortcut, viewer, editor, - document)); + document)); else *it = Format(name, extension, prettyname, shortcut, viewer, - editor, document); + editor, document); } @@ -262,8 +262,8 @@ bool Formats::view(Buffer const & buffer, string const & filename, { BOOST_ASSERT(absolutePath(filename)); if (filename.empty() || !fs::exists(filename)) { - Alert::error(_("Cannot view file"), - bformat(_("File does not exist: %1$s"), + Alert::error(lyx::to_utf8(_("Cannot view file")), + bformat(lyx::to_utf8(_("File does not exist: %1$s")), filename)); return false; } @@ -275,8 +275,8 @@ bool Formats::view(Buffer const & buffer, string const & filename, if (!format || format->viewer().empty()) { // FIXME: I believe this is the wrong place to show alerts, it should be done // by the caller (this should be "utility" code) - Alert::error(_("Cannot view file"), - bformat(_("No information for viewing %1$s"), + Alert::error(lyx::to_utf8(_("Cannot view file")), + bformat(lyx::to_utf8(_("No information for viewing %1$s")), prettyName(format_name))); return false; } @@ -285,8 +285,8 @@ bool Formats::view(Buffer const & buffer, string const & filename, if (os::autoOpenFile(filename, os::VIEW)) return true; else { - Alert::error(_("Cannot view file"), - bformat(_("Auto-view file %1$s failed"), + Alert::error(lyx::to_utf8(_("Cannot view file")), + bformat(lyx::to_utf8(_("Auto-view file %1$s failed")), filename)); return false; } @@ -312,14 +312,14 @@ bool Formats::view(Buffer const & buffer, string const & filename, command = subst(command, token_path, quoteName(onlyPath(filename))); command = subst(command, token_socket, quoteName(lyxsocket->address())); lyxerr[Debug::FILES] << "Executing command: " << command << std::endl; - buffer.message(_("Executing command: ") + command); + buffer.message(lyx::to_utf8(_("Executing command: ")) + command); Systemcall one; int const res = one.startscript(Systemcall::DontWait, command); if (res) { - Alert::error(_("Cannot view file"), - bformat(_("An error occurred whilst running %1$s"), + Alert::error(lyx::to_utf8(_("Cannot view file")), + bformat(lyx::to_utf8(_("An error occurred whilst running %1$s")), makeDisplayPath(command, 50))); return false; } @@ -332,8 +332,8 @@ bool Formats::edit(Buffer const & buffer, string const & filename, { BOOST_ASSERT(absolutePath(filename)); if (filename.empty() || !fs::exists(filename)) { - Alert::error(_("Cannot edit file"), - bformat(_("File does not exist: %1$s"), + Alert::error(lyx::to_utf8(_("Cannot edit file")), + bformat(lyx::to_utf8(_("File does not exist: %1$s")), filename)); return false; } @@ -345,8 +345,8 @@ bool Formats::edit(Buffer const & buffer, string const & filename, if (!format || format->editor().empty()) { // FIXME: I believe this is the wrong place to show alerts, it should // be done by the caller (this should be "utility" code) - Alert::error(_("Cannot edit file"), - bformat(_("No information for editing %1$s"), + Alert::error(lyx::to_utf8(_("Cannot edit file")), + bformat(lyx::to_utf8(_("No information for editing %1$s")), prettyName(format_name))); return false; } @@ -355,8 +355,8 @@ bool Formats::edit(Buffer const & buffer, string const & filename, if (os::autoOpenFile(filename, os::EDIT)) return true; else { - Alert::error(_("Cannot edit file"), - bformat(_("Auto-edit file %1$s failed"), + Alert::error(lyx::to_utf8(_("Cannot edit file")), + bformat(lyx::to_utf8(_("Auto-edit file %1$s failed")), filename)); return false; } @@ -371,14 +371,14 @@ bool Formats::edit(Buffer const & buffer, string const & filename, command = subst(command, token_path, quoteName(onlyPath(filename))); command = subst(command, token_socket, quoteName(lyxsocket->address())); lyxerr[Debug::FILES] << "Executing command: " << command << std::endl; - buffer.message(_("Executing command: ") + command); + buffer.message(lyx::to_utf8(_("Executing command: ")) + command); Systemcall one; int const res = one.startscript(Systemcall::DontWait, command); if (res) { - Alert::error(_("Cannot edit file"), - bformat(_("An error occurred whilst running %1$s"), + Alert::error(lyx::to_utf8(_("Cannot edit file")), + bformat(lyx::to_utf8(_("An error occurred whilst running %1$s")), makeDisplayPath(command, 50))); return false; } diff --git a/src/frontends/LyXView.C b/src/frontends/LyXView.C index aba2a2658f..35ad7bce60 100644 --- a/src/frontends/LyXView.C +++ b/src/frontends/LyXView.C @@ -323,11 +323,11 @@ void LyXView::updateWindowTitle() maximize_title += ": " + makeDisplayPath(cur_title, 30); minimize_title = onlyFilename(cur_title); if (!buffer()->isClean()) { - maximize_title += _(" (changed)"); + maximize_title += lyx::to_utf8(_(" (changed)")); minimize_title += '*'; } if (buffer()->isReadonly()) - maximize_title += _(" (read only)"); + maximize_title += lyx::to_utf8(_(" (read only)")); } } diff --git a/src/frontends/Toolbars.C b/src/frontends/Toolbars.C index ac7c2017cd..7ca15c0afc 100644 --- a/src/frontends/Toolbars.C +++ b/src/frontends/Toolbars.C @@ -165,8 +165,8 @@ void layoutSelected(LyXView & lv, string const & name) LyXTextClass::const_iterator const end = tc.end(); for (; it != end; ++it) { string const & itname = (*it)->name(); - // Yes, the _() is correct - if (_(itname) == name) { + // Yes, the lyx::to_utf8(_()) is correct + if (lyx::to_utf8(_(itname)) == name) { FuncRequest const func(LFUN_LAYOUT, itname, FuncRequest::UI); lv.getLyXFunc().dispatch(func); diff --git a/src/frontends/WorkArea.C b/src/frontends/WorkArea.C index b2ada8e48a..c7fc36dfd7 100644 --- a/src/frontends/WorkArea.C +++ b/src/frontends/WorkArea.C @@ -273,7 +273,7 @@ void WorkArea::dispatch(FuncRequest const & cmd0) void WorkArea::resizeBufferView() { lyx_view_.busy(true); - lyx_view_.message(_("Formatting document...")); + lyx_view_.message(lyx::to_utf8(_("Formatting document..."))); buffer_view_->workAreaResize(width(), height()); lyx_view_.updateLayoutChoice(); redraw(); diff --git a/src/frontends/controllers/ControlAboutlyx.C b/src/frontends/controllers/ControlAboutlyx.C index d7deb90ec7..9d375777de 100644 --- a/src/frontends/controllers/ControlAboutlyx.C +++ b/src/frontends/controllers/ControlAboutlyx.C @@ -54,28 +54,28 @@ void ControlAboutlyx::getCredits(ostream & ss) const } if (!found) { - ss << _("ERROR: LyX wasn't able to read CREDITS file\n") - << _("Please install correctly to estimate the great\n") - << _("amount of work other people have done for the LyX project."); + ss << lyx::to_utf8(_("ERROR: LyX wasn't able to read CREDITS file\n")) + << lyx::to_utf8(_("Please install correctly to estimate the great\n")) + << lyx::to_utf8(_("amount of work other people have done for the LyX project.")); } } string const ControlAboutlyx::getCopyright() const { - return _("LyX is Copyright (C) 1995 by Matthias Ettrich,\n1995-2001 LyX Team"); + return lyx::to_utf8(_("LyX is Copyright (C) 1995 by Matthias Ettrich,\n1995-2001 LyX Team")); } string const ControlAboutlyx::getLicense() const { - return _("This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version."); + return lyx::to_utf8(_("This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.")); } string const ControlAboutlyx::getDisclaimer() const { - return _("LyX is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\nSee the GNU General Public License for more details.\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA."); + return lyx::to_utf8(_("LyX is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\nSee the GNU General Public License for more details.\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.")); } @@ -83,15 +83,15 @@ string const ControlAboutlyx::getVersion() const { ostringstream ss; - ss << _("LyX Version ") + ss << lyx::to_utf8(_("LyX Version ")) << lyx_version << " (" << lyx_release_date << ")\n" - << _("Library directory: ") + << lyx::to_utf8(_("Library directory: ")) << makeDisplayPath(package().system_support()) << "\n" - << _("User directory: ") + << lyx::to_utf8(_("User directory: ")) << makeDisplayPath(package().user_support()); return ss.str(); diff --git a/src/frontends/controllers/ControlBibtex.C b/src/frontends/controllers/ControlBibtex.C index 37ab488b0d..5e6c7afb2d 100644 --- a/src/frontends/controllers/ControlBibtex.C +++ b/src/frontends/controllers/ControlBibtex.C @@ -50,22 +50,24 @@ ControlBibtex::ControlBibtex(Dialog & d) string const ControlBibtex::browseBib(string const & in_name) const { - pair dir1(_("Documents|#o#O"), + // FIXME UNICODE + pair dir1(lyx::to_utf8(_("Documents|#o#O")), string(lyxrc.document_path)); - FileFilterList const filter(_("BibTeX Databases (*.bib)")); + FileFilterList const filter(lyx::to_utf8(_("BibTeX Databases (*.bib)"))); return browseRelFile(in_name, kernel().bufferFilepath(), - _("Select a BibTeX database to add"), + lyx::to_utf8(_("Select a BibTeX database to add")), filter, false, dir1); } string const ControlBibtex::browseBst(string const & in_name) const { - pair dir1(_("Documents|#o#O"), + // FIXME UNICODE + pair dir1(lyx::to_utf8(_("Documents|#o#O")), string(lyxrc.document_path)); - FileFilterList const filter(_("BibTeX Styles (*.bst)")); + FileFilterList const filter(lyx::to_utf8(_("BibTeX Styles (*.bst)"))); return browseRelFile(in_name, kernel().bufferFilepath(), - _("Select a BibTeX style"), filter, false, dir1); + lyx::to_utf8(_("Select a BibTeX style")), filter, false, dir1); } diff --git a/src/frontends/controllers/ControlBox.C b/src/frontends/controllers/ControlBox.C index c73b173eda..615bbf2b7b 100644 --- a/src/frontends/controllers/ControlBox.C +++ b/src/frontends/controllers/ControlBox.C @@ -59,12 +59,13 @@ void box_gui_tokens(vector & ids, vector & gui_names) size_t const ids_size = sizeof(ids_) / sizeof(char *); ids = vector(ids_, ids_ + ids_size); gui_names.clear(); - gui_names.push_back(_("No frame drawn")); - gui_names.push_back(_("Rectangular box")); - gui_names.push_back(_("Oval box, thin")); - gui_names.push_back(_("Oval box, thick")); - gui_names.push_back(_("Shadow box")); - gui_names.push_back(_("Double box")); + // FIXME UNICODE + gui_names.push_back(lyx::to_utf8(_("No frame drawn"))); + gui_names.push_back(lyx::to_utf8(_("Rectangular box"))); + gui_names.push_back(lyx::to_utf8(_("Oval box, thin"))); + gui_names.push_back(lyx::to_utf8(_("Oval box, thick"))); + gui_names.push_back(lyx::to_utf8(_("Shadow box"))); + gui_names.push_back(lyx::to_utf8(_("Double box"))); } void box_gui_tokens_special_length(vector & ids, @@ -76,11 +77,12 @@ void box_gui_tokens_special_length(vector & ids, size_t const ids_size = sizeof(ids_) / sizeof(char *); ids = vector(ids_, ids_ + ids_size); gui_names.clear(); - gui_names.push_back(_("None")); - gui_names.push_back(_("Height")); - gui_names.push_back(_("Depth")); - gui_names.push_back(_("Total Height")); - gui_names.push_back(_("Width")); + // FIXME UNICODE + gui_names.push_back(lyx::to_utf8(_("None"))); + gui_names.push_back(lyx::to_utf8(_("Height"))); + gui_names.push_back(lyx::to_utf8(_("Depth"))); + gui_names.push_back(lyx::to_utf8(_("Total Height"))); + gui_names.push_back(lyx::to_utf8(_("Width"))); } } // namespace frontend diff --git a/src/frontends/controllers/ControlErrorList.C b/src/frontends/controllers/ControlErrorList.C index 4ea92b835a..a76a310977 100644 --- a/src/frontends/controllers/ControlErrorList.C +++ b/src/frontends/controllers/ControlErrorList.C @@ -47,8 +47,10 @@ ErrorList const & ControlErrorList::errorList() const bool ControlErrorList::initialiseParams(string const & error_type) { Buffer * buf = kernel().bufferview()->buffer(); - string const title = bformat(_("%1$s Errors (%2$s)"), - _(error_type), buf->fileName()); + // FIXME UNICODE + string const title = bformat(lyx::to_utf8(_("%1$s Errors (%2$s)")), + lyx::to_utf8(_(error_type)), + buf->fileName()); errorlist_ = buf->errorList(error_type); name_ = title; return true; diff --git a/src/frontends/controllers/ControlExternal.C b/src/frontends/controllers/ControlExternal.C index 520a1f4e23..37f417493e 100644 --- a/src/frontends/controllers/ControlExternal.C +++ b/src/frontends/controllers/ControlExternal.C @@ -159,7 +159,7 @@ ControlExternal::getTemplateFilters(string const & template_name) const string const ControlExternal::browse(string const & input, string const & template_name) const { - string const title = _("Select external file"); + string const title = lyx::to_utf8(_("Select external file")); string const bufpath = kernel().bufferFilepath(); FileFilterList const filter = @@ -247,7 +247,7 @@ vector const & all_origins() string const origin_gui_str(size_type i) { - return _(origin_gui_strs[i]); + return lyx::to_utf8(_(origin_gui_strs[i])); } } // namespace external diff --git a/src/frontends/controllers/ControlGraphics.C b/src/frontends/controllers/ControlGraphics.C index af2ef55324..a9d9504101 100644 --- a/src/frontends/controllers/ControlGraphics.C +++ b/src/frontends/controllers/ControlGraphics.C @@ -83,15 +83,16 @@ void ControlGraphics::dispatchParams() string const ControlGraphics::browse(string const & in_name) const { - string const title = _("Select graphics file"); + // FIXME UNICODE + string const title = lyx::to_utf8(_("Select graphics file")); // Does user clipart directory exist? string clipdir = addName(package().user_support(), "clipart"); if (!(fs::exists(clipdir) && fs::is_directory(clipdir))) // No - bail out to system clipart directory clipdir = addName(package().system_support(), "clipart"); - pair dir1(_("Clipart|#C#c"), clipdir); - pair dir2(_("Documents|#o#O"), string(lyxrc.document_path)); + pair dir1(lyx::to_utf8(_("Clipart|#C#c")), clipdir); + pair dir2(lyx::to_utf8(_("Documents|#o#O")), string(lyxrc.document_path)); // Show the file browser dialog return browseRelFile(in_name, kernel().bufferFilepath(), title, @@ -190,7 +191,8 @@ vector getRotationOriginData() data.resize(rorigin_size); for (size_type i = 0; i < rorigin_size; ++i) { - data[i] = make_pair(_(rorigin_gui_strs[i]), + // FIXME UNICODE + data[i] = make_pair(lyx::to_utf8(_(rorigin_gui_strs[i])), rorigin_lyx_strs[i]); } diff --git a/src/frontends/controllers/ControlInclude.C b/src/frontends/controllers/ControlInclude.C index 7e497b9fd5..d0d7b4f8f9 100644 --- a/src/frontends/controllers/ControlInclude.C +++ b/src/frontends/controllers/ControlInclude.C @@ -74,17 +74,19 @@ void ControlInclude::setParams(InsetCommandParams const & params) string const ControlInclude::browse(string const & in_name, Type in_type) const { - string const title = _("Select document to include"); + // FIXME UNICODE + string const title = lyx::to_utf8(_("Select document to include")); // input TeX, verbatim, or LyX file ? FileFilterList filters; switch (in_type) { case INCLUDE: case INPUT: - filters = FileFilterList(_("LaTeX/LyX Documents (*.tex *.lyx)")); - break; + // FIXME UNICODE + filters = FileFilterList(lyx::to_utf8(_("LaTeX/LyX Documents (*.tex *.lyx)"))); + break; case VERBATIM: - break; + break; } pair dir1(N_("Documents|#o#O"), diff --git a/src/frontends/controllers/ControlLog.C b/src/frontends/controllers/ControlLog.C index 2dd73a2930..026319f215 100644 --- a/src/frontends/controllers/ControlLog.C +++ b/src/frontends/controllers/ControlLog.C @@ -75,16 +75,16 @@ string const ControlLog::title() const string t; switch (type_) { case LatexLog: - t = _("LaTeX Log"); + t = lyx::to_utf8(_("LaTeX Log")); break; case LiterateLog: - t = _("Literate Programming Build Log"); + t = lyx::to_utf8(_("Literate Programming Build Log")); break; case Lyx2lyxLog: - t = _("lyx2lyx Error Log"); + t = lyx::to_utf8(_("lyx2lyx Error Log")); break; case VCLog: - t = _("Version Control Log"); + t = lyx::to_utf8(_("Version Control Log")); break; } return t; @@ -107,16 +107,16 @@ void ControlLog::getContents(std::ostream & ss) const switch (type_) { case LatexLog: - ss << _("No LaTeX log file found."); + ss << lyx::to_utf8(_("No LaTeX log file found.")); break; case LiterateLog: - ss << _("No literate programming build log file found."); + ss << lyx::to_utf8(_("No literate programming build log file found.")); break; case Lyx2lyxLog: - ss << _("No lyx2lyx error log file found."); + ss << lyx::to_utf8(_("No lyx2lyx error log file found.")); break; case VCLog: - ss << _("No version control log file found."); + ss << lyx::to_utf8(_("No version control log file found.")); break; } } diff --git a/src/frontends/controllers/ControlPrefs.C b/src/frontends/controllers/ControlPrefs.C index 13f587935a..2ecdf043c4 100644 --- a/src/frontends/controllers/ControlPrefs.C +++ b/src/frontends/controllers/ControlPrefs.C @@ -109,29 +109,37 @@ void ControlPrefs::updateScreenFonts() string const ControlPrefs::browsebind(string const & file) const { - return browseLibFile("bind", file, "bind", _("Choose bind file"), - FileFilterList(_("LyX bind files (*.bind)"))); + // FIXME UNICODE + return browseLibFile("bind", file, "bind", + lyx::to_utf8(_("Choose bind file")), + FileFilterList(lyx::to_utf8(_("LyX bind files (*.bind)")))); } string const ControlPrefs::browseUI(string const & file) const { - return browseLibFile("ui", file, "ui", _("Choose UI file"), - FileFilterList(_("LyX UI files (*.ui)"))); + // FIXME UNICODE + return browseLibFile("ui", file, "ui", + lyx::to_utf8(_("Choose UI file")), + FileFilterList(lyx::to_utf8(_("LyX UI files (*.ui)")))); } string const ControlPrefs::browsekbmap(string const & file) const { - return browseLibFile("kbd", file, "kmap", _("Choose keyboard map"), - FileFilterList(_("LyX keyboard maps (*.kmap)"))); + // FIXME UNICODE + return browseLibFile("kbd", file, "kmap", + lyx::to_utf8(_("Choose keyboard map")), + FileFilterList(lyx::to_utf8(_("LyX keyboard maps (*.kmap)")))); } string const ControlPrefs::browsedict(string const & file) const { - return browseFile(file, _("Choose personal dictionary"), - FileFilterList(_("*.ispell"))); + // FIXME UNICODE + return browseFile(file, + lyx::to_utf8(_("Choose personal dictionary")), + FileFilterList(lyx::to_utf8(_("*.ispell")))); } diff --git a/src/frontends/controllers/ControlPrint.C b/src/frontends/controllers/ControlPrint.C index 2405bc16a5..3749bf0d2a 100644 --- a/src/frontends/controllers/ControlPrint.C +++ b/src/frontends/controllers/ControlPrint.C @@ -69,9 +69,10 @@ PrinterParams & ControlPrint::params() const string const ControlPrint::browse(string const & in_name) const { + // FIXME UNICODE return browseRelFile(in_name, kernel().buffer().filePath(), - _("Print to file"), - FileFilterList(_("PostScript files (*.ps)")), + lyx::to_utf8(_("Print to file")), + FileFilterList(lyx::to_utf8(_("PostScript files (*.ps)"))), true); } diff --git a/src/frontends/controllers/ControlSpellchecker.C b/src/frontends/controllers/ControlSpellchecker.C index 44d565c1ed..26a2cf4c91 100644 --- a/src/frontends/controllers/ControlSpellchecker.C +++ b/src/frontends/controllers/ControlSpellchecker.C @@ -108,8 +108,9 @@ bool ControlSpellchecker::initialiseParams(std::string const &) bool const success = speller_->error().empty(); if (!success) { - Alert::error(_("Spellchecker error"), - _("The spellchecker could not be started\n") + // FIXME UNICODE + Alert::error(lyx::to_utf8(_("Spellchecker error")), + lyx::to_utf8(_("The spellchecker could not be started\n")) + speller_->error()); speller_.reset(0); } @@ -264,16 +265,17 @@ bool ControlSpellchecker::checkAlive() return true; string message; + // FIXME UNICODE if (speller_->error().empty()) - message = _("The spellchecker has died for some reason.\n" - "Maybe it has been killed."); + message = lyx::to_utf8(_("The spellchecker has died for some reason.\n" + "Maybe it has been killed.")); else - message = _("The spellchecker has failed.\n") + message = lyx::to_utf8(_("The spellchecker has failed.\n")) + speller_->error(); dialog().CancelButton(); - Alert::error(_("The spellchecker has failed"), message); + Alert::error(lyx::to_utf8(_("The spellchecker has failed")), message); return false; } @@ -286,13 +288,14 @@ void ControlSpellchecker::showSummary() } string message; + // FIXME UNICODE if (count_ != 1) - message = bformat(_("%1$d words checked."), count_); + message = bformat(lyx::to_utf8(_("%1$d words checked.")), count_); else - message = _("One word checked."); + message = lyx::to_utf8(_("One word checked.")); dialog().CancelButton(); - Alert::information(_("Spelling check completed"), message); + Alert::information(lyx::to_utf8(_("Spelling check completed")), message); } diff --git a/src/frontends/controllers/ControlToc.C b/src/frontends/controllers/ControlToc.C index fae3cf7458..6b2a14937b 100644 --- a/src/frontends/controllers/ControlToc.C +++ b/src/frontends/controllers/ControlToc.C @@ -88,9 +88,9 @@ toc::TocIterator const ControlToc::getCurrentTocItem( string const ControlToc::getGuiName(string const & type) const { if (type == "TOC") - return _("Table of Contents"); + return lyx::to_utf8(_("Table of Contents")); else - return _(toc::getGuiName(type, kernel().buffer())); + return lyx::to_utf8(_(toc::getGuiName(type, kernel().buffer()))); } diff --git a/src/frontends/controllers/ControlViewSource.C b/src/frontends/controllers/ControlViewSource.C index c2b834c891..f1bfbd14ff 100644 --- a/src/frontends/controllers/ControlViewSource.C +++ b/src/frontends/controllers/ControlViewSource.C @@ -81,7 +81,7 @@ string const ControlViewSource::title() const default: BOOST_ASSERT(false); } - return _(source_type + " Source"); + return lyx::to_utf8(_(source_type + " Source")); } } // namespace frontend diff --git a/src/frontends/controllers/biblio.C b/src/frontends/controllers/biblio.C index 23aba00b22..813000a0c3 100644 --- a/src/frontends/controllers/biblio.C +++ b/src/frontends/controllers/biblio.C @@ -219,11 +219,13 @@ string const getAbbreviatedAuthor(InfoMap const & map, string const & key) return author; if (authors.size() == 2) - return bformat(_("%1$s and %2$s"), + // FIXME UNICODE + return bformat(lyx::to_utf8(_("%1$s and %2$s")), familyName(authors[0]), familyName(authors[1])); if (authors.size() > 2) - return bformat(_("%1$s et al."), familyName(authors[0])); + // FIXME UNICODE + return bformat(lyx::to_utf8(_("%1$s et al.")), familyName(authors[0])); return familyName(authors[0]); } @@ -260,7 +262,7 @@ string const getYear(InfoMap const & map, string const & key) string year = parseBibTeX(data, "year"); if (year.empty()) - year = _("No year"); + year = lyx::to_utf8(_("No year")); return year; } @@ -797,7 +799,7 @@ getAuthorYearStrings(string const & key, case CITE: // jurabib only: Author/Annotator // (i.e. the "before" field, 2nd opt arg) - str = author + "/<" + _("before") + '>'; + str = author + "/<" + lyx::to_utf8(_("before")) + '>'; break; case CITET: diff --git a/src/frontends/controllers/character.C b/src/frontends/controllers/character.C index d13387cf66..a39e435a10 100644 --- a/src/frontends/controllers/character.C +++ b/src/frontends/controllers/character.C @@ -26,23 +26,23 @@ vector const getFamilyData() FamilyPair pr; - pr.first = _("No change"); + pr.first = lyx::to_utf8(_("No change")); pr.second = LyXFont::IGNORE_FAMILY; family[0] = pr; - pr.first = _("Roman"); + pr.first = lyx::to_utf8(_("Roman")); pr.second = LyXFont::ROMAN_FAMILY; family[1] = pr; - pr.first = _("Sans Serif"); + pr.first = lyx::to_utf8(_("Sans Serif")); pr.second = LyXFont::SANS_FAMILY; family[2] = pr; - pr.first = _("Typewriter"); + pr.first = lyx::to_utf8(_("Typewriter")); pr.second = LyXFont::TYPEWRITER_FAMILY; family[3] = pr; - pr.first = _("Reset"); + pr.first = lyx::to_utf8(_("Reset")); pr.second = LyXFont::INHERIT_FAMILY; family[4] = pr; @@ -56,19 +56,19 @@ vector const getSeriesData() SeriesPair pr; - pr.first = _("No change"); + pr.first = lyx::to_utf8(_("No change")); pr.second = LyXFont::IGNORE_SERIES; series[0] = pr; - pr.first = _("Medium"); + pr.first = lyx::to_utf8(_("Medium")); pr.second = LyXFont::MEDIUM_SERIES; series[1] = pr; - pr.first = _("Bold"); + pr.first = lyx::to_utf8(_("Bold")); pr.second = LyXFont::BOLD_SERIES; series[2] = pr; - pr.first = _("Reset"); + pr.first = lyx::to_utf8(_("Reset")); pr.second = LyXFont::INHERIT_SERIES; series[3] = pr; @@ -82,27 +82,27 @@ vector const getShapeData() ShapePair pr; - pr.first = _("No change"); + pr.first = lyx::to_utf8(_("No change")); pr.second = LyXFont::IGNORE_SHAPE; shape[0] = pr; - pr.first = _("Upright"); + pr.first = lyx::to_utf8(_("Upright")); pr.second = LyXFont::UP_SHAPE; shape[1] = pr; - pr.first = _("Italic"); + pr.first = lyx::to_utf8(_("Italic")); pr.second = LyXFont::ITALIC_SHAPE; shape[2] = pr; - pr.first = _("Slanted"); + pr.first = lyx::to_utf8(_("Slanted")); pr.second = LyXFont::SLANTED_SHAPE; shape[3] = pr; - pr.first = _("Small Caps"); + pr.first = lyx::to_utf8(_("Small Caps")); pr.second = LyXFont::SMALLCAPS_SHAPE; shape[4] = pr; - pr.first = _("Reset"); + pr.first = lyx::to_utf8(_("Reset")); pr.second = LyXFont::INHERIT_SHAPE; shape[5] = pr; @@ -116,59 +116,59 @@ vector const getSizeData() SizePair pr; - pr.first = _("No change"); + pr.first = lyx::to_utf8(_("No change")); pr.second = LyXFont::IGNORE_SIZE; size[0] = pr; - pr.first = _("Tiny"); + pr.first = lyx::to_utf8(_("Tiny")); pr.second = LyXFont::SIZE_TINY; size[1] = pr; - pr.first = _("Smallest"); + pr.first = lyx::to_utf8(_("Smallest")); pr.second = LyXFont::SIZE_SCRIPT; size[2] = pr; - pr.first = _("Smaller"); + pr.first = lyx::to_utf8(_("Smaller")); pr.second = LyXFont::SIZE_FOOTNOTE; size[3] = pr; - pr.first = _("Small"); + pr.first = lyx::to_utf8(_("Small")); pr.second = LyXFont::SIZE_SMALL; size[4] = pr; - pr.first = _("Normal"); + pr.first = lyx::to_utf8(_("Normal")); pr.second = LyXFont::SIZE_NORMAL; size[5] = pr; - pr.first = _("Large"); + pr.first = lyx::to_utf8(_("Large")); pr.second = LyXFont::SIZE_LARGE; size[6] = pr; - pr.first = _("Larger"); + pr.first = lyx::to_utf8(_("Larger")); pr.second = LyXFont::SIZE_LARGER; size[7] = pr; - pr.first = _("Largest"); + pr.first = lyx::to_utf8(_("Largest")); pr.second = LyXFont::SIZE_LARGEST; size[8] = pr; - pr.first = _("Huge"); + pr.first = lyx::to_utf8(_("Huge")); pr.second = LyXFont::SIZE_HUGE; size[9] = pr; - pr.first = _("Huger"); + pr.first = lyx::to_utf8(_("Huger")); pr.second = LyXFont::SIZE_HUGER; size[10] = pr; - pr.first = _("Increase"); + pr.first = lyx::to_utf8(_("Increase")); pr.second = LyXFont::INCREASE_SIZE; size[11] = pr; - pr.first = _("Decrease"); + pr.first = lyx::to_utf8(_("Decrease")); pr.second = LyXFont::DECREASE_SIZE; size[12] = pr; - pr.first = _("Reset"); + pr.first = lyx::to_utf8(_("Reset")); pr.second = LyXFont::INHERIT_SIZE; size[13] = pr; @@ -182,23 +182,23 @@ vector const getBarData() BarPair pr; - pr.first = _("No change"); + pr.first = lyx::to_utf8(_("No change")); pr.second = IGNORE; bar[0] = pr; - pr.first = _("Emph"); + pr.first = lyx::to_utf8(_("Emph")); pr.second = EMPH_TOGGLE; bar[1] = pr; - pr.first = _("Underbar"); + pr.first = lyx::to_utf8(_("Underbar")); pr.second = UNDERBAR_TOGGLE; bar[2] = pr; - pr.first = _("Noun"); + pr.first = lyx::to_utf8(_("Noun")); pr.second = NOUN_TOGGLE; bar[3] = pr; - pr.first = _("Reset"); + pr.first = lyx::to_utf8(_("Reset")); pr.second = INHERIT; bar[4] = pr; @@ -212,47 +212,47 @@ vector const getColorData() ColorPair pr; - pr.first = _("No change"); + pr.first = lyx::to_utf8(_("No change")); pr.second = LColor::ignore; color[0] = pr; - pr.first = _("No color"); + pr.first = lyx::to_utf8(_("No color")); pr.second = LColor::none; color[1] = pr; - pr.first = _("Black"); + pr.first = lyx::to_utf8(_("Black")); pr.second = LColor::black; color[2] = pr; - pr.first = _("White"); + pr.first = lyx::to_utf8(_("White")); pr.second = LColor::white; color[3] = pr; - pr.first = _("Red"); + pr.first = lyx::to_utf8(_("Red")); pr.second = LColor::red; color[4] = pr; - pr.first = _("Green"); + pr.first = lyx::to_utf8(_("Green")); pr.second = LColor::green; color[5] = pr; - pr.first = _("Blue"); + pr.first = lyx::to_utf8(_("Blue")); pr.second = LColor::blue; color[6] = pr; - pr.first = _("Cyan"); + pr.first = lyx::to_utf8(_("Cyan")); pr.second = LColor::cyan; color[7] = pr; - pr.first = _("Magenta"); + pr.first = lyx::to_utf8(_("Magenta")); pr.second = LColor::magenta; color[8] = pr; - pr.first = _("Yellow"); + pr.first = lyx::to_utf8(_("Yellow")); pr.second = LColor::yellow; color[9] = pr; - pr.first = _("Reset"); + pr.first = lyx::to_utf8(_("Reset")); pr.second = LColor::inherit; color[10] = pr; diff --git a/src/frontends/controllers/frnt_lang.C b/src/frontends/controllers/frnt_lang.C index 1c3bee9ad7..638bdf9338 100644 --- a/src/frontends/controllers/frnt_lang.C +++ b/src/frontends/controllers/frnt_lang.C @@ -49,16 +49,16 @@ vector const getLanguageData(bool character_dlg) vector langs(size); if (character_dlg) { - langs[0].first = _("No change"); + langs[0].first = lyx::to_utf8(_("No change")); langs[0].second = "ignore"; - langs[1].first = _("Reset"); + langs[1].first = lyx::to_utf8(_("Reset")); langs[1].second = "reset"; } vector::size_type i = character_dlg ? 2 : 0; for (Languages::const_iterator cit = languages.begin(); cit != languages.end(); ++cit) { - langs[i].first = _(cit->second.display()); + langs[i].first = lyx::to_utf8(_(cit->second.display())); langs[i].second = cit->second.lang(); ++i; } diff --git a/src/frontends/controllers/helper_funcs.C b/src/frontends/controllers/helper_funcs.C index 2aa81d893a..333d8e50ec 100644 --- a/src/frontends/controllers/helper_funcs.C +++ b/src/frontends/controllers/helper_funcs.C @@ -97,10 +97,11 @@ string const browseLibFile(string const & dir, string const & title, FileFilterList const & filters) { - pair const dir1(_("System files|#S#s"), + // FIXME UNICODE + pair const dir1(lyx::to_utf8(_("System files|#S#s")), addName(package().system_support(), dir)); - pair const dir2(_("User files|#U#u"), + pair const dir2(lyx::to_utf8(_("User files|#U#u")), addName(package().user_support(), dir)); string const result = browseFile(libFileSearch(dir, name, ext), title, diff --git a/src/frontends/controllers/tex_helpers.C b/src/frontends/controllers/tex_helpers.C index 2441403e73..7046a8e229 100644 --- a/src/frontends/controllers/tex_helpers.C +++ b/src/frontends/controllers/tex_helpers.C @@ -60,8 +60,9 @@ void rescanTexStyles() quoteName(command)); if (status == 0) return; - Alert::error(_("Could not update TeX information"), - bformat(_("The script `%s' failed."), command)); + // FIXME UNICODE + Alert::error(lyx::to_utf8(_("Could not update TeX information")), + bformat(lyx::to_utf8(_("The script `%s' failed.")), command)); } diff --git a/src/frontends/gtk/Dialogs.C b/src/frontends/gtk/Dialogs.C index 65abdfbf4d..1d06ab2221 100644 --- a/src/frontends/gtk/Dialogs.C +++ b/src/frontends/gtk/Dialogs.C @@ -261,14 +261,18 @@ Dialogs::DialogPtr Dialogs::build(string const & name) } else if (name == "index") { dialog->bc().view(new GBC(dialog->bc())); dialog->setController(new ControlCommand(*dialog, name)); + // FIXME UNICODE dialog->setView(new GText(*dialog, - _("Index Entry"), _("Keyword:|#K"))); + lyx::to_utf8(_("Index Entry")), + lyx::to_utf8(_("Keyword:|#K")))); dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy); } else if (name == "label") { dialog->bc().view(new GBC(dialog->bc())); dialog->setController(new ControlCommand(*dialog, name)); + // FIXME UNICODE dialog->setView(new GText(*dialog, - _("Label"), _("Label:|#L"))); + lyx::to_utf8(_("Label")), + lyx::to_utf8(_("Label:|#L")))); dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy); } else if (name == "log") { dialog->bc().view(new GBC(dialog->bc())); @@ -284,7 +288,7 @@ Dialogs::DialogPtr Dialogs::build(string const & name) } else if (name == "mathaccents") { // FormMathsBitmap * bitmap = -// createFormBitmap(*dialog, _("Maths Decorations & Accents"), +// createFormBitmap(*dialog, lyx::to_utf8(_("Maths Decorations & Accents")), // latex_deco, nr_latex_deco); // bitmap->addBitmap( // BitmapStore(12, 3, 4, deco1_width, deco1_height, deco1_bits, true)); @@ -298,7 +302,7 @@ Dialogs::DialogPtr Dialogs::build(string const & name) } else if (name == "matharrows") { // FormMathsBitmap * bitmap = -// createFormBitmap(*dialog, _("Arrows"), latex_arrow, nr_latex_arrow); +// createFormBitmap(*dialog, lyx::to_utf8(_("Arrows"), latex_arrow, nr_latex_arrow)); // bitmap->addBitmap( // BitmapStore(20, 5, 4, arrow_width, arrow_height, arrow_bits, true)); // bitmap->addBitmap( @@ -313,7 +317,7 @@ Dialogs::DialogPtr Dialogs::build(string const & name) } else if (name == "mathoperators") { // FormMathsBitmap * bitmap = -// createFormBitmap(*dialog, _("Binary Ops"), +// createFormBitmap(*dialog, lyx::to_utf8(_("Binary Ops")), // latex_bop, nr_latex_bop); // bitmap->addBitmap( // BitmapStore(31, 4, 8, bop_width, bop_height, bop_bits, true)); @@ -325,7 +329,7 @@ Dialogs::DialogPtr Dialogs::build(string const & name) } else if (name == "mathrelations") { // FormMathsBitmap * bitmap = -// createFormBitmap(*dialog, _("Binary Relations"), +// createFormBitmap(*dialog, lyx::to_utf8(_("Binary Relations")), // latex_brel, nr_latex_brel); // bitmap->addBitmap( // BitmapStore(35, 4, 9, brel_width, brel_height, brel_bits, true)); @@ -337,7 +341,7 @@ Dialogs::DialogPtr Dialogs::build(string const & name) } else if (name == "mathgreek") { // FormMathsBitmap * bitmap = -// createFormBitmap(*dialog, _("Greek"), +// createFormBitmap(*dialog, lyx::to_utf8(_("Greek")), // latex_greek, nr_latex_greek); // bitmap->addBitmap( // BitmapStore(11, 6, 2, Greek_width, Greek_height, Greek_bits, true)); @@ -351,7 +355,7 @@ Dialogs::DialogPtr Dialogs::build(string const & name) } else if (name == "mathmisc") { // FormMathsBitmap * bitmap = -// createFormBitmap(*dialog, _("Misc"), +// createFormBitmap(*dialog, lyx::to_utf8(_("Misc")), // latex_misc, nr_latex_misc); // bitmap->addBitmap( // BitmapStore(29, 5, 6, misc_width, misc_height, misc_bits, true)); @@ -369,7 +373,7 @@ Dialogs::DialogPtr Dialogs::build(string const & name) } else if (name == "mathdots") { // FormMathsBitmap * bitmap = -// createFormBitmap(*dialog, _("Dots"), +// createFormBitmap(*dialog, lyx::to_utf8(_("Dots")), // latex_dots, nr_latex_dots); // bitmap->addBitmap( // BitmapStore(4, 4, 1, dots_width, dots_height, dots_bits, true)); @@ -381,7 +385,7 @@ Dialogs::DialogPtr Dialogs::build(string const & name) } else if (name == "mathbigoperators") { // FormMathsBitmap * bitmap = -// createFormBitmap(*dialog, _("Big Operators"), +// createFormBitmap(*dialog, lyx::to_utf8(_("Big Operators")), // latex_varsz, nr_latex_varsz); // bitmap->addBitmap( // BitmapStore(14, 3, 5, varsz_width, varsz_height, varsz_bits, true)); @@ -393,7 +397,7 @@ Dialogs::DialogPtr Dialogs::build(string const & name) } else if (name == "mathamsmisc") { // FormMathsBitmap * bitmap = -// createFormBitmap(*dialog, _("AMS Misc"), +// createFormBitmap(*dialog, lyx::to_utf8(_("AMS Misc")), // latex_ams_misc, nr_latex_ams_misc); // bitmap->addBitmap( // BitmapStore(9, 5, 2, ams1_width, ams1_height, ams1_bits, true)); @@ -407,7 +411,7 @@ Dialogs::DialogPtr Dialogs::build(string const & name) } else if (name == "mathamsarrows") { // FormMathsBitmap * bitmap = -// createFormBitmap(*dialog, _("AMS Arrows"), +// createFormBitmap(*dialog, lyx::to_utf8(_("AMS Arrows")), // latex_ams_arrows, nr_latex_ams_arrows); // bitmap->addBitmap( // BitmapStore(32, 3, 11, ams2_width, ams2_height, ams2_bits, true)); @@ -421,7 +425,7 @@ Dialogs::DialogPtr Dialogs::build(string const & name) } else if (name == "mathamsrelations") { // FormMathsBitmap * bitmap = -// createFormBitmap(*dialog, _("AMS Relations"), +// createFormBitmap(*dialog, lyx::to_utf8(_("AMS Relations")), // latex_ams_rel, nr_latex_ams_rel); // bitmap->addBitmap( // BitmapStore(66, 6, 11, ams_rel_width, ams_rel_height, ams_rel_bits, true)); @@ -433,7 +437,7 @@ Dialogs::DialogPtr Dialogs::build(string const & name) } else if (name == "mathamsnegatedrelations") { // FormMathsBitmap * bitmap = -// createFormBitmap(*dialog, _("AMS Negated Rel"), +// createFormBitmap(*dialog, lyx::to_utf8(_("AMS Negated Rel")), // latex_ams_nrel, nr_latex_ams_nrel); // bitmap->addBitmap( // BitmapStore(51, 6, 9, ams_nrel_width, ams_nrel_height, ams_nrel_bits, true)); @@ -445,7 +449,7 @@ Dialogs::DialogPtr Dialogs::build(string const & name) } else if (name == "mathamsoperators") { // FormMathsBitmap * bitmap = -// createFormBitmap(*dialog, _("AMS Operators"), +// createFormBitmap(*dialog, lyx::to_utf8(_("AMS Operators")), // latex_ams_ops, nr_latex_ams_ops); // bitmap->addBitmap( // BitmapStore(23, 3, 8, ams_ops_width, ams_ops_height, ams_ops_bits, true)); diff --git a/src/frontends/gtk/GAboutlyx.C b/src/frontends/gtk/GAboutlyx.C index 96d98e5664..f942a1f51a 100644 --- a/src/frontends/gtk/GAboutlyx.C +++ b/src/frontends/gtk/GAboutlyx.C @@ -196,8 +196,9 @@ void GAboutlyx::doBuild() button->hide(); } + // FIXME UNICODE Gtk::Button &authorbutton = *Gtk::manage( - new Gtk::Button(_("C_redits"), true)); + new Gtk::Button(lyx::to_utf8(_("C_redits")), true)); authorbutton.set_image(*Gtk::manage( new Gtk::Image(Gtk::Stock::ABOUT, Gtk::ICON_SIZE_BUTTON))); dialog->get_action_area()->pack_end(authorbutton); diff --git a/src/frontends/gtk/GBC.h b/src/frontends/gtk/GBC.h index 14885b4448..9990830275 100644 --- a/src/frontends/gtk/GBC.h +++ b/src/frontends/gtk/GBC.h @@ -24,8 +24,8 @@ namespace frontend { class GBC : public GuiBC { public: GBC(ButtonController const & parent, - std::string const & cancel = _("Cancel"), - std::string const & close = _("Close")); + std::string const & cancel = lyx::to_utf8(_("Cancel")), + std::string const & close = lyx::to_utf8(_("Close"))); private: /// Updates the button sensitivity (enabled/disabled) void setButtonEnabled(Gtk::Button *, bool enabled) const; diff --git a/src/frontends/gtk/GBibItem.C b/src/frontends/gtk/GBibItem.C index 1cbc2b4eb9..2ac096ee63 100644 --- a/src/frontends/gtk/GBibItem.C +++ b/src/frontends/gtk/GBibItem.C @@ -29,8 +29,9 @@ using std::string; namespace lyx { namespace frontend { +// FIXME UNICODE GBibItem::GBibItem(Dialog & parent) - : GViewCB(parent, _("Bibliography Entry Settings"), false) + : GViewCB(parent, lyx::to_utf8(_("Bibliography Entry Settings")), false) {} @@ -69,8 +70,8 @@ void GBibItem::update() void GBibItem::apply() { - controller().params().setContents(keyentry_->get_text()); - controller().params().setOptions(labelentry_->get_text()); + controller().params().setContents(keyentry_->get_text()); + controller().params().setOptions(labelentry_->get_text()); } void GBibItem::changed() diff --git a/src/frontends/gtk/GBibtex.C b/src/frontends/gtk/GBibtex.C index d1a3398651..72cc9b9de2 100644 --- a/src/frontends/gtk/GBibtex.C +++ b/src/frontends/gtk/GBibtex.C @@ -37,8 +37,9 @@ using std::string; namespace lyx { namespace frontend { +// FIXME UNICODE GBibtex::GBibtex(Dialog & parent) - : GViewCB(parent, _("BibTeX Bibliography"), false) + : GViewCB(parent, lyx::to_utf8(_("BibTeX Bibliography")), false) {} diff --git a/src/frontends/gtk/GBox.C b/src/frontends/gtk/GBox.C index 4bc5e162d1..b485b4127b 100644 --- a/src/frontends/gtk/GBox.C +++ b/src/frontends/gtk/GBox.C @@ -38,8 +38,9 @@ namespace { string defaultUnit("cm"); } // namespace anon +// FIXME UNICODE GBox::GBox(Dialog & parent) - : GViewCB(parent, _("Box Settings"), false) + : GViewCB(parent, lyx::to_utf8(_("Box Settings")), false) {} @@ -172,7 +173,7 @@ void GBox::update() widthspin_->get_adjustment()->set_value(controller().params().width.value()); unitsComboFromLength(widthunitscombo_, stringcol_, - controller().params().width, defaultUnit); + controller().params().width, defaultUnit); string const special(controller().params().special); if (!special.empty() && special != "none") { @@ -190,7 +191,7 @@ void GBox::update() heightspin_->get_adjustment()->set_value(controller().params().height.value()); unitsComboFromLength(heightunitscombo_, stringcol_, - controller().params().height, defaultUnit); + controller().params().height, defaultUnit); string const height_special(controller().params().height_special); if (!height_special.empty() && height_special != "none") { @@ -276,8 +277,8 @@ void GBox::updateInnerBoxCombo() if (frameless && oldsize != 2) { innerboxstore_->clear(); - (*innerboxstore_->append())[stringcol_] = _("Parbox"); - (*innerboxstore_->append())[stringcol_] = _("Minipage"); + (*innerboxstore_->append())[stringcol_] = lyx::to_utf8(_("Parbox")); + (*innerboxstore_->append())[stringcol_] = lyx::to_utf8(_("Minipage")); // Cope when the backend asks for no inner box in // a frameless box if (i == 0) { @@ -288,9 +289,9 @@ void GBox::updateInnerBoxCombo() innerboxcombo_->set_active(i - 1); } else if (!frameless && oldsize != 3) { innerboxstore_->clear(); - (*innerboxstore_->append())[stringcol_] = _("None"); - (*innerboxstore_->append())[stringcol_] = _("Parbox"); - (*innerboxstore_->append())[stringcol_] = _("Minipage"); + (*innerboxstore_->append())[stringcol_] = lyx::to_utf8(_("None")); + (*innerboxstore_->append())[stringcol_] = lyx::to_utf8(_("Parbox")); + (*innerboxstore_->append())[stringcol_] = lyx::to_utf8(_("Minipage")); innerboxcombo_->set_active(i); } else { // we're not changing the liststore, just selecting i @@ -314,9 +315,9 @@ void GBox::onInnerBoxComboChanged() return; controller().params().use_parbox = - (*innerboxcombo_->get_active())[stringcol_] == _("Parbox"); + (*innerboxcombo_->get_active())[stringcol_] == lyx::to_utf8(_("Parbox")); - bool const ibox = (*innerboxcombo_->get_active())[stringcol_] != _("None"); + bool const ibox = (*innerboxcombo_->get_active())[stringcol_] != lyx::to_utf8(_("None")); controller().params().inner_box = ibox; setSpecial(ibox); diff --git a/src/frontends/gtk/GBranch.C b/src/frontends/gtk/GBranch.C index 18cf62fbbd..aeec17b9d5 100644 --- a/src/frontends/gtk/GBranch.C +++ b/src/frontends/gtk/GBranch.C @@ -33,9 +33,9 @@ using std::string; namespace lyx { namespace frontend { - +// FIXME UNICODE GBranch::GBranch(Dialog & parent) - : GViewCB(parent, _("Branch Settings"), false) + : GViewCB(parent, lyx::to_utf8(_("Branch Settings")), false) {} diff --git a/src/frontends/gtk/GChanges.C b/src/frontends/gtk/GChanges.C index 771ac148e0..728a6a4514 100644 --- a/src/frontends/gtk/GChanges.C +++ b/src/frontends/gtk/GChanges.C @@ -28,9 +28,9 @@ using std::string; namespace lyx { namespace frontend { - +// FIXME UNICODE GChanges::GChanges(Dialog & parent) - : GViewCB(parent, _("Merge Changes"), false) + : GViewCB(parent, lyx::to_utf8(_("Merge Changes")), false) {} @@ -102,17 +102,17 @@ void GChanges::onNext() void GChanges::promptChange() { - string const header = _("Accept highlighted change?"); + string const header = lyx::to_utf8(_("Accept highlighted change?")); string author = controller().getChangeAuthor(); string date = controller().getChangeDate(); if(author.empty()) - author = _("unknown author"); + author = lyx::to_utf8(_("unknown author")); if(date.empty()) - date = _("unknown date"); + date = lyx::to_utf8(_("unknown date")); messagelabel_->set_markup("" + header + - "\n\nChanged by " + author - + " on " + date + ""); + "\n\nChanged by " + author + + " on " + date + ""); acceptbutton_->set_sensitive(true && !readOnly()); rejectbutton_->set_sensitive(true && !readOnly()); @@ -122,10 +122,10 @@ void GChanges::promptChange() void GChanges::promptDismiss() { - string const header = _("Done merging changes"); + string const header = lyx::to_utf8(_("Done merging changes")); messagelabel_->set_markup("" + header + - ""); + ""); // Disable all buttons but close. acceptbutton_->set_sensitive(false); diff --git a/src/frontends/gtk/GCharacter.C b/src/frontends/gtk/GCharacter.C index c3caa93a71..bb88a695cc 100644 --- a/src/frontends/gtk/GCharacter.C +++ b/src/frontends/gtk/GCharacter.C @@ -35,9 +35,9 @@ using std::string; namespace lyx { namespace frontend { - +// FIXME UNICODE GCharacter::GCharacter(Dialog & parent) - : GViewCB(parent, _("Text Style"), false) + : GViewCB(parent, lyx::to_utf8(_("Text Style")), false) {} diff --git a/src/frontends/gtk/GCitation.C b/src/frontends/gtk/GCitation.C index e49b33beb5..a9f50033be 100644 --- a/src/frontends/gtk/GCitation.C +++ b/src/frontends/gtk/GCitation.C @@ -67,8 +67,9 @@ bool GCitation::bib_visible(const Gtk::TreeModel::const_iterator& iter) styleModelColumns styleColumns; +// FIXME UNICODE GCitation::GCitation(Dialog & parent) - : GViewCB(parent, _("Citation"), false) + : GViewCB(parent, lyx::to_utf8(_("Citation")), false) {} @@ -117,13 +118,15 @@ void GCitation::doBuild() Gtk::TreeModel::Path rootpath; //required for gtkmm < 2.6 - citekeysview_->append_column(_("CiteKeys"), bibColumns.name); + // FIXME UNICODE + citekeysview_->append_column(lyx::to_utf8(_("CiteKeys")), bibColumns.name); citeFilter_ = Gtk::TreeModelFilter::create(allListStore_, rootpath); citeFilter_->set_visible_column(bibColumns.cite); citekeysview_->set_model(citeFilter_); citeselection_ = citekeysview_->get_selection(); - bibkeysview_->append_column(_("BibKeys"), bibColumns.name); + // FIXME UNICODE + bibkeysview_->append_column(lyx::to_utf8(_("BibKeys")), bibColumns.name); bibSort_ = Gtk::TreeModelSort::create(allListStore_); bibSort_->set_sort_column(bibColumns.bib_order, Gtk::SORT_ASCENDING ); bibFilter_ = Gtk::TreeModelFilter::create(bibSort_, rootpath); @@ -154,7 +157,7 @@ void GCitation::doBuild() sigc::mem_fun(*this, &GCitation::bibkeysview_activated)); bibselection_->signal_changed().connect( sigc::mem_fun(*this, &GCitation::bib_selected)); - + citeselection_->signal_changed().connect( sigc::mem_fun(*this, &GCitation::cite_selected)); @@ -208,8 +211,8 @@ void GCitation::fill_styles() styleStore_->clear(); for (; it != end; ++it) { - Gtk::TreeModel::iterator iter2 = styleStore_->append(); - (*iter2)[styleColumns.name] = Glib::locale_to_utf8(*it); + Gtk::TreeModel::iterator iter2 = styleStore_->append(); + (*iter2)[styleColumns.name] = Glib::locale_to_utf8(*it); } if(orig) @@ -301,7 +304,7 @@ void GCitation::update_contents() } } if (!found) { - // It wasn't in the list of keys, but to support + // It wasn't in the list of keys, but to support // working on a document away from the bibtex file // we should keep it anyway. Gtk::TreeModel::iterator iter = allListStore_->append(); diff --git a/src/frontends/gtk/GDocument.C b/src/frontends/gtk/GDocument.C index 067364ecb5..3afbd20c2a 100644 --- a/src/frontends/gtk/GDocument.C +++ b/src/frontends/gtk/GDocument.C @@ -55,8 +55,9 @@ char const * const encodings[] = { "Language Default", "LaTeX default", } +// FIXME UNICODE GDocument::GDocument(Dialog & parent) - : GViewCB(parent, _("Document Settings"), false), + : GViewCB(parent, lyx::to_utf8(_("Document Settings")), false), lang_(getSecond(getLanguageData(false))) {} @@ -101,8 +102,9 @@ void GDocument::doBuild() if (cit->isTeXClassAvailable()) { classcombo_.append_text(cit->description()); } else { + // FIXME UNICODE string item = - bformat(_("Unavailable: %1$s"), cit->description()); + bformat(lyx::to_utf8(_("Unavailable: %1$s")), cit->description()); classcombo_.append_text(item); } } @@ -124,9 +126,10 @@ void GDocument::doBuild() // Populate sans font combo for (int i = 0; tex_fonts_sans_gui[i][0]; ++i) { - string font = _(tex_fonts_sans_gui[i]); + string font = lyx::to_utf8(_(tex_fonts_sans_gui[i])); if (!controller().isFontAvailable(tex_fonts_sans[i])) - font += _(" (not installed)"); + // FIXME UNICODE + font += lyx::to_utf8(_(" (not installed)")); fontsanscombo_.append_text(font); } @@ -136,9 +139,9 @@ void GDocument::doBuild() // Populate roman font combo for (int i = 0; tex_fonts_roman_gui[i][0]; ++i) { - string font = _(tex_fonts_roman_gui[i]); + string font = lyx::to_utf8(_(tex_fonts_roman_gui[i])); if (!controller().isFontAvailable(tex_fonts_roman[i])) - font += _(" (not installed)"); + font += lyx::to_utf8(_(" (not installed)")); fontsanscombo_.append_text(font); } @@ -148,9 +151,9 @@ void GDocument::doBuild() // Populate typewriter font combo for (int i = 0; tex_fonts_monospaced_gui[i][0]; ++i) { - string font = _(tex_fonts_monospaced_gui[i]); + string font = lyx::to_utf8(_(tex_fonts_monospaced_gui[i])); if (!controller().isFontAvailable(tex_fonts_monospaced[i])) - font += _(" (not installed)"); + font += lyx::to_utf8(_(" (not installed)")); fontsanscombo_.append_text(font); } @@ -160,7 +163,7 @@ void GDocument::doBuild() // Populate font default family combo for (int i = 0; ControlDocument::fontfamilies_gui[i][0]; ++i) - fontdefaultfamilycombo_.append_text(_(ControlDocument::fontfamilies_gui[i])); + fontdefaultfamilycombo_.append_text(lyx::to_utf8(_(ControlDocument::fontfamilies_gui[i]))); xml_->get_widget("FontSize", box); box->pack_start(fontsizecombo_, true, true, 0); @@ -192,10 +195,10 @@ void GDocument::doBuild() box->pack_start(vspacesizecombo_, true, true, 0); box->show_all(); // The order of these items is magic - vspacesizecombo_.append_text(_("Small Skip")); - vspacesizecombo_.append_text(_("Medium Skip")); - vspacesizecombo_.append_text(_("Big Skip")); - vspacesizecombo_.append_text(_("Custom")); + vspacesizecombo_.append_text(lyx::to_utf8(_("Small Skip"))); + vspacesizecombo_.append_text(lyx::to_utf8(_("Medium Skip"))); + vspacesizecombo_.append_text(lyx::to_utf8(_("Big Skip"))); + vspacesizecombo_.append_text(lyx::to_utf8(_("Custom"))); vspacesizemap_[0] = VSpace::SMALLSKIP; vspacesizemap_[1] = VSpace::MEDSKIP; vspacesizemap_[2] = VSpace::BIGSKIP; @@ -215,17 +218,17 @@ void GDocument::doBuild() xml_->get_widget("PageSize", box); box->pack_start(pagesizecombo_, true, true, 0); box->show_all(); - pagesizecombo_.append_text(_("Default")); - pagesizecombo_.append_text(_("Custom")); - pagesizecombo_.append_text(_("US letter")); - pagesizecombo_.append_text(_("US legal")); - pagesizecombo_.append_text(_("US executive")); - pagesizecombo_.append_text(_("A3")); - pagesizecombo_.append_text(_("A4")); - pagesizecombo_.append_text(_("A5")); - pagesizecombo_.append_text(_("B3")); - pagesizecombo_.append_text(_("B4")); - pagesizecombo_.append_text(_("B5")); + pagesizecombo_.append_text(lyx::to_utf8(_("Default"))); + pagesizecombo_.append_text(lyx::to_utf8(_("Custom"))); + pagesizecombo_.append_text(lyx::to_utf8(_("US letter"))); + pagesizecombo_.append_text(lyx::to_utf8(_("US legal"))); + pagesizecombo_.append_text(lyx::to_utf8(_("US executive"))); + pagesizecombo_.append_text(lyx::to_utf8(_("A3"))); + pagesizecombo_.append_text(lyx::to_utf8(_("A4"))); + pagesizecombo_.append_text(lyx::to_utf8(_("A5"))); + pagesizecombo_.append_text(lyx::to_utf8(_("B3"))); + pagesizecombo_.append_text(lyx::to_utf8(_("B4"))); + pagesizecombo_.append_text(lyx::to_utf8(_("B5"))); pagesizecombo_.signal_changed().connect( sigc::mem_fun(*this, &GDocument::pageSizeChanged)); @@ -348,9 +351,9 @@ void GDocument::doBuild() branchliststore_ = Gtk::ListStore::create(branchCols_); branchesview_->set_model(branchliststore_); - branchesview_->append_column_editable(_("Name"), branchColName_); - branchesview_->append_column_editable(_("Activated"), branchColActivated_); - branchesview_->append_column_editable(_("Color"), branchColColor_); + branchesview_->append_column_editable(lyx::to_utf8(_("Name")), branchColName_); + branchesview_->append_column_editable(lyx::to_utf8(_("Activated")), branchColActivated_); + branchesview_->append_column_editable(lyx::to_utf8(_("Color")), branchColColor_); branchsel_ = branchesview_->get_selection(); branchsel_->signal_changed().connect( @@ -402,17 +405,17 @@ void GDocument::update() // Font & Size int i = findToken(tex_fonts_sans, params.fontsSans); if (i >= 0) - fontsanscombo_.set_active_text(_(tex_fonts_sans_gui[i])); + fontsanscombo_.set_active_text(lyx::to_utf8(_(tex_fonts_sans_gui[i]))); i = findToken(tex_fonts_sans, params.fontsRoman); if (i >= 0) - fontromancombo_.set_active_text(_(tex_fonts_roman_gui[i])); + fontromancombo_.set_active_text(lyx::to_utf8(_(tex_fonts_roman_gui[i]))); i = findToken(tex_fonts_monospaced, params.fontsTypewriter); if (i >= 0) fonttypewritercombo_.set_active_text(tex_fonts_monospaced_gui[i]); i = findToken(ControlDocument::fontfamilies, params.fontsDefaultFamily); if (i >= 0) fontdefaultfamilycombo_.set_active_text( - _(ControlDocument::fontfamilies_gui[i])); + lyx::to_utf8(_(ControlDocument::fontfamilies_gui[i]))); fontsizecombo_.set_active_text (params.fontsize); scaleSansSB_->set_value(params.fontsSansScale); scaleTypewriterSB_->set_value(params.fontsTypewriterScale); @@ -904,7 +907,7 @@ void GDocument::marginsChanged() void GDocument::numberingChanged() { - string const numberinglabels[] = { + docstring const numberinglabels[] = { _("No headings numbered"), _("Only parts numbered"), _("Chapters and above numbered"), @@ -916,13 +919,14 @@ void GDocument::numberingChanged() }; int const value = (int)(numberingadj_->get_value()); - numberinglabel_->set_label("" + numberinglabels[value] + ""); + // FIXME UNICODE + numberinglabel_->set_label("" + lyx::to_utf8(numberinglabels[value]) + ""); } void GDocument::TOCChanged() { - string const TOClabels[] = { + docstring const TOClabels[] = { _("Only Parts appear in TOC"), _("Chapters and above appear in TOC"), _("Sections and above appear in TOC"), @@ -933,7 +937,8 @@ void GDocument::TOCChanged() }; int const value = (int)(TOCadj_->get_value()); - TOClabel_->set_label("" + TOClabels[value] + ""); + // FIXME UNICODE + TOClabel_->set_label("" + lyx::to_utf8(TOClabels[value]) + ""); } diff --git a/src/frontends/gtk/GERT.C b/src/frontends/gtk/GERT.C index ef0b5c4023..438217e743 100644 --- a/src/frontends/gtk/GERT.C +++ b/src/frontends/gtk/GERT.C @@ -30,7 +30,7 @@ namespace lyx { namespace frontend { GERT::GERT(Dialog & parent) - : GViewCB(parent, _("TeX Settings"), false) + : GViewCB(parent, lyx::to_utf8(_("TeX Settings")), false) {} diff --git a/src/frontends/gtk/GErrorList.C b/src/frontends/gtk/GErrorList.C index 83fdfbbffe..8a0970b26b 100644 --- a/src/frontends/gtk/GErrorList.C +++ b/src/frontends/gtk/GErrorList.C @@ -29,7 +29,7 @@ namespace lyx { namespace frontend { GErrorList::GErrorList(Dialog & parent) - : GViewCB(parent, _("Errors"), false) + : GViewCB(parent, lyx::to_utf8(_("Errors")), false) {} @@ -79,7 +79,7 @@ void GErrorList::updateContents() errliststore_->clear(); ErrorList const & errors = controller().errorList(); if (errors.empty()) { - (*errliststore_->append())[listCol_] = _("*** No Errors ***"); + (*errliststore_->append())[listCol_] = lyx::to_utf8(_("*** No Errors ***")); errlistview_->set_sensitive(false); return; } diff --git a/src/frontends/gtk/GExternal.C b/src/frontends/gtk/GExternal.C index a6a0704c32..70c967cc78 100644 --- a/src/frontends/gtk/GExternal.C +++ b/src/frontends/gtk/GExternal.C @@ -114,27 +114,27 @@ std::vector get_filters(const std::string & filterstring, con std::string description = ff.description(); if (description.empty()) - filters[i]->set_name(Glib::locale_to_utf8(alttitle) + - " " + _("files")); - else + filters[i]->set_name(Glib::locale_to_utf8(alttitle) + + " " + lyx::to_utf8(_("files"))); + else filters[i]->set_name(Glib::locale_to_utf8(description)); for (FileFilterList::Filter::glob_iterator git = ff.begin(); - git!=ff.end(); ++git) + git!=ff.end(); ++git) filters[i]->add_pattern(Glib::locale_to_utf8(*git)); } return filters; } -void set_display(Gtk::CheckButton * show_check, Gtk::ComboBox * display_combo, +void set_display(Gtk::CheckButton * show_check, Gtk::ComboBox * display_combo, Gtk::Label * display_label, GtkLengthEntry * scale_length, Gtk::Label * scale_label, external::DisplayType display, unsigned int scale) { typedef Gtk::TreeModel::const_iterator gcit; - Glib::RefPtr const display_store = + Glib::RefPtr const display_store = display_combo->get_model(); bool const no_display = display == external::NoDisplay; @@ -142,7 +142,7 @@ void set_display(Gtk::CheckButton * show_check, Gtk::ComboBox * display_combo, display_combo->set_active( *(display_store->children().begin())); //Default else - for (gcit it = display_store->children().begin(); + for (gcit it = display_store->children().begin(); it != display_store->children().end(); ++it) { if ((*it)[displayColumns().type] == display) { display_combo->set_active(*it); @@ -182,7 +182,7 @@ void set_rotation(Gtk::Entry * angle_entry, Gtk::ComboBox * origin_combo, void get_rotation(external::RotationData & data, - Gtk::Entry const * angle_entry, + Gtk::Entry const * angle_entry, Gtk::ComboBox const * origin_combo) { typedef external::RotationData::OriginType OriginType; @@ -209,13 +209,13 @@ void set_size(GtkLengthEntry * width_length, if (using_scale) { width_length->get_spin()->set_value(scale); width_length->get_combo()->set_active_text( - Glib::locale_to_utf8(_("Scale%"))); + lyx::to_utf8(_("Scale%"))); } else { width_length->set_length(data.width); } height_length->set_length(data.height); - if (!data.width.zero()) + if (!data.width.zero()) height_length->get_combo()->set_active(data.width.unit()); height_length->set_sensitive(!using_scale); @@ -233,8 +233,8 @@ void get_size(external::ResizeData & data, GtkLengthEntry * height_length, Gtk::CheckButton * ar_check) { - if (width_length->get_combo()->get_active_text() != - Glib::locale_to_utf8(_("Scale%"))) { + if (width_length->get_combo()->get_active_text() != + lyx::to_utf8(_("Scale%"))) { data.width = width_length->get_length(); data.scale = string(); @@ -289,7 +289,7 @@ void get_extra(external::ExtraData & data, Gtk::TreeModel::iterator it = format_store->children().begin(); Gtk::TreeModel::iterator end = format_store->children().end(); for (; it != end; ++it) - data.set(Glib::locale_from_utf8((*it)[formatColumns.name]), + data.set(Glib::locale_from_utf8((*it)[formatColumns.name]), trim(Glib::locale_from_utf8((*it)[formatColumns.extra]))); } @@ -297,7 +297,7 @@ void get_extra(external::ExtraData & data, GExternal::GExternal(Dialog & parent) - : GViewCB(parent, _("External Settings"), false) + : GViewCB(parent, lyx::to_utf8(_("External Settings")), false) {} @@ -327,9 +327,9 @@ void GExternal::doBuild() cit != templates.end(); ++cit, ++count) { external::Template templ = controller().getTemplate(count); - Gtk::TreeModel::iterator iter = templatestore_->append(); - (*iter)[templateColumns().name] = Glib::locale_to_utf8(*cit); - (*iter)[templateColumns().info] = + Gtk::TreeModel::iterator iter = templatestore_->append(); + (*iter)[templateColumns().name] = Glib::locale_to_utf8(*cit); + (*iter)[templateColumns().info] = Glib::locale_to_utf8(templ.helpText); (*iter)[templateColumns().filters] = get_filters( controller().getTemplateFilters(*cit),*cit); @@ -349,7 +349,7 @@ void GExternal::doBuild() // *** Start "File" Page *** xml_->get_widget("TemplateFile", templatefcbutton_); - templatefcbutton_->set_title(_("Select external file")); + templatefcbutton_->set_title(lyx::to_utf8(_("Select external file"))); templatefcbutton_->signal_file_activated().connect( sigc::mem_fun(*this, &GExternal::file_changed)); @@ -373,19 +373,19 @@ void GExternal::doBuild() // Fill the display combo Gtk::TreeModel::iterator iter = displaystore_->append(); - (*iter)[displayColumns().name] = Glib::locale_to_utf8(_("Default")); + (*iter)[displayColumns().name] = lyx::to_utf8(_("Default")); (*iter)[displayColumns().type] = external::DefaultDisplay; iter = displaystore_->append(); - (*iter)[displayColumns().name] = Glib::locale_to_utf8(_("Monochrome")); + (*iter)[displayColumns().name] = lyx::to_utf8(_("Monochrome")); (*iter)[displayColumns().type] = external::MonochromeDisplay; iter = displaystore_->append(); - (*iter)[displayColumns().name] = Glib::locale_to_utf8(_("Grayscale")); + (*iter)[displayColumns().name] = lyx::to_utf8(_("Grayscale")); (*iter)[displayColumns().type] = external::GrayscaleDisplay; iter = displaystore_->append(); - (*iter)[displayColumns().name] = Glib::locale_to_utf8(_("Color")); + (*iter)[displayColumns().name] = lyx::to_utf8(_("Color")); (*iter)[displayColumns().type] = external::ColorDisplay; iter = displaystore_->append(); - (*iter)[displayColumns().name] = Glib::locale_to_utf8(_("Preview")); + (*iter)[displayColumns().name] = lyx::to_utf8(_("Preview")); (*iter)[displayColumns().type] = external::PreviewDisplay; xml_->get_widget("Display", displaycombo_); @@ -399,8 +399,8 @@ void GExternal::doBuild() scalespin_->set_increments(1,10); scalecombo_ = scalelength_->get_combo(); scalecombo_->clear(); - scalecombo_->append_text(Glib::locale_to_utf8(_("Scale%"))); - scalecombo_->set_active_text(Glib::locale_to_utf8(_("Scale%"))); + scalecombo_->append_text(lyx::to_utf8(_("Scale%"))); + scalecombo_->set_active_text(lyx::to_utf8(_("Scale%"))); xml_->get_widget("ScaleLabel", scalelabel_); scalelabel_->set_mnemonic_widget(*scalespin_); @@ -419,7 +419,7 @@ void GExternal::doBuild() Origins const & all_origins = external::all_origins(); for (Origins::size_type i = 0; i != all_origins.size(); ++i) origincombo_.append_text( - Glib::locale_to_utf8(external::origin_gui_str(i))); + external::origin_gui_str(i)); xml_->get_widget("OriginLabel", originlabel_); originlabel_->set_mnemonic_widget(origincombo_); @@ -428,8 +428,8 @@ void GExternal::doBuild() // *** Start "Scale" Page *** xml_->get_widget_derived ("Width", widthlength_); widthcombo_ = widthlength_->get_combo(); - widthcombo_->prepend_text(Glib::locale_to_utf8(_("Scale%"))); - widthcombo_->set_active_text(Glib::locale_to_utf8(_("Scale%"))); + widthcombo_->prepend_text(lyx::to_utf8(_("Scale%"))); + widthcombo_->set_active_text(lyx::to_utf8(_("Scale%"))); xml_->get_widget("WidthLabel", widthlabel_); widthlabel_->set_mnemonic_widget(*(widthlength_->get_spin())); @@ -440,7 +440,7 @@ void GExternal::doBuild() sigc::mem_fun(*this, &GExternal::size_changed)); heightlength_->signal_changed().connect( sigc::mem_fun(*this, &GExternal::size_changed)); - + xml_->get_widget("HeightLabel", heightlabel_); heightlabel_->set_mnemonic_widget(*(heightlength_->get_spin())); @@ -485,8 +485,8 @@ void GExternal::doBuild() xml_->get_widget("Options", optionsview_); optionsview_->set_model(formatstore_); - optionsview_->append_column(_("Forma_t"), formatColumns.name); - optionsview_->append_column_editable(_("O_ption"), formatColumns.extra); + optionsview_->append_column(lyx::to_utf8(_("Forma_t")), formatColumns.name); + optionsview_->append_column_editable(lyx::to_utf8(_("O_ption")), formatColumns.extra); // *** End "Options" Page *** } @@ -505,7 +505,7 @@ void GExternal::update() } else { editfilebutton_->set_sensitive(false); - bbfromfilebutton_->set_sensitive(false); + bbfromfilebutton_->set_sensitive(false); } templatecombo_->set_active( @@ -547,7 +547,7 @@ void GExternal::update_template() templatefilters = (*currenttemplate_)[templateColumns().filters]; - for (ffit it = templatefilters.begin(); + for (ffit it = templatefilters.begin(); it != templatefilters.end(); ++it) templatefcbutton_->remove_filter(**it); } @@ -567,7 +567,7 @@ void GExternal::update_template() Gtk::Widget * widget = notebook_->get_nth_page(2); widget->set_sensitive(found); notebook_->get_tab_label(*widget)->set_sensitive(found); - + found = find(tr_begin, tr_end, external::Resize) != tr_end; widget = notebook_->get_nth_page(3); widget->set_sensitive(found); @@ -600,7 +600,7 @@ void GExternal::update_template() // Ascertain whether the template has any formats supporting // the 'Extra' option - Glib::ustring templatename = + Glib::ustring templatename = (*currenttemplate_)[templateColumns().name]; formatstore_->clear(); external::Template::Formats::const_iterator it = templ.formats.begin(); @@ -615,13 +615,13 @@ void GExternal::update_template() string const format = it->first; string const opt = controller().params().extradata.get(format); - Gtk::TreeModel::iterator iter = formatstore_->append(); - (*iter)[formatColumns.name] = Glib::locale_to_utf8(format); - (*iter)[formatColumns.extra] = Glib::locale_to_utf8(opt); + Gtk::TreeModel::iterator iter = formatstore_->append(); + (*iter)[formatColumns.name] = Glib::locale_to_utf8(format); + (*iter)[formatColumns.extra] = Glib::locale_to_utf8(opt); } // widget is still the 'Options' tab - notebook_->get_tab_label(*widget)->set_sensitive(enabled); + notebook_->get_tab_label(*widget)->set_sensitive(enabled); } @@ -645,7 +645,7 @@ void GExternal::apply() angleentry_, &origincombo_); if (notebook_->get_nth_page(3)->is_sensitive()) - get_size(params.resizedata, + get_size(params.resizedata, widthlength_, heightlength_, archeck_); if (notebook_->get_nth_page(4)->is_sensitive()) @@ -689,8 +689,8 @@ void GExternal::get_bb() bool GExternal::activate_ar() const { - if (widthlength_->get_combo()->get_active_text() == - Glib::locale_to_utf8(_("Scale%"))) + if (widthlength_->get_combo()->get_active_text() == + lyx::to_utf8(_("Scale%"))) return false; if (widthlength_->get_spin()->get_value() < 0.05) @@ -720,8 +720,8 @@ void GExternal::size_changed() { archeck_->set_sensitive(activate_ar()); - bool useHeight = widthlength_->get_combo()->get_active_text() != - Glib::locale_to_utf8(_("Scale%")); + bool useHeight = widthlength_->get_combo()->get_active_text() != + lyx::to_utf8(_("Scale%")); heightlength_->set_sensitive(useHeight); } @@ -773,7 +773,7 @@ void GExternal::file_changed() } else { editfilebutton_->set_sensitive(false); - bbfromfilebutton_->set_sensitive(false); + bbfromfilebutton_->set_sensitive(false); } bc().valid(true); } diff --git a/src/frontends/gtk/GFloat.C b/src/frontends/gtk/GFloat.C index 816b86afe1..277a0afc1b 100644 --- a/src/frontends/gtk/GFloat.C +++ b/src/frontends/gtk/GFloat.C @@ -38,7 +38,7 @@ using support::contains; namespace frontend { GFloat::GFloat(Dialog & parent) - : GViewCB(parent, _("Float Settings"), false) + : GViewCB(parent, lyx::to_utf8(_("Float Settings")), false) {} diff --git a/src/frontends/gtk/GGraphics.C b/src/frontends/gtk/GGraphics.C index 14f53632b4..353df6fdbd 100644 --- a/src/frontends/gtk/GGraphics.C +++ b/src/frontends/gtk/GGraphics.C @@ -50,7 +50,7 @@ string defaultUnit("cm"); } // namespace anon GGraphics::GGraphics(Dialog & parent) - : GViewCB(parent, _("Graphics"), false) + : GViewCB(parent, lyx::to_utf8(_("Graphics")), false) {} @@ -437,7 +437,7 @@ void GGraphics::updateBB(string const & filename, string const & bb_inset) righttopyspin_->set_text(""); } unitsComboFromLength(bbunitscombo_, stringcol_, - LyXLength("bp"), defaultUnit); + LyXLength("bp"), defaultUnit); } else { // get the values from the inset lyxerr[Debug::GRAPHICS] @@ -501,7 +501,7 @@ void GGraphics::onBBFromFileClicked() righttopxspin_->set_text(token(bb, ' ', 2)); righttopyspin_->set_text(token(bb, ' ', 3)); unitsComboFromLength(bbunitscombo_, stringcol_, - LyXLength("bp"), defaultUnit); + LyXLength("bp"), defaultUnit); } controller().bbChanged = false; } else { @@ -510,7 +510,7 @@ void GGraphics::onBBFromFileClicked() righttopxspin_->set_text(""); righttopyspin_->set_text(""); unitsComboFromLength(bbunitscombo_, stringcol_, - LyXLength("bp"), defaultUnit); + LyXLength("bp"), defaultUnit); } bc().input(ButtonPolicy::SMI_VALID); } diff --git a/src/frontends/gtk/GInclude.C b/src/frontends/gtk/GInclude.C index 6420c4c3c3..e2616685c8 100644 --- a/src/frontends/gtk/GInclude.C +++ b/src/frontends/gtk/GInclude.C @@ -31,7 +31,7 @@ namespace lyx { namespace frontend { GInclude::GInclude(Dialog & parent) - : GViewCB(parent, _("Child Document"), false) + : GViewCB(parent, lyx::to_utf8(_("Child Document")), false) {} diff --git a/src/frontends/gtk/GLog.C b/src/frontends/gtk/GLog.C index dba2a814ee..57b8f7312c 100644 --- a/src/frontends/gtk/GLog.C +++ b/src/frontends/gtk/GLog.C @@ -31,7 +31,7 @@ namespace lyx { namespace frontend { GLog::GLog(Dialog & parent) - : GViewCB(parent, _("Log Viewer"), false) + : GViewCB(parent, lyx::to_utf8(_("Log Viewer")), false) {} @@ -67,7 +67,7 @@ void GLog::update() if (!contents.str().empty()) contentbuffer_->set_text(contents.str()); else - contentbuffer_->set_text(_("Error reading file!")); + contentbuffer_->set_text(lyx::to_utf8(_("Error reading file!"))); } } // namespace frontend diff --git a/src/frontends/gtk/GMathDelim.C b/src/frontends/gtk/GMathDelim.C index d94e4acf5a..c113c544a6 100644 --- a/src/frontends/gtk/GMathDelim.C +++ b/src/frontends/gtk/GMathDelim.C @@ -104,7 +104,7 @@ inline int indexToCol(int index) GMathDelim::GMathDelim(Dialog & parent) : - GViewCB(parent, _("Math Delimiters")), + GViewCB(parent, lyx::to_utf8(_("Math Delimiters"))), delimTbl_(delimTblRows, delimTblCols, xbm) { } diff --git a/src/frontends/gtk/GMathPanel.C b/src/frontends/gtk/GMathPanel.C index 2181511218..57226e681f 100644 --- a/src/frontends/gtk/GMathPanel.C +++ b/src/frontends/gtk/GMathPanel.C @@ -104,7 +104,7 @@ GXpmBtnTbl::XpmData xpmDown[] = GMathPanel::GMathPanel(Dialog & parent) - : GViewCB(parent, _("Math Panel")), + : GViewCB(parent, lyx::to_utf8(_("Math Panel"))), tableUp_(2, 5, xpmUp), tableDown_(4, 3, xpmDown) { } diff --git a/src/frontends/gtk/GMathsMatrix.C b/src/frontends/gtk/GMathsMatrix.C index 3cfd4649c1..00e7288063 100644 --- a/src/frontends/gtk/GMathsMatrix.C +++ b/src/frontends/gtk/GMathsMatrix.C @@ -35,7 +35,7 @@ namespace frontend { GMathsMatrix::GMathsMatrix(Dialog & parent) - : GViewCB(parent, _("Math Matrix"), false) + : GViewCB(parent, lyx::to_utf8(_("Math Matrix")), false) {} diff --git a/src/frontends/gtk/GNote.C b/src/frontends/gtk/GNote.C index 65a622154c..eb8735e9f3 100644 --- a/src/frontends/gtk/GNote.C +++ b/src/frontends/gtk/GNote.C @@ -32,7 +32,7 @@ namespace lyx { namespace frontend { GNote::GNote(Dialog & parent) - : GViewCB(parent, _("Note Settings"), false) + : GViewCB(parent, lyx::to_utf8(_("Note Settings")), false) {} diff --git a/src/frontends/gtk/GParagraph.C b/src/frontends/gtk/GParagraph.C index ecaf2d4073..7d8aa727fe 100644 --- a/src/frontends/gtk/GParagraph.C +++ b/src/frontends/gtk/GParagraph.C @@ -41,7 +41,7 @@ namespace { GParagraph::GParagraph(Dialog & parent) - : GViewCB(parent, _("Paragraph Settings"), false) + : GViewCB(parent, lyx::to_utf8(_("Paragraph Settings")), false) {} void GParagraph::doBuild() @@ -96,7 +96,7 @@ void GParagraph::update() string const labelwidth = controller().params().labelWidthString(); maxlabelwidthentry_->set_text(labelwidth); maxlabelwidthentry_->set_sensitive( - labelwidth != _("Senseless with this layout!")); + labelwidth != lyx::to_utf8(_("Senseless with this layout!"))); // alignment LyXAlignment const current_alignment = controller().params().align(); diff --git a/src/frontends/gtk/GPreferences.C b/src/frontends/gtk/GPreferences.C index 31d9635afd..928a4d5d23 100644 --- a/src/frontends/gtk/GPreferences.C +++ b/src/frontends/gtk/GPreferences.C @@ -35,7 +35,7 @@ namespace lyx { namespace frontend { GPreferences::GPreferences(Dialog & parent) - : GViewCB(parent, _("Preferences"), false) + : GViewCB(parent, lyx::to_utf8(_("Preferences")), false) {} @@ -69,13 +69,13 @@ void GPreferences::doBuild() dpiadj_ = spin->get_adjustment(); xml_->get_widget("Zoom", spin); zoomadj_ = spin->get_adjustment(); - + // *** Graphics *** xml_->get_widget("GraphicsColor", graphicscolorradio_); xml_->get_widget("GraphicsGrayscale", graphicsgrayscaleradio_); xml_->get_widget("GraphicsMonochrome", graphicsmonoradio_); xml_->get_widget("GraphicsDoNotDisplay", graphicsnoneradio_); - + xml_->get_widget("InstantPreviewOn", instprevonradio_); xml_->get_widget("InstantPreviewOff", instprevoffradio_); xml_->get_widget("InstantPreviewNoMath", instprevnomathradio_); @@ -84,7 +84,7 @@ void GPreferences::doBuild() xml_->get_widget("UseKeyboardMap", keyboardmapcheck_); xml_->get_widget("FirstKeyboardMap", keyboardmap1fcbutton_); xml_->get_widget("SecondKeyboardMap", keyboardmap2fcbutton_); - + Gtk::FileFilter kmapfilter; kmapfilter.set_name ("LyX keyboard maps"); kmapfilter.add_pattern ("*.kmap"); @@ -98,12 +98,12 @@ void GPreferences::doBuild() keyboardmap2fcbutton_->add_filter (kmapfilter); keyboardmap2fcbutton_->add_filter (allfilter); keyboardmap2fcbutton_->set_filter (kmapfilter); - + keyboardmapcheck_->signal_toggled().connect( sigc::mem_fun(*this, &GPreferences::keyboard_sensitivity)); - + // *** Language *** - + xml_->get_widget("DefaultLanguage", box); box->pack_start (defaultlanguagecombo_); defaultlanguagecombo_.show(); @@ -116,7 +116,7 @@ void GPreferences::doBuild() xml_->get_widget("RTLSupport", RTLsupportcheck_); xml_->get_widget("AutoBegin", autobegincheck_); xml_->get_widget("AutoEnd", autoendcheck_); - + // Store the lang identifiers for later vector const langs = getLanguageData(false); lang_ = getSecond(langs); @@ -140,7 +140,7 @@ void GPreferences::doBuild() Gtk::FileFilter ispellfilter; ispellfilter.set_name ("iSpell Dictionary Files"); ispellfilter.add_pattern ("*.ispell"); - + personaldictionaryfcbutton_->add_filter (ispellfilter); personaldictionaryfcbutton_->add_filter (allfilter); personaldictionaryfcbutton_->set_filter (ispellfilter); @@ -155,7 +155,7 @@ void GPreferences::doBuild() spellcheckercombo_.append_text (_("aspell (library)")); #endif #endif - + } @@ -208,7 +208,7 @@ void GPreferences::update() instprevoffradio_->set_active(); break; } - + // *** Keyboard *** keyboardmapcheck_->set_active (rc.use_kbmap); keyboardmap1fcbutton_->set_filename (rc.primary_kbmap); @@ -219,7 +219,7 @@ void GPreferences::update() // *** Language *** int const pos = int(findPos(lang_, rc.default_language)); defaultlanguagecombo_.set_active(pos); - + languagepackageentry_->set_text(rc.language_package); commandstartentry_->set_text(rc.language_command_begin); commandendentry_->set_text(rc.language_command_end); @@ -247,7 +247,7 @@ void GPreferences::update() spellcheckercombo_.set_active (3); #endif } - + // FIXME: remove isp_use_alt_lang alternativelanguageentry_->set_text(rc.isp_alt_lang); // FIXME: remove isp_use_esc_chars @@ -316,7 +316,7 @@ void GPreferences::apply() rc.primary_kbmap = keyboardmap1fcbutton_->get_filename(); rc.secondary_kbmap = keyboardmap2fcbutton_->get_filename(); } - + // *** Language *** rc.default_language = lang_[ defaultlanguagecombo_.get_active_row_number()]; diff --git a/src/frontends/gtk/GRef.C b/src/frontends/gtk/GRef.C index a354f1ed93..5efd8a5e95 100644 --- a/src/frontends/gtk/GRef.C +++ b/src/frontends/gtk/GRef.C @@ -62,7 +62,7 @@ bufferModelColumns bufferColumns; GRef::GRef(Dialog & parent) - : GViewCB(parent, _("Cross-reference"), false) + : GViewCB(parent, lyx::to_utf8(_("Cross-reference")), false) {} @@ -86,7 +86,7 @@ void GRef::doBuild() xml_->get_widget("Back", backbutton_); xml_->get_widget("Refresh", refreshbutton_); - refview_->append_column(_("Label"), refColumns.name); + refview_->append_column(lyx::to_utf8(_("Label")), refColumns.name); buffercombo_->signal_changed().connect( sigc::mem_fun(*this, &GRef::buffer_changed)); @@ -194,8 +194,8 @@ void GRef::update() vector::const_iterator it = buffers.begin(); vector::const_iterator const end = buffers.end(); for (; it != end; ++it) { - Gtk::TreeModel::iterator iter = bufferstore_->append(); - (*iter)[bufferColumns.name] = *it; + Gtk::TreeModel::iterator iter = bufferstore_->append(); + (*iter)[bufferColumns.name] = *it; } buffercombo_->set_active(controller().getBufferNum()); @@ -226,7 +226,7 @@ void GRef::update_labels() refview_->set_sensitive(true); } else { Gtk::TreeModel::iterator iter =refListStore_->append(); - (*iter)[refColumns.name] = _("No labels found."); + (*iter)[refColumns.name] = lyx::to_utf8(_("No labels found.")); refview_->set_sensitive(false); } refview_->set_model(refListStore_); diff --git a/src/frontends/gtk/GSearch.C b/src/frontends/gtk/GSearch.C index 0db25350f2..54a77c4554 100644 --- a/src/frontends/gtk/GSearch.C +++ b/src/frontends/gtk/GSearch.C @@ -33,7 +33,7 @@ typedef GViewCB base_class; GSearch::GSearch(Dialog & parent) - : base_class(parent, _("Find and Replace"), false) + : base_class(parent, lyx::to_utf8(_("Find and Replace")), false) {} @@ -81,31 +81,31 @@ void GSearch::update() void GSearch::onFindNext() { controller().find(findentry->get_text(), - casecheck->get_active(), - matchwordcheck->get_active(), - !backwardscheck->get_active()); + casecheck->get_active(), + matchwordcheck->get_active(), + !backwardscheck->get_active()); } void GSearch::onReplace() { controller().replace(findentry->get_text(), - replaceentry->get_text(), - casecheck->get_active(), - matchwordcheck->get_active(), - !backwardscheck->get_active(), - false); + replaceentry->get_text(), + casecheck->get_active(), + matchwordcheck->get_active(), + !backwardscheck->get_active(), + false); } void GSearch::onReplaceAll() { controller().replace(findentry->get_text(), - replaceentry->get_text(), - casecheck->get_active(), - matchwordcheck->get_active(), - !backwardscheck->get_active(), - true); + replaceentry->get_text(), + casecheck->get_active(), + matchwordcheck->get_active(), + !backwardscheck->get_active(), + true); } diff --git a/src/frontends/gtk/GSendto.C b/src/frontends/gtk/GSendto.C index 4ff9179bae..26aa55f159 100644 --- a/src/frontends/gtk/GSendto.C +++ b/src/frontends/gtk/GSendto.C @@ -33,7 +33,7 @@ namespace lyx { namespace frontend { GSendto::GSendto(Dialog & parent) - : GViewCB(parent, _("Send document to command"), false) + : GViewCB(parent, lyx::to_utf8(_("Send document to command")), false) {} diff --git a/src/frontends/gtk/GShowFile.C b/src/frontends/gtk/GShowFile.C index a6df1ce3fd..2a9594ca95 100644 --- a/src/frontends/gtk/GShowFile.C +++ b/src/frontends/gtk/GShowFile.C @@ -29,7 +29,7 @@ namespace lyx { namespace frontend { GShowFile::GShowFile(Dialog & parent) - : GViewCB(parent, _("Show File"), false) + : GViewCB(parent, lyx::to_utf8(_("Show File")), false) {} @@ -60,7 +60,7 @@ void GShowFile::update() if (!contents.empty()) contentbuffer_->set_text(contents); else - contentbuffer_->set_text(_("Error reading file!")); + contentbuffer_->set_text(lyx::to_utf8(_("Error reading file!"))); } } // namespace frontend diff --git a/src/frontends/gtk/GSpellchecker.C b/src/frontends/gtk/GSpellchecker.C index f0d7332d6c..d67c6860eb 100644 --- a/src/frontends/gtk/GSpellchecker.C +++ b/src/frontends/gtk/GSpellchecker.C @@ -31,8 +31,7 @@ namespace lyx { namespace frontend { GSpellchecker::GSpellchecker(Dialog & parent) - : GViewCB - (parent, _("Spellchecker"), false) + : GViewCB(parent, lyx::to_utf8(_("Spellchecker")), false) {} @@ -133,7 +132,7 @@ void GSpellchecker::partialUpdate(int s) int const progress = controller().getProgress(); if (progress != 0) { progress_->set_fraction(float(progress)/100.0f); - progress_->set_text(convert(progress) + "% " + _("checked")); + progress_->set_text(convert(progress) + "% " + lyx::to_utf8(_("checked"))); } } diff --git a/src/frontends/gtk/GTableCreate.C b/src/frontends/gtk/GTableCreate.C index 6f172ff2ca..5c208c548d 100644 --- a/src/frontends/gtk/GTableCreate.C +++ b/src/frontends/gtk/GTableCreate.C @@ -31,7 +31,7 @@ namespace lyx { namespace frontend { GTableCreate::GTableCreate(Dialog & parent) - : GViewCB(parent, _("Insert Table")) + : GViewCB(parent, lyx::to_utf8(_("Insert Table"))) { } diff --git a/src/frontends/gtk/GTabular.C b/src/frontends/gtk/GTabular.C index f68c1482a3..103c02d603 100644 --- a/src/frontends/gtk/GTabular.C +++ b/src/frontends/gtk/GTabular.C @@ -39,7 +39,7 @@ namespace lyx { namespace frontend { GTabular::GTabular(Dialog & parent) - : GViewCB(parent, _("Table Settings"), false) + : GViewCB(parent, lyx::to_utf8(_("Table Settings")), false) {} @@ -354,11 +354,11 @@ void GTabular::updateHorzAlignCombo(bool extraoption) // Deprecated in favor of clear_items in gtkmm >= 2.8 unsigned int const oldselection = horzaligncombo_->get_active_row_number(); horzaligncombo_->clear(); - horzaligncombo_->append_text(_("Left")); - horzaligncombo_->append_text(_("Center")); - horzaligncombo_->append_text(_("Right")); + horzaligncombo_->append_text(lyx::to_utf8(_("Left"))); + horzaligncombo_->append_text(lyx::to_utf8(_("Center"))); + horzaligncombo_->append_text(lyx::to_utf8(_("Right"))); if (extraoption) - horzaligncombo_->append_text(_("Block")); + horzaligncombo_->append_text(lyx::to_utf8(_("Block"))); if (oldselection < horzaligncombo_->get_model()->children().size()) horzaligncombo_->set_active(oldselection); else diff --git a/src/frontends/gtk/GTexinfo.C b/src/frontends/gtk/GTexinfo.C index 1a4c5941f0..81038c721a 100644 --- a/src/frontends/gtk/GTexinfo.C +++ b/src/frontends/gtk/GTexinfo.C @@ -34,7 +34,7 @@ namespace frontend { GTexinfo::GTexinfo(Dialog & parent) - : GViewCB(parent, _("TeX Information"), false), + : GViewCB(parent, lyx::to_utf8(_("TeX Information")), false), activeStyle(ControlTexinfo::cls) {} @@ -80,18 +80,18 @@ void GTexinfo::doBuild() { sigc::mem_fun(*this, >exinfo::onTypeComboChanged)); Gtk::TreeModel::iterator row = typestore_->append(); - (*row)[listCol_] = _("LaTeX classes"); + (*row)[listCol_] = lyx::to_utf8(_("LaTeX classes")); (*row)[listColIndex_] = ControlTexinfo::cls; // This is the default selection typecombo_->set_active(row); activeStyle = ControlTexinfo::cls; row = typestore_->append(); - (*row)[listCol_] = _("LaTeX styles"); + (*row)[listCol_] = lyx::to_utf8(_("LaTeX styles")); (*row)[listColIndex_] = ControlTexinfo::sty; row = typestore_->append(); - (*row)[listCol_] = _("BibTeX styles"); + (*row)[listCol_] = lyx::to_utf8(_("BibTeX styles")); (*row)[listColIndex_] = ControlTexinfo::bst; updateStyles(); diff --git a/src/frontends/gtk/GThesaurus.C b/src/frontends/gtk/GThesaurus.C index 4b7f8d659c..331995ef96 100644 --- a/src/frontends/gtk/GThesaurus.C +++ b/src/frontends/gtk/GThesaurus.C @@ -44,7 +44,7 @@ synModelColumns synColumns; GThesaurus::GThesaurus(Dialog & parent) - : GViewCB(parent, _("Thesaurus"), false) + : GViewCB(parent, lyx::to_utf8(_("Thesaurus")), false) {} @@ -63,7 +63,7 @@ void GThesaurus::doBuild() xml_->get_widget("Keyword", keywordentry_); xml_->get_widget("Meanings", meaningsview_); - meaningsview_->append_column(_("Synonym"), synColumns.name); + meaningsview_->append_column(lyx::to_utf8(_("Synonym")), synColumns.name); // Keyword entry changed @@ -146,14 +146,14 @@ void GThesaurus::update_lists() for (std::vector::const_iterator cit2 = cit->second.begin(); cit2 != cit->second.end(); ++cit2) { - Gtk::TreeModel::Row childrow = *(synTreeStore_->append(row.children())); + Gtk::TreeModel::Row childrow = *(synTreeStore_->append(row.children())); childrow[synColumns.name] = *cit2; } } meaningsview_->set_sensitive(true); } else { Gtk::TreeModel::Row row = *(synTreeStore_->append()); - row[synColumns.name] = _("No synonyms found"); + row[synColumns.name] = lyx::to_utf8(_("No synonyms found")); meaningsview_->set_sensitive(false); } meaningsview_->set_model(synTreeStore_); diff --git a/src/frontends/gtk/GToc.C b/src/frontends/gtk/GToc.C index 1c812c875c..3eee0a40ab 100644 --- a/src/frontends/gtk/GToc.C +++ b/src/frontends/gtk/GToc.C @@ -30,7 +30,7 @@ namespace lyx { namespace frontend { GToc::GToc(Dialog & parent) - : GViewCB(parent, _("Table of Contents"), false) + : GViewCB(parent, lyx::to_utf8(_("Table of Contents")), false) {} @@ -119,7 +119,7 @@ void GToc::updateContents() { if (typestore_->children().empty()) { tocstore_->clear(); - (*tocstore_->append())[listCol_] = _("*** No Lists ***"); + (*tocstore_->append())[listCol_] = lyx::to_utf8(_("*** No Lists ***")); tocview_->set_sensitive(false); return; } @@ -142,7 +142,7 @@ void GToc::updateContents() if (contents.empty()) { tocstore_->clear(); - (*tocstore_->append())[listCol_] = _("*** No Items ***"); + (*tocstore_->append())[listCol_] = lyx::to_utf8(_("*** No Items ***")); tocview_->set_sensitive(false); return; } diff --git a/src/frontends/gtk/GUrl.C b/src/frontends/gtk/GUrl.C index 6b762dd65a..76f344fa01 100644 --- a/src/frontends/gtk/GUrl.C +++ b/src/frontends/gtk/GUrl.C @@ -34,7 +34,7 @@ namespace frontend { GUrl::GUrl(Dialog & parent) - : GViewCB(parent, _("URL")) + : GViewCB(parent, lyx::to_utf8(_("URL"))) { } diff --git a/src/frontends/gtk/GVSpace.C b/src/frontends/gtk/GVSpace.C index 44991567a2..f3e3aeed8e 100644 --- a/src/frontends/gtk/GVSpace.C +++ b/src/frontends/gtk/GVSpace.C @@ -31,7 +31,7 @@ namespace lyx { namespace frontend { GVSpace::GVSpace(Dialog & parent) - : GViewCB(parent, _("VSpace Settings"), false) + : GViewCB(parent, lyx::to_utf8(_("VSpace Settings")), false) {} diff --git a/src/frontends/gtk/GWrap.C b/src/frontends/gtk/GWrap.C index 1435e4ee68..20c2dc656a 100644 --- a/src/frontends/gtk/GWrap.C +++ b/src/frontends/gtk/GWrap.C @@ -32,7 +32,7 @@ namespace lyx { namespace frontend { GWrap::GWrap(Dialog & parent) - : GViewCB(parent, _("Text Wrap Settings"), false) + : GViewCB(parent, lyx::to_utf8(_("Text Wrap Settings")), false) {} diff --git a/src/frontends/qt3/Alert_pimpl.C b/src/frontends/qt3/Alert_pimpl.C index 49b631d001..2e0986b085 100644 --- a/src/frontends/qt3/Alert_pimpl.C +++ b/src/frontends/qt3/Alert_pimpl.C @@ -36,7 +36,7 @@ int prompt_pimpl(string const & tit, string const & question, int default_button, int cancel_button, string const & b1, string const & b2, string const & b3) { - string const title = bformat(_("LyX: %1$s"), tit); + string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), tit); QWidget * const parent = qApp->focusWidget() ? qApp->focusWidget() : qApp->mainWidget(); @@ -61,7 +61,7 @@ void warning_pimpl(string const & tit, string const & message) QWidget * const parent = qApp->focusWidget() ? qApp->focusWidget() : qApp->mainWidget(); - string const title = bformat(_("LyX: %1$s"), tit); + string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), tit); QMessageBox::warning(parent, toqstr(title), toqstr(formatted(message))); @@ -73,7 +73,7 @@ void error_pimpl(string const & tit, string const & message) QWidget * const parent = qApp->focusWidget() ? qApp->focusWidget() : qApp->mainWidget(); - string const title = bformat(_("LyX: %1$s"), tit); + string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), tit); QMessageBox::critical(parent, toqstr(title), toqstr(formatted(message))); @@ -85,7 +85,7 @@ void information_pimpl(string const & tit, string const & message) QWidget * const parent = qApp->focusWidget() ? qApp->focusWidget() : qApp->mainWidget(); - string const title = bformat(_("LyX: %1$s"), tit); + string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), tit); QMessageBox::information(parent, toqstr(title), toqstr(formatted(message))); @@ -98,7 +98,7 @@ askForText_pimpl(string const & msg, string const & dflt) QWidget * const parent = qApp->focusWidget() ? qApp->focusWidget() : qApp->mainWidget(); - string const title = bformat(_("LyX: %1$s"), msg); + string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), msg); QAskForTextDialog d(parent, toqstr(title), true); // less than ideal ! d.askLA->setText(toqstr('&' + msg)); diff --git a/src/frontends/qt3/Dialogs.C b/src/frontends/qt3/Dialogs.C index bd273e23d4..f923071af5 100644 --- a/src/frontends/qt3/Dialogs.C +++ b/src/frontends/qt3/Dialogs.C @@ -216,13 +216,13 @@ Dialogs::DialogPtr Dialogs::build(string const & name) } else if (name == "index") { dialog->setController(new ControlCommand(*dialog, name)); dialog->setView(new QIndex(*dialog, - _("Index Entry"), + lyx::to_utf8(_("Index Entry")), qt_("&Keyword:"))); dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy); } else if (name == "label") { dialog->setController(new ControlCommand(*dialog, name)); dialog->setView(new QIndex(*dialog, - _("Label"), + lyx::to_utf8(_("Label")), qt_("&Label:"))); dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy); } else if (name == "log") { diff --git a/src/frontends/qt3/FileDialog.C b/src/frontends/qt3/FileDialog.C index 9160319c1b..d23c3d087b 100644 --- a/src/frontends/qt3/FileDialog.C +++ b/src/frontends/qt3/FileDialog.C @@ -152,7 +152,7 @@ FileDialog::Result const FileDialog::opendir(string const & path, qApp->focusWidget() ? qApp->focusWidget() : qApp->mainWidget(), title_.c_str())); #else - FileFilterList const filter(_("Directories")); + FileFilterList const filter(lyx::to_utf8(_("Directories"))); LyXFileDialog dlg(path, filter, title_, private_->b1, private_->b2); diff --git a/src/frontends/qt3/QAbout.C b/src/frontends/qt3/QAbout.C index 50588c1bb7..b6f03cfbc7 100644 --- a/src/frontends/qt3/QAbout.C +++ b/src/frontends/qt3/QAbout.C @@ -41,7 +41,7 @@ namespace frontend { typedef QController > base_class; QAbout::QAbout(Dialog & parent) - : base_class(parent, _("About LyX")) + : base_class(parent, lyx::to_utf8(_("About LyX"))) { } diff --git a/src/frontends/qt3/QBibitem.C b/src/frontends/qt3/QBibitem.C index 5d4ea733a5..e338343788 100644 --- a/src/frontends/qt3/QBibitem.C +++ b/src/frontends/qt3/QBibitem.C @@ -28,7 +28,7 @@ typedef QController > base_class; QBibitem::QBibitem(Dialog & parent) - : base_class(parent, _("Bibliography Entry Settings")) + : base_class(parent, lyx::to_utf8(_("Bibliography Entry Settings"))) { } diff --git a/src/frontends/qt3/QBibtex.C b/src/frontends/qt3/QBibtex.C index 2a1e30b826..bb64313984 100644 --- a/src/frontends/qt3/QBibtex.C +++ b/src/frontends/qt3/QBibtex.C @@ -45,7 +45,7 @@ namespace frontend { typedef QController > base_class; QBibtex::QBibtex(Dialog & parent) - : base_class(parent, _("BibTeX Bibliography")) + : base_class(parent, lyx::to_utf8(_("BibTeX Bibliography"))) { } diff --git a/src/frontends/qt3/QBox.C b/src/frontends/qt3/QBox.C index 65a64c4283..fec3843b38 100644 --- a/src/frontends/qt3/QBox.C +++ b/src/frontends/qt3/QBox.C @@ -48,7 +48,7 @@ namespace frontend { typedef QController > base_class; QBox::QBox(Dialog & parent) - : base_class(parent, _("Box Settings")) + : base_class(parent, lyx::to_utf8(_("Box Settings"))) {} diff --git a/src/frontends/qt3/QBranch.C b/src/frontends/qt3/QBranch.C index a5ba149ebb..2560218009 100644 --- a/src/frontends/qt3/QBranch.C +++ b/src/frontends/qt3/QBranch.C @@ -33,7 +33,7 @@ typedef QController > base_class; QBranch::QBranch(Dialog & parent) - : base_class(parent, _("Branch Settings")) + : base_class(parent, lyx::to_utf8(_("Branch Settings"))) {} diff --git a/src/frontends/qt3/QChanges.C b/src/frontends/qt3/QChanges.C index 16a2c1c230..f465799df2 100644 --- a/src/frontends/qt3/QChanges.C +++ b/src/frontends/qt3/QChanges.C @@ -33,7 +33,7 @@ typedef QController > base_class; QChanges::QChanges(Dialog & parent) - : base_class(parent, _("Merge Changes")) + : base_class(parent, lyx::to_utf8(_("Merge Changes"))) { } @@ -55,9 +55,9 @@ void QChanges::update_contents() string date(controller().getChangeDate()); if (!author.empty()) - text += bformat(_("Change by %1$s\n\n"), author); + text += bformat(lyx::to_utf8(_("Change by %1$s\n\n")), author); if (!date.empty()) - text += bformat(_("Change made at %1$s\n"), date); + text += bformat(lyx::to_utf8(_("Change made at %1$s\n")), date); dialog_->changeTV->setText(toqstr(text)); } diff --git a/src/frontends/qt3/QCharacter.C b/src/frontends/qt3/QCharacter.C index ef92642f71..04ef3c5202 100644 --- a/src/frontends/qt3/QCharacter.C +++ b/src/frontends/qt3/QCharacter.C @@ -32,7 +32,7 @@ typedef QController > base_class; QCharacter::QCharacter(Dialog & parent) - : base_class(parent, _("Text Style")) + : base_class(parent, lyx::to_utf8(_("Text Style"))) { } diff --git a/src/frontends/qt3/QCitation.C b/src/frontends/qt3/QCitation.C index 8055ec32ca..0728fae85b 100644 --- a/src/frontends/qt3/QCitation.C +++ b/src/frontends/qt3/QCitation.C @@ -47,7 +47,7 @@ namespace frontend { typedef QController > base_class; QCitation::QCitation(Dialog & parent) - : base_class(parent, _("Citation")) + : base_class(parent, lyx::to_utf8(_("Citation"))) {} diff --git a/src/frontends/qt3/QDocument.C b/src/frontends/qt3/QDocument.C index 82262b1e1d..922435f7db 100644 --- a/src/frontends/qt3/QDocument.C +++ b/src/frontends/qt3/QDocument.C @@ -67,7 +67,7 @@ char const * encodings[] = { "LaTeX default", "latin1", "latin2", QDocument::QDocument(Dialog & parent) - : base_class(parent, _("Document Settings")), + : base_class(parent, lyx::to_utf8(_("Document Settings"))), lang_(getSecond(getLanguageData(false))) {} @@ -132,7 +132,7 @@ void QDocument::build_dialog() dialog_->latexModule->classCO->insertItem(toqstr(cit->description())); } else { string item = - bformat(_("Unavailable: %1$s"), cit->description()); + bformat(lyx::to_utf8(_("Unavailable: %1$s")), cit->description()); dialog_->latexModule->classCO->insertItem(toqstr(item)); } } diff --git a/src/frontends/qt3/QDocumentDialog.C b/src/frontends/qt3/QDocumentDialog.C index a2fe4ba72d..6e4ed82b88 100644 --- a/src/frontends/qt3/QDocumentDialog.C +++ b/src/frontends/qt3/QDocumentDialog.C @@ -77,20 +77,20 @@ QDocumentDialog::QDocumentDialog(QDocument * form) branchesModule = new BranchesModuleBase(this); preambleModule = new PreambleModuleBase(this); - docPS->addPanel(latexModule, _("Document Class")); - docPS->addPanel(fontModule, _("Fonts")); - docPS->addPanel(textLayoutModule, _("Text Layout")); - docPS->addPanel(pageLayoutModule, _("Page Layout")); - docPS->addPanel(marginsModule, _("Page Margins")); - docPS->addPanel(langModule, _("Language")); - docPS->addPanel(numberingModule, _("Numbering & TOC")); - docPS->addPanel(biblioModule, _("Bibliography")); - docPS->addPanel(mathsModule, _("Math Options")); - docPS->addPanel(floatModule, _("Float Placement")); - docPS->addPanel(bulletsModule, _("Bullets")); - docPS->addPanel(branchesModule, _("Branches")); - docPS->addPanel(preambleModule, _("LaTeX Preamble")); - docPS->setCurrentPanel(_("Document Class")); + docPS->addPanel(latexModule, lyx::to_utf8(_("Document Class"))); + docPS->addPanel(fontModule, lyx::to_utf8(_("Fonts"))); + docPS->addPanel(textLayoutModule, lyx::to_utf8(_("Text Layout"))); + docPS->addPanel(pageLayoutModule, lyx::to_utf8(_("Page Layout"))); + docPS->addPanel(marginsModule, lyx::to_utf8(_("Page Margins"))); + docPS->addPanel(langModule, lyx::to_utf8(_("Language"))); + docPS->addPanel(numberingModule, lyx::to_utf8(_("Numbering & TOC"))); + docPS->addPanel(biblioModule, lyx::to_utf8(_("Bibliography"))); + docPS->addPanel(mathsModule, lyx::to_utf8(_("Math Options"))); + docPS->addPanel(floatModule, lyx::to_utf8(_("Float Placement"))); + docPS->addPanel(bulletsModule, lyx::to_utf8(_("Bullets"))); + docPS->addPanel(branchesModule, lyx::to_utf8(_("Branches"))); + docPS->addPanel(preambleModule, lyx::to_utf8(_("LaTeX Preamble"))); + docPS->setCurrentPanel(lyx::to_utf8(_("Document Class"))); // preamble connect(preambleModule->preambleMLE, SIGNAL(textChanged()), this, SLOT(change_adaptor())); @@ -225,7 +225,7 @@ QDocumentDialog::~QDocumentDialog() void QDocumentDialog::showPreamble() { - docPS->setCurrentPanel(_("LaTeX Preamble")); + docPS->setCurrentPanel(lyx::to_utf8(_("LaTeX Preamble"))); } @@ -356,7 +356,7 @@ void QDocumentDialog::updateFontsize(string const & items, string const & sel) void QDocumentDialog::romanChanged(int item) { string const font = tex_fonts_roman[item]; - + fontModule->fontScCB->setEnabled( form_->controller().providesSC(font)); fontModule->fontOsfCB->setEnabled( @@ -367,7 +367,7 @@ void QDocumentDialog::romanChanged(int item) void QDocumentDialog::sansChanged(int item) { string const font = tex_fonts_sans[item]; - + fontModule->scaleSansSB->setEnabled( form_->controller().providesScale(font)); } @@ -376,7 +376,7 @@ void QDocumentDialog::sansChanged(int item) void QDocumentDialog::ttChanged(int item) { string const font = tex_fonts_monospaced[item]; - + fontModule->scaleTypewriterSB->setEnabled( form_->controller().providesScale(font)); } diff --git a/src/frontends/qt3/QERT.C b/src/frontends/qt3/QERT.C index fcf4083219..c766fcaf27 100644 --- a/src/frontends/qt3/QERT.C +++ b/src/frontends/qt3/QERT.C @@ -27,7 +27,7 @@ typedef QController > base_class; QERT::QERT(Dialog & parent) - : base_class(parent, _("TeX Code Settings")) + : base_class(parent, lyx::to_utf8(_("TeX Code Settings"))) { } diff --git a/src/frontends/qt3/QExternal.C b/src/frontends/qt3/QExternal.C index ec342dab5b..70f15a756a 100644 --- a/src/frontends/qt3/QExternal.C +++ b/src/frontends/qt3/QExternal.C @@ -277,7 +277,7 @@ void getExtra(external::ExtraData & data, typedef QController > base_class; QExternal::QExternal(Dialog & parent) - : base_class(parent, _("External Material")) + : base_class(parent, lyx::to_utf8(_("External Material"))) {} diff --git a/src/frontends/qt3/QFloat.C b/src/frontends/qt3/QFloat.C index c08f09400d..e7988d2f07 100644 --- a/src/frontends/qt3/QFloat.C +++ b/src/frontends/qt3/QFloat.C @@ -28,7 +28,7 @@ typedef QController > base_class; QFloat::QFloat(Dialog & parent) - : base_class(parent, _("Float Settings")) + : base_class(parent, lyx::to_utf8(_("Float Settings"))) { } diff --git a/src/frontends/qt3/QGraphics.C b/src/frontends/qt3/QGraphics.C index 4fb844d397..2215c073da 100644 --- a/src/frontends/qt3/QGraphics.C +++ b/src/frontends/qt3/QGraphics.C @@ -57,7 +57,7 @@ namespace frontend { typedef QController > base_class; QGraphics::QGraphics(Dialog & parent) - : base_class(parent, _("Graphics")) + : base_class(parent, lyx::to_utf8(_("Graphics"))) { } diff --git a/src/frontends/qt3/QInclude.C b/src/frontends/qt3/QInclude.C index df6ac70f87..bb69c54f96 100644 --- a/src/frontends/qt3/QInclude.C +++ b/src/frontends/qt3/QInclude.C @@ -36,7 +36,7 @@ typedef QController > base_class; QInclude::QInclude(Dialog & parent) - : base_class(parent, _("Child Document")) + : base_class(parent, lyx::to_utf8(_("Child Document"))) {} diff --git a/src/frontends/qt3/QMath.C b/src/frontends/qt3/QMath.C index 59e6ce6d0c..f50b92774f 100644 --- a/src/frontends/qt3/QMath.C +++ b/src/frontends/qt3/QMath.C @@ -24,7 +24,7 @@ typedef QController > math_base; QMath::QMath(Dialog & parent) - : math_base(parent, _("Math Panel")) + : math_base(parent, lyx::to_utf8(_("Math Panel"))) {} @@ -38,7 +38,7 @@ typedef QController > matrix_base; QMathMatrix::QMathMatrix(Dialog & parent) - : matrix_base(parent, _("Math Matrix")) + : matrix_base(parent, lyx::to_utf8(_("Math Matrix"))) {} @@ -52,7 +52,7 @@ typedef QController > delimiter_base; QMathDelimiter::QMathDelimiter(Dialog & parent) - : delimiter_base(parent, _("Math Delimiter")) + : delimiter_base(parent, lyx::to_utf8(_("Math Delimiter"))) {} diff --git a/src/frontends/qt3/QNote.C b/src/frontends/qt3/QNote.C index 6e3f9f9a6f..20f45c14cd 100644 --- a/src/frontends/qt3/QNote.C +++ b/src/frontends/qt3/QNote.C @@ -31,7 +31,7 @@ typedef QController > base_class; QNote::QNote(Dialog & parent) - : base_class(parent, _("Note Settings")) + : base_class(parent, lyx::to_utf8(_("Note Settings"))) {} diff --git a/src/frontends/qt3/QParagraph.C b/src/frontends/qt3/QParagraph.C index fc7bf7d821..80094bf692 100644 --- a/src/frontends/qt3/QParagraph.C +++ b/src/frontends/qt3/QParagraph.C @@ -37,7 +37,7 @@ typedef QController > base_class; QParagraph::QParagraph(Dialog & parent) - : base_class(parent, _("Paragraph Settings")) + : base_class(parent, lyx::to_utf8(_("Paragraph Settings"))) {} @@ -116,8 +116,8 @@ void QParagraph::update_contents() // label width string const & labelwidth = params.labelWidthString(); - // _() is correct here (this is stupid though !) - if (labelwidth != _("Senseless with this layout!")) { + // lyx::to_utf8(_() is correct here (this is stupid though !)) + if (labelwidth != lyx::to_utf8(_("Senseless with this layout!"))) { dialog_->labelwidthGB->setEnabled(true); dialog_->labelWidth->setText(toqstr(labelwidth)); } else { diff --git a/src/frontends/qt3/QPrefs.C b/src/frontends/qt3/QPrefs.C index 2e185d05ef..8bcf36ad55 100644 --- a/src/frontends/qt3/QPrefs.C +++ b/src/frontends/qt3/QPrefs.C @@ -78,7 +78,7 @@ namespace frontend { typedef QController > base_class; QPrefs::QPrefs(Dialog & parent) - : base_class(parent, _("Preferences")) + : base_class(parent, lyx::to_utf8(_("Preferences"))) { } diff --git a/src/frontends/qt3/QPrefsDialog.C b/src/frontends/qt3/QPrefsDialog.C index c151691d05..7c58329b78 100644 --- a/src/frontends/qt3/QPrefsDialog.C +++ b/src/frontends/qt3/QPrefsDialog.C @@ -93,36 +93,36 @@ QPrefsDialog::QPrefsDialog(QPrefs * form) uiModule = new QPrefUIModule(this); identityModule = new QPrefIdentityModule(this); - string const laf = _("Look and feel"); + string const laf = lyx::to_utf8(_("Look and feel")); prefsPS->addCategory(laf); - prefsPS->addPanel(uiModule, _("User interface"), laf); - prefsPS->addPanel(screenfontsModule, _("Screen fonts"), laf); - prefsPS->addPanel(colorsModule, _("Colors"), laf); - prefsPS->addPanel(displayModule, _("Graphics"), laf); - prefsPS->addPanel(keyboardModule, _("Keyboard"), laf); + prefsPS->addPanel(uiModule, lyx::to_utf8(_("User interface")), laf); + prefsPS->addPanel(screenfontsModule, lyx::to_utf8(_("Screen fonts")), laf); + prefsPS->addPanel(colorsModule, lyx::to_utf8(_("Colors")), laf); + prefsPS->addPanel(displayModule, lyx::to_utf8(_("Graphics")), laf); + prefsPS->addPanel(keyboardModule, lyx::to_utf8(_("Keyboard")), laf); - string const ls = _("Language settings"); + string const ls = lyx::to_utf8(_("Language settings")); prefsPS->addCategory(ls); - prefsPS->addPanel(languageModule, _("Language"), ls); - prefsPS->addPanel(spellcheckerModule, _("Spellchecker"), ls); + prefsPS->addPanel(languageModule, lyx::to_utf8(_("Language")), ls); + prefsPS->addPanel(spellcheckerModule, lyx::to_utf8(_("Spellchecker")), ls); - string const op = _("Outputs"); + string const op = lyx::to_utf8(_("Outputs")); prefsPS->addCategory(op); - prefsPS->addPanel(asciiModule, _("Plain text"), op); - prefsPS->addPanel(dateModule, _("Date format"), op); - prefsPS->addPanel(latexModule, _("LaTeX"), op); + prefsPS->addPanel(asciiModule, lyx::to_utf8(_("Plain text")), op); + prefsPS->addPanel(dateModule, lyx::to_utf8(_("Date format")), op); + prefsPS->addPanel(latexModule, lyx::to_utf8(_("LaTeX")), op); #if defined(__CYGWIN__) || defined(_WIN32) - prefsPS->addPanel(cygwinpathModule, _("Paths"), op); + prefsPS->addPanel(cygwinpathModule, lyx::to_utf8(_("Paths")), op); #endif - prefsPS->addPanel(printerModule, _("Printer"), op); + prefsPS->addPanel(printerModule, lyx::to_utf8(_("Printer")), op); - prefsPS->addPanel(identityModule, _("Identity")); - prefsPS->addPanel(pathsModule, _("Paths")); - prefsPS->addPanel(fileformatsModule, _("File formats")); - prefsPS->addPanel(convertersModule, _("Converters")); - prefsPS->addPanel(copiersModule, _("Copiers")); + prefsPS->addPanel(identityModule, lyx::to_utf8(_("Identity"))); + prefsPS->addPanel(pathsModule, lyx::to_utf8(_("Paths"))); + prefsPS->addPanel(fileformatsModule, lyx::to_utf8(_("File formats"))); + prefsPS->addPanel(convertersModule, lyx::to_utf8(_("Converters"))); + prefsPS->addPanel(copiersModule, lyx::to_utf8(_("Copiers"))); - prefsPS->setCurrentPanel(_("User interface")); + prefsPS->setCurrentPanel(lyx::to_utf8(_("User interface"))); // FIXME: put in controller for (int i = 0; i < LColor::ignore; ++i) { @@ -807,7 +807,7 @@ void QPrefsDialog::new_format() bool const document = fileformatsModule->documentCB->isChecked(); form_->formats().add(name, extension, prettyname, shortcut, viewer, - editor, document); + editor, document); form_->formats().sort(); updateFormats(); fileformatsModule->formatsLB->setCurrentItem(form_->formats().getNumber(name)); @@ -838,7 +838,7 @@ void QPrefsDialog::modify_format() bool const document = fileformatsModule->documentCB->isChecked(); form_->formats().add(name, extension, prettyname, shortcut, viewer, - editor, document); + editor, document); form_->formats().sort(); fileformatsModule->formatsLB->setUpdatesEnabled(false); @@ -863,9 +863,9 @@ void QPrefsDialog::remove_format() return; string const current_text = form_->formats().get(nr).name(); if (form_->converters().formatIsUsed(current_text)) { - Alert::error(_("Format in use"), - _("Cannot remove a Format used by a Converter. " - "Remove the converter first.")); + Alert::error(lyx::to_utf8(_("Format in use")), + lyx::to_utf8(_("Cannot remove a Format used by a Converter. " + "Remove the converter first."))); return; } form_->formats().erase(current_text); @@ -933,11 +933,11 @@ void QPrefsDialog::select_dict() } -// NB: the _() is OK here because it gets passed back and we toqstr() them +// NB: the lyx::to_utf8(_() is OK here because it gets passed back and we toqstr()) them void QPrefsDialog::select_templatedir() { - string file(form_->controller().browsedir(fromqstr(pathsModule->templateDirED->text()), _("Select a document templates directory"))); + string file(form_->controller().browsedir(fromqstr(pathsModule->templateDirED->text()), lyx::to_utf8(_("Select a document templates directory")))); if (!file.empty()) pathsModule->templateDirED->setText(toqstr(file)); } @@ -945,7 +945,7 @@ void QPrefsDialog::select_templatedir() void QPrefsDialog::select_tempdir() { - string file(form_->controller().browsedir(fromqstr(pathsModule->tempDirED->text()), _("Select a temporary directory"))); + string file(form_->controller().browsedir(fromqstr(pathsModule->tempDirED->text()), lyx::to_utf8(_("Select a temporary directory")))); if (!file.empty()) pathsModule->tempDirED->setText(toqstr(file)); } @@ -953,7 +953,7 @@ void QPrefsDialog::select_tempdir() void QPrefsDialog::select_backupdir() { - string file(form_->controller().browsedir(fromqstr(pathsModule->backupDirED->text()), _("Select a backups directory"))); + string file(form_->controller().browsedir(fromqstr(pathsModule->backupDirED->text()), lyx::to_utf8(_("Select a backups directory")))); if (!file.empty()) pathsModule->backupDirED->setText(toqstr(file)); } @@ -961,7 +961,7 @@ void QPrefsDialog::select_backupdir() void QPrefsDialog::select_workingdir() { - string file(form_->controller().browsedir(fromqstr(pathsModule->workingDirED->text()), _("Select a document directory"))); + string file(form_->controller().browsedir(fromqstr(pathsModule->workingDirED->text()), lyx::to_utf8(_("Select a document directory")))); if (!file.empty()) pathsModule->workingDirED->setText(toqstr(file)); } @@ -969,7 +969,7 @@ void QPrefsDialog::select_workingdir() void QPrefsDialog::select_lyxpipe() { - string file(form_->controller().browse(fromqstr(pathsModule->lyxserverDirED->text()), _("Give a filename for the LyX server pipe"))); + string file(form_->controller().browse(fromqstr(pathsModule->lyxserverDirED->text()), lyx::to_utf8(_("Give a filename for the LyX server pipe")))); if (!file.empty()) pathsModule->lyxserverDirED->setText(toqstr(file)); } diff --git a/src/frontends/qt3/QPrint.C b/src/frontends/qt3/QPrint.C index 325fc3c4cb..6626c7c472 100644 --- a/src/frontends/qt3/QPrint.C +++ b/src/frontends/qt3/QPrint.C @@ -33,7 +33,7 @@ typedef QController > base_class; QPrint::QPrint(Dialog & parent) - : base_class(parent, _("Print Document")) + : base_class(parent, lyx::to_utf8(_("Print Document"))) { } diff --git a/src/frontends/qt3/QRef.C b/src/frontends/qt3/QRef.C index 0b33f3b72c..c6f5e70899 100644 --- a/src/frontends/qt3/QRef.C +++ b/src/frontends/qt3/QRef.C @@ -39,7 +39,7 @@ typedef QController > base_class; QRef::QRef(Dialog & parent) - : base_class(parent, _("Cross-reference")), + : base_class(parent, lyx::to_utf8(_("Cross-reference"))), sort_(false), at_ref_(false) { } diff --git a/src/frontends/qt3/QSearch.C b/src/frontends/qt3/QSearch.C index 7d0d55c1f1..2393b4dc53 100644 --- a/src/frontends/qt3/QSearch.C +++ b/src/frontends/qt3/QSearch.C @@ -28,7 +28,7 @@ typedef QController > base_class; QSearch::QSearch(Dialog & parent) - : base_class(parent, _("Find and Replace")) + : base_class(parent, lyx::to_utf8(_("Find and Replace"))) { } diff --git a/src/frontends/qt3/QSendto.C b/src/frontends/qt3/QSendto.C index ce11b5545e..6e4bedd92e 100644 --- a/src/frontends/qt3/QSendto.C +++ b/src/frontends/qt3/QSendto.C @@ -33,7 +33,7 @@ typedef QController > base_class; QSendto::QSendto(Dialog & parent) - : base_class(parent, _("Send Document to Command")) + : base_class(parent, lyx::to_utf8(_("Send Document to Command"))) { } diff --git a/src/frontends/qt3/QShowFile.C b/src/frontends/qt3/QShowFile.C index 996cabaf72..7e3b160532 100644 --- a/src/frontends/qt3/QShowFile.C +++ b/src/frontends/qt3/QShowFile.C @@ -29,7 +29,7 @@ typedef QController > base_class; QShowFile::QShowFile(Dialog & parent) - : base_class(parent, _("Show File")) + : base_class(parent, lyx::to_utf8(_("Show File"))) { } diff --git a/src/frontends/qt3/QSpellchecker.C b/src/frontends/qt3/QSpellchecker.C index 680086a4db..7d7ee002dc 100644 --- a/src/frontends/qt3/QSpellchecker.C +++ b/src/frontends/qt3/QSpellchecker.C @@ -32,7 +32,7 @@ typedef QController > base_class QSpellchecker::QSpellchecker(Dialog & parent) - : base_class(parent, _("Spellchecker")) + : base_class(parent, lyx::to_utf8(_("Spellchecker"))) {} diff --git a/src/frontends/qt3/QTabular.C b/src/frontends/qt3/QTabular.C index dbe60bc803..e0a7b70ad7 100644 --- a/src/frontends/qt3/QTabular.C +++ b/src/frontends/qt3/QTabular.C @@ -39,7 +39,7 @@ namespace frontend { typedef QController > base_class; QTabular::QTabular(Dialog & parent) - : base_class(parent, _("Table Settings")) + : base_class(parent, lyx::to_utf8(_("Table Settings"))) { } diff --git a/src/frontends/qt3/QTabularCreate.C b/src/frontends/qt3/QTabularCreate.C index 1bd9701c0f..faea739a5c 100644 --- a/src/frontends/qt3/QTabularCreate.C +++ b/src/frontends/qt3/QTabularCreate.C @@ -26,7 +26,7 @@ typedef QController > base_cla QTabularCreate::QTabularCreate(Dialog & parent) - : base_class(parent, _("Insert Table")) + : base_class(parent, lyx::to_utf8(_("Insert Table"))) { } diff --git a/src/frontends/qt3/QTexinfo.C b/src/frontends/qt3/QTexinfo.C index 87055d2fd0..b0b3a15018 100644 --- a/src/frontends/qt3/QTexinfo.C +++ b/src/frontends/qt3/QTexinfo.C @@ -31,7 +31,7 @@ namespace frontend { typedef QController > base_class; QTexinfo::QTexinfo(Dialog & parent) - : base_class(parent, _("TeX Information")), + : base_class(parent, lyx::to_utf8(_("TeX Information"))), warningPosted(false), activeStyle(ControlTexinfo::cls) { } diff --git a/src/frontends/qt3/QThesaurus.C b/src/frontends/qt3/QThesaurus.C index 9d08737ae4..40dca16cda 100644 --- a/src/frontends/qt3/QThesaurus.C +++ b/src/frontends/qt3/QThesaurus.C @@ -26,7 +26,7 @@ namespace frontend { typedef QController > base_class; QThesaurus::QThesaurus(Dialog & parent) - : base_class(parent, _("Thesaurus")) + : base_class(parent, lyx::to_utf8(_("Thesaurus"))) { } diff --git a/src/frontends/qt3/QToc.C b/src/frontends/qt3/QToc.C index 4cdd0db3de..f3446a31fb 100644 --- a/src/frontends/qt3/QToc.C +++ b/src/frontends/qt3/QToc.C @@ -38,7 +38,7 @@ namespace frontend { typedef QController > base_class; QToc::QToc(Dialog & parent) - : base_class(parent, _("Table of Contents")), depth_(1) + : base_class(parent, lyx::to_utf8(_("Table of Contents"))), depth_(1) {} diff --git a/src/frontends/qt3/QURL.C b/src/frontends/qt3/QURL.C index cd8324df1e..0636d0d8ce 100644 --- a/src/frontends/qt3/QURL.C +++ b/src/frontends/qt3/QURL.C @@ -30,7 +30,7 @@ namespace frontend { typedef QController > base_class; QURL::QURL(Dialog & parent) - : base_class(parent, _("URL")) + : base_class(parent, lyx::to_utf8(_("URL"))) { } diff --git a/src/frontends/qt3/QVSpace.C b/src/frontends/qt3/QVSpace.C index e968a08b75..11749920e1 100644 --- a/src/frontends/qt3/QVSpace.C +++ b/src/frontends/qt3/QVSpace.C @@ -130,7 +130,7 @@ VSpace setVSpaceFromWidgets(int spacing, typedef QController > base_class; QVSpace::QVSpace(Dialog & parent) - : base_class(parent, _("Vertical Space Settings")) + : base_class(parent, lyx::to_utf8(_("Vertical Space Settings"))) {} diff --git a/src/frontends/qt3/QWrap.C b/src/frontends/qt3/QWrap.C index d6aac12e89..b0be065a51 100644 --- a/src/frontends/qt3/QWrap.C +++ b/src/frontends/qt3/QWrap.C @@ -36,7 +36,7 @@ namespace frontend { typedef QController > base_class; QWrap::QWrap(Dialog & parent) - : base_class(parent, _("Text Wrap Settings")) + : base_class(parent, lyx::to_utf8(_("Text Wrap Settings"))) { } diff --git a/src/frontends/qt3/Qt2BC.h b/src/frontends/qt3/Qt2BC.h index c28e08d2bd..8b838e7ee1 100644 --- a/src/frontends/qt3/Qt2BC.h +++ b/src/frontends/qt3/Qt2BC.h @@ -33,7 +33,8 @@ class Qt2BC : public GuiBC { public: /// Qt2BC(ButtonController const &, - std::string const & = _("Cancel"), std::string const & = _("Close")); + std::string const & = lyx::to_utf8(_("Cancel")), + std::string const & = lyx::to_utf8(_("Close"))); private: /// Updates the button sensitivity (enabled/disabled) void setButtonEnabled(QButton *, bool enabled) const; diff --git a/src/frontends/qt3/validators.C b/src/frontends/qt3/validators.C index 2de6e5df00..42dba72efc 100644 --- a/src/frontends/qt3/validators.C +++ b/src/frontends/qt3/validators.C @@ -109,7 +109,7 @@ string const printable_list(string const & invalid_chars) if (it != begin) ss << ", "; if (*it == ' ') - ss << _("space"); + ss << lyx::to_utf8(_("space")); else ss << *it; } @@ -138,8 +138,8 @@ QValidator::State PathValidator::validate(QString & qtext, int &) const static int counter = 0; if (counter == 0) { - Alert::error(_("Invalid filename"), - _("LyX does not provide LateX support for file names containing any of these characters:\n") + + Alert::error(lyx::to_utf8(_("Invalid filename")), + lyx::to_utf8(_("LyX does not provide LateX support for file names containing any of these characters:\n")) + printable_list(invalid_chars)); } ++counter; diff --git a/src/frontends/qt4/Alert_pimpl.C b/src/frontends/qt4/Alert_pimpl.C index b4991b7352..7c669d551a 100644 --- a/src/frontends/qt4/Alert_pimpl.C +++ b/src/frontends/qt4/Alert_pimpl.C @@ -39,7 +39,7 @@ int prompt_pimpl(string const & tit, string const & question, int default_button, int cancel_button, string const & b1, string const & b2, string const & b3) { - string const title = bformat(_("LyX: %1$s"), tit); + string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), tit); // FIXME replace that with theApp->gui()->currentView() int res = QMessageBox::information(qApp->focusWidget(), @@ -59,7 +59,7 @@ int prompt_pimpl(string const & tit, string const & question, void warning_pimpl(string const & tit, string const & message) { - string const title = bformat(_("LyX: %1$s"), tit); + string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), tit); QMessageBox::warning(qApp->focusWidget(), toqstr(title), toqstr(formatted(message))); @@ -68,7 +68,7 @@ void warning_pimpl(string const & tit, string const & message) void error_pimpl(string const & tit, string const & message) { - string const title = bformat(_("LyX: %1$s"), tit); + string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), tit); QMessageBox::critical(qApp->focusWidget(), toqstr(title), toqstr(formatted(message))); @@ -77,7 +77,7 @@ void error_pimpl(string const & tit, string const & message) void information_pimpl(string const & tit, string const & message) { - string const title = bformat(_("LyX: %1$s"), tit); + string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), tit); QMessageBox::information(qApp->focusWidget(), toqstr(title), toqstr(formatted(message))); @@ -87,7 +87,7 @@ void information_pimpl(string const & tit, string const & message) pair const askForText_pimpl(string const & msg, string const & dflt) { - string const title = bformat(_("LyX: %1$s"), msg); + string const title = bformat(lyx::to_utf8(_("LyX: %1$s")), msg); bool ok; QString text = QInputDialog::getText(qApp->focusWidget(), diff --git a/src/frontends/qt4/Dialogs.C b/src/frontends/qt4/Dialogs.C index 5606bc190f..7d03a3433e 100644 --- a/src/frontends/qt4/Dialogs.C +++ b/src/frontends/qt4/Dialogs.C @@ -213,13 +213,13 @@ Dialogs::DialogPtr Dialogs::build(string const & name) } else if (name == "index") { dialog->setController(new ControlCommand(*dialog, name)); dialog->setView(new QIndex(*dialog, - _("Index Entry"), + lyx::to_utf8(_("Index Entry")), qt_("&Keyword:"))); dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy); } else if (name == "label") { dialog->setController(new ControlCommand(*dialog, name)); dialog->setView(new QIndex(*dialog, - _("Label"), + lyx::to_utf8(_("Label")), qt_("&Label:"))); dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy); } else if (name == "log") { diff --git a/src/frontends/qt4/FileDialog.C b/src/frontends/qt4/FileDialog.C index f9ee1f564d..4b749e66ac 100644 --- a/src/frontends/qt4/FileDialog.C +++ b/src/frontends/qt4/FileDialog.C @@ -148,7 +148,7 @@ FileDialog::Result const FileDialog::opendir(string const & path, qApp->focusWidget(), title_.c_str(),toqstr(startsWith) )); #else - FileFilterList const filter(_("Directories")); + FileFilterList const filter(lyx::to_utf8(_("Directories"))); LyXFileDialog dlg(title_, path, filter, private_->b1, private_->b2); diff --git a/src/frontends/qt4/QAbout.C b/src/frontends/qt4/QAbout.C index ecfe9e3b18..4457c20539 100644 --- a/src/frontends/qt4/QAbout.C +++ b/src/frontends/qt4/QAbout.C @@ -41,7 +41,7 @@ namespace frontend { typedef QController > base_class; QAbout::QAbout(Dialog & parent) - : base_class(parent, _("About LyX")) + : base_class(parent, lyx::to_utf8(_("About LyX"))) { } diff --git a/src/frontends/qt4/QBibitem.C b/src/frontends/qt4/QBibitem.C index 5d4ea733a5..e338343788 100644 --- a/src/frontends/qt4/QBibitem.C +++ b/src/frontends/qt4/QBibitem.C @@ -28,7 +28,7 @@ typedef QController > base_class; QBibitem::QBibitem(Dialog & parent) - : base_class(parent, _("Bibliography Entry Settings")) + : base_class(parent, lyx::to_utf8(_("Bibliography Entry Settings"))) { } diff --git a/src/frontends/qt4/QBibtex.C b/src/frontends/qt4/QBibtex.C index fbc12f9e02..b4bae450d3 100644 --- a/src/frontends/qt4/QBibtex.C +++ b/src/frontends/qt4/QBibtex.C @@ -44,7 +44,7 @@ namespace frontend { typedef QController > base_class; QBibtex::QBibtex(Dialog & parent) - : base_class(parent, _("BibTeX Bibliography")) + : base_class(parent, lyx::to_utf8(_("BibTeX Bibliography"))) { } diff --git a/src/frontends/qt4/QBox.C b/src/frontends/qt4/QBox.C index 64db6c3f38..567a843f3a 100644 --- a/src/frontends/qt4/QBox.C +++ b/src/frontends/qt4/QBox.C @@ -46,7 +46,7 @@ namespace frontend { typedef QController > base_class; QBox::QBox(Dialog & parent) - : base_class(parent, _("Box Settings")) + : base_class(parent, lyx::to_utf8(_("Box Settings"))) {} diff --git a/src/frontends/qt4/QBranch.C b/src/frontends/qt4/QBranch.C index 002353cbcb..033cd24fff 100644 --- a/src/frontends/qt4/QBranch.C +++ b/src/frontends/qt4/QBranch.C @@ -32,7 +32,7 @@ typedef QController > base_class; QBranch::QBranch(Dialog & parent) - : base_class(parent, _("Branch Settings")) + : base_class(parent, lyx::to_utf8(_("Branch Settings"))) {} diff --git a/src/frontends/qt4/QChanges.C b/src/frontends/qt4/QChanges.C index 287f700b30..dc75ee7ab2 100644 --- a/src/frontends/qt4/QChanges.C +++ b/src/frontends/qt4/QChanges.C @@ -33,7 +33,7 @@ typedef QController > base_class; QChanges::QChanges(Dialog & parent) - : base_class(parent, _("Merge Changes")) + : base_class(parent, lyx::to_utf8(_("Merge Changes"))) { } @@ -63,9 +63,9 @@ void QChanges::next() string date(controller().getChangeDate()); if (!author.empty()) - text += bformat(_("Change by %1$s\n\n"), author); + text += bformat(lyx::to_utf8(_("Change by %1$s\n\n")), author); if (!date.empty()) - text += bformat(_("Change made at %1$s\n"), date); + text += bformat(lyx::to_utf8(_("Change made at %1$s\n")), date); dialog_->changeTB->setPlainText(toqstr(text)); } diff --git a/src/frontends/qt4/QCharacter.C b/src/frontends/qt4/QCharacter.C index 70ff96fe83..5574dd618a 100644 --- a/src/frontends/qt4/QCharacter.C +++ b/src/frontends/qt4/QCharacter.C @@ -31,7 +31,7 @@ typedef QController > base_class; QCharacter::QCharacter(Dialog & parent) - : base_class(parent, _("Text Style")) + : base_class(parent, lyx::to_utf8(_("Text Style"))) { } diff --git a/src/frontends/qt4/QDocument.C b/src/frontends/qt4/QDocument.C index e357eee876..5094e5e185 100644 --- a/src/frontends/qt4/QDocument.C +++ b/src/frontends/qt4/QDocument.C @@ -45,7 +45,7 @@ typedef QController > base_class; QDocument::QDocument(Dialog & parent) - : base_class(parent, _("Document Settings")) + : base_class(parent, lyx::to_utf8(_("Document Settings"))) {} diff --git a/src/frontends/qt4/QDocumentDialog.C b/src/frontends/qt4/QDocumentDialog.C index 3c555a31fc..d5a604878e 100644 --- a/src/frontends/qt4/QDocumentDialog.C +++ b/src/frontends/qt4/QDocumentDialog.C @@ -363,7 +363,7 @@ QDocumentDialog::QDocumentDialog(QDocument * form) latexModule->classCO->addItem(toqstr(cit->description())); } else { string item = - bformat(_("Unavailable: %1$s"), cit->description()); + bformat(lyx::to_utf8(_("Unavailable: %1$s")), cit->description()); latexModule->classCO->addItem(toqstr(item)); } } @@ -388,20 +388,20 @@ QDocumentDialog::QDocumentDialog(QDocument * form) floatModule = new FloatPlacement; connect(floatModule, SIGNAL(changed()), this, SLOT(change_adaptor())); - docPS->addPanel(latexModule, _("Document Class")); - docPS->addPanel(fontModule, _("Fonts")); - docPS->addPanel(textLayoutModule, _("Text Layout")); - docPS->addPanel(pageLayoutModule, _("Page Layout")); - docPS->addPanel(marginsModule, _("Page Margins")); - docPS->addPanel(langModule, _("Language")); - docPS->addPanel(numberingModule, _("Numbering & TOC")); - docPS->addPanel(biblioModule, _("Bibliography")); - docPS->addPanel(mathsModule, _("Math Options")); - docPS->addPanel(floatModule, _("Float Placement")); - docPS->addPanel(bulletsModule, _("Bullets")); - docPS->addPanel(branchesModule, _("Branches")); - docPS->addPanel(preambleModule, _("LaTeX Preamble")); - docPS->setCurrentPanel(_("Document Class")); + docPS->addPanel(latexModule, lyx::to_utf8(_("Document Class"))); + docPS->addPanel(fontModule, lyx::to_utf8(_("Fonts"))); + docPS->addPanel(textLayoutModule, lyx::to_utf8(_("Text Layout"))); + docPS->addPanel(pageLayoutModule, lyx::to_utf8(_("Page Layout"))); + docPS->addPanel(marginsModule, lyx::to_utf8(_("Page Margins"))); + docPS->addPanel(langModule, lyx::to_utf8(_("Language"))); + docPS->addPanel(numberingModule, lyx::to_utf8(_("Numbering & TOC"))); + docPS->addPanel(biblioModule, lyx::to_utf8(_("Bibliography"))); + docPS->addPanel(mathsModule, lyx::to_utf8(_("Math Options"))); + docPS->addPanel(floatModule, lyx::to_utf8(_("Float Placement"))); + docPS->addPanel(bulletsModule, lyx::to_utf8(_("Bullets"))); + docPS->addPanel(branchesModule, lyx::to_utf8(_("Branches"))); + docPS->addPanel(preambleModule, lyx::to_utf8(_("LaTeX Preamble"))); + docPS->setCurrentPanel(lyx::to_utf8(_("Document Class"))); } @@ -412,7 +412,7 @@ QDocumentDialog::~QDocumentDialog() void QDocumentDialog::showPreamble() { - docPS->setCurrentPanel(_("LaTeX Preamble")); + docPS->setCurrentPanel(lyx::to_utf8(_("LaTeX Preamble"))); } diff --git a/src/frontends/qt4/QERT.C b/src/frontends/qt4/QERT.C index fcf4083219..c766fcaf27 100644 --- a/src/frontends/qt4/QERT.C +++ b/src/frontends/qt4/QERT.C @@ -27,7 +27,7 @@ typedef QController > base_class; QERT::QERT(Dialog & parent) - : base_class(parent, _("TeX Code Settings")) + : base_class(parent, lyx::to_utf8(_("TeX Code Settings"))) { } diff --git a/src/frontends/qt4/QExternal.C b/src/frontends/qt4/QExternal.C index 3df1956375..73967cd059 100644 --- a/src/frontends/qt4/QExternal.C +++ b/src/frontends/qt4/QExternal.C @@ -276,7 +276,7 @@ void getExtra(external::ExtraData & data, typedef QController > base_class; QExternal::QExternal(Dialog & parent) - : base_class(parent, _("External Material")) + : base_class(parent, lyx::to_utf8(_("External Material"))) {} diff --git a/src/frontends/qt4/QFloat.C b/src/frontends/qt4/QFloat.C index 1d1ccfc581..3d9cd6e85f 100644 --- a/src/frontends/qt4/QFloat.C +++ b/src/frontends/qt4/QFloat.C @@ -28,7 +28,7 @@ typedef QController > base_class; QFloat::QFloat(Dialog & parent) - : base_class(parent, _("Float Settings")) + : base_class(parent, lyx::to_utf8(_("Float Settings"))) { } diff --git a/src/frontends/qt4/QGraphics.C b/src/frontends/qt4/QGraphics.C index 77cdbc6703..ed2340f4fd 100644 --- a/src/frontends/qt4/QGraphics.C +++ b/src/frontends/qt4/QGraphics.C @@ -56,7 +56,7 @@ namespace frontend { typedef QController > base_class; QGraphics::QGraphics(Dialog & parent) - : base_class(parent, _("Graphics")) + : base_class(parent, lyx::to_utf8(_("Graphics"))) { } diff --git a/src/frontends/qt4/QInclude.C b/src/frontends/qt4/QInclude.C index 1241a1b7e8..0a3243b946 100644 --- a/src/frontends/qt4/QInclude.C +++ b/src/frontends/qt4/QInclude.C @@ -35,7 +35,7 @@ typedef QController > base_class; QInclude::QInclude(Dialog & parent) - : base_class(parent, _("Child Document")) + : base_class(parent, lyx::to_utf8(_("Child Document"))) {} diff --git a/src/frontends/qt4/QMath.C b/src/frontends/qt4/QMath.C index 59e6ce6d0c..f50b92774f 100644 --- a/src/frontends/qt4/QMath.C +++ b/src/frontends/qt4/QMath.C @@ -24,7 +24,7 @@ typedef QController > math_base; QMath::QMath(Dialog & parent) - : math_base(parent, _("Math Panel")) + : math_base(parent, lyx::to_utf8(_("Math Panel"))) {} @@ -38,7 +38,7 @@ typedef QController > matrix_base; QMathMatrix::QMathMatrix(Dialog & parent) - : matrix_base(parent, _("Math Matrix")) + : matrix_base(parent, lyx::to_utf8(_("Math Matrix"))) {} @@ -52,7 +52,7 @@ typedef QController > delimiter_base; QMathDelimiter::QMathDelimiter(Dialog & parent) - : delimiter_base(parent, _("Math Delimiter")) + : delimiter_base(parent, lyx::to_utf8(_("Math Delimiter"))) {} diff --git a/src/frontends/qt4/QNote.C b/src/frontends/qt4/QNote.C index 24118ad6d5..af1b5ab4ba 100644 --- a/src/frontends/qt4/QNote.C +++ b/src/frontends/qt4/QNote.C @@ -31,7 +31,7 @@ typedef QController > base_class; QNote::QNote(Dialog & parent) - : base_class(parent, _("Note Settings")) + : base_class(parent, lyx::to_utf8(_("Note Settings"))) {} diff --git a/src/frontends/qt4/QParagraph.C b/src/frontends/qt4/QParagraph.C index 275dc91c92..4361f4ce39 100644 --- a/src/frontends/qt4/QParagraph.C +++ b/src/frontends/qt4/QParagraph.C @@ -35,7 +35,7 @@ typedef QController > base_class; QParagraph::QParagraph(Dialog & parent) - : base_class(parent, _("Paragraph Settings")) + : base_class(parent, lyx::to_utf8(_("Paragraph Settings"))) {} @@ -114,8 +114,8 @@ void QParagraph::update_contents() // label width string const & labelwidth = params.labelWidthString(); - // _() is correct here (this is stupid though !) - if (labelwidth != _("Senseless with this layout!")) { + // lyx::to_utf8(_() is correct here (this is stupid though !)) + if (labelwidth != lyx::to_utf8(_("Senseless with this layout!"))) { dialog_->labelwidthGB->setEnabled(true); dialog_->labelWidth->setText(toqstr(labelwidth)); } else { diff --git a/src/frontends/qt4/QPrefs.C b/src/frontends/qt4/QPrefs.C index cce7420a99..4f2e3f51ff 100644 --- a/src/frontends/qt4/QPrefs.C +++ b/src/frontends/qt4/QPrefs.C @@ -38,7 +38,7 @@ namespace frontend { typedef QController > base_class; QPrefs::QPrefs(Dialog & parent) - : base_class(parent, _("Preferences")) + : base_class(parent, lyx::to_utf8(_("Preferences"))) { } diff --git a/src/frontends/qt4/QPrefsDialog.C b/src/frontends/qt4/QPrefsDialog.C index 22e38518ec..959bbbacfe 100644 --- a/src/frontends/qt4/QPrefsDialog.C +++ b/src/frontends/qt4/QPrefsDialog.C @@ -180,7 +180,7 @@ string const internal_path(QString const & input) PrefAscii::PrefAscii(QWidget * parent) -: PrefModule(_(Outputs), _("Plain text"), 0, parent) +: PrefModule(lyx::to_utf8(_(Outputs)), lyx::to_utf8(_("Plain text")), 0, parent) { setupUi(this); connect(asciiLinelengthSB, SIGNAL(valueChanged(int)), @@ -205,7 +205,7 @@ void PrefAscii::update(LyXRC const & rc) PrefDate::PrefDate(QWidget * parent) -: PrefModule(_(Outputs), _("Date format"), 0, parent) +: PrefModule(lyx::to_utf8(_(Outputs)), lyx::to_utf8(_("Date format")), 0, parent) { setupUi(this); connect(DateED, SIGNAL(textChanged(const QString&)), @@ -226,7 +226,7 @@ void PrefDate::update(LyXRC const & rc) PrefKeyboard::PrefKeyboard(QPrefs * form, QWidget * parent) -: PrefModule(_(LookAndFeel), _("Keyboard"), form, parent) +: PrefModule(lyx::to_utf8(_(LookAndFeel)), lyx::to_utf8(_("Keyboard")), form, parent) { setupUi(this); @@ -300,7 +300,7 @@ void PrefKeyboard::on_secondKeymapPB_clicked(bool) PrefLatex::PrefLatex(QPrefs * form, QWidget * parent) -: PrefModule(_(Outputs), _("LaTeX"), form, parent) +: PrefModule(lyx::to_utf8(_(Outputs)), lyx::to_utf8(_("LaTeX")), form, parent) { setupUi(this); connect(latexEncodingED, SIGNAL(textChanged(const QString&)), @@ -347,7 +347,7 @@ void PrefLatex::update(LyXRC const & rc) PrefScreenFonts::PrefScreenFonts(QPrefs * form, QWidget * parent) -: PrefModule(_(LookAndFeel), _("Screen fonts"), form, parent) +: PrefModule(lyx::to_utf8(_(LookAndFeel)), lyx::to_utf8(_("Screen fonts")), form, parent) { setupUi(this); @@ -499,7 +499,7 @@ void PrefScreenFonts::select_typewriter(const QString& name) PrefColors::PrefColors(QPrefs * form, QWidget * parent) -: PrefModule(_(LookAndFeel), _("Colors"), form, parent) +: PrefModule(lyx::to_utf8(_(LookAndFeel)), lyx::to_utf8(_("Colors")), form, parent) { setupUi(this); @@ -568,7 +568,7 @@ void PrefColors::change_color() PrefCygwinPath::PrefCygwinPath(QWidget * parent) -: PrefModule(_(Outputs), _("Paths"), 0, parent) +: PrefModule(lyx::to_utf8(_(Outputs)), lyx::to_utf8(_("Paths")), 0, parent) { setupUi(this); connect(pathCB, SIGNAL(toggled(bool)), @@ -589,7 +589,7 @@ void PrefCygwinPath::update(LyXRC const & rc) PrefDisplay::PrefDisplay(QWidget * parent) -: PrefModule(_(LookAndFeel), _("Graphics"), 0, parent) +: PrefModule(lyx::to_utf8(_(LookAndFeel)), lyx::to_utf8(_("Graphics")), 0, parent) { setupUi(this); connect(instantPreviewCO, SIGNAL(activated(int)), @@ -656,7 +656,7 @@ void PrefDisplay::update(LyXRC const & rc) PrefPaths::PrefPaths(QPrefs * form, QWidget * parent) -: PrefModule(string(), _("Paths"), form, parent) +: PrefModule(string(), lyx::to_utf8(_("Paths")), form, parent) { setupUi(this); connect(templateDirPB, SIGNAL(clicked()), this, SLOT(select_templatedir())); @@ -702,11 +702,11 @@ void PrefPaths::update(LyXRC const & rc) lyxserverDirED->setText(external_path(rc.lyxpipes)); } -// NB: the _() is OK here because it gets passed back and we toqstr() them +// NB: the lyx::to_utf8(_() is OK here because it gets passed back and we toqstr()) them void PrefPaths::select_templatedir() { - string file(form_->controller().browsedir(fromqstr(templateDirED->text()), _("Select a document templates directory"))); + string file(form_->controller().browsedir(fromqstr(templateDirED->text()), lyx::to_utf8(_("Select a document templates directory")))); if (!file.empty()) templateDirED->setText(toqstr(file)); } @@ -714,7 +714,7 @@ void PrefPaths::select_templatedir() void PrefPaths::select_tempdir() { - string file(form_->controller().browsedir(fromqstr(tempDirED->text()), _("Select a temporary directory"))); + string file(form_->controller().browsedir(fromqstr(tempDirED->text()), lyx::to_utf8(_("Select a temporary directory")))); if (!file.empty()) tempDirED->setText(toqstr(file)); } @@ -722,7 +722,7 @@ void PrefPaths::select_tempdir() void PrefPaths::select_backupdir() { - string file(form_->controller().browsedir(fromqstr(backupDirED->text()), _("Select a backups directory"))); + string file(form_->controller().browsedir(fromqstr(backupDirED->text()), lyx::to_utf8(_("Select a backups directory")))); if (!file.empty()) backupDirED->setText(toqstr(file)); } @@ -730,7 +730,7 @@ void PrefPaths::select_backupdir() void PrefPaths::select_workingdir() { - string file(form_->controller().browsedir(fromqstr(workingDirED->text()), _("Select a document directory"))); + string file(form_->controller().browsedir(fromqstr(workingDirED->text()), lyx::to_utf8(_("Select a document directory")))); if (!file.empty()) workingDirED->setText(toqstr(file)); } @@ -738,14 +738,14 @@ void PrefPaths::select_workingdir() void PrefPaths::select_lyxpipe() { - string file(form_->controller().browse(fromqstr(lyxserverDirED->text()), _("Give a filename for the LyX server pipe"))); + string file(form_->controller().browse(fromqstr(lyxserverDirED->text()), lyx::to_utf8(_("Give a filename for the LyX server pipe")))); if (!file.empty()) lyxserverDirED->setText(toqstr(file)); } PrefSpellchecker::PrefSpellchecker(QPrefs * form, QWidget * parent) -: PrefModule(_(LanguageSettings), _("Spellchecker"), form, parent) +: PrefModule(lyx::to_utf8(_(LanguageSettings)), lyx::to_utf8(_("Spellchecker")), form, parent) { setupUi(this); @@ -846,7 +846,7 @@ void PrefSpellchecker::select_dict() PrefConverters::PrefConverters(QPrefs * form, QWidget * parent) -: PrefModule(string(), _("Converters"), form, parent) +: PrefModule(string(), lyx::to_utf8(_("Converters")), form, parent) { setupUi(this); @@ -1035,7 +1035,7 @@ void PrefConverters::remove_converter() PrefCopiers::PrefCopiers(QPrefs * form, QWidget * parent) -: PrefModule(string(), _("Copiers"), form, parent) +: PrefModule(string(), lyx::to_utf8(_("Copiers")), form, parent) { setupUi(this); @@ -1278,7 +1278,7 @@ void PrefCopiers::remove_copier() PrefFileformats::PrefFileformats(QPrefs * form, QWidget * parent) -: PrefModule(string(), _("File formats"), form, parent) +: PrefModule(string(), lyx::to_utf8(_("File formats")), form, parent) { setupUi(this); @@ -1493,9 +1493,9 @@ void PrefFileformats::remove_format() return; string const current_text = form_->formats().get(nr).name(); if (form_->converters().formatIsUsed(current_text)) { - Alert::error(_("Format in use"), - _("Cannot remove a Format used by a Converter. " - "Remove the converter first.")); + Alert::error(lyx::to_utf8(_("Format in use")), + lyx::to_utf8(_("Cannot remove a Format used by a Converter. " + "Remove the converter first."))); return; } @@ -1510,7 +1510,7 @@ void PrefFileformats::remove_format() PrefLanguage::PrefLanguage(QWidget * parent) -: PrefModule(string(), _("Language"), 0, parent) +: PrefModule(string(), lyx::to_utf8(_("Language")), 0, parent) { setupUi(this); @@ -1586,7 +1586,7 @@ void PrefLanguage::update(LyXRC const & rc) PrefPrinter::PrefPrinter(QWidget * parent) -: PrefModule(_(Outputs), _("Printer"), 0, parent) +: PrefModule(lyx::to_utf8(_(Outputs)), lyx::to_utf8(_("Printer")), 0, parent) { setupUi(this); @@ -1678,7 +1678,7 @@ void PrefPrinter::update(LyXRC const & rc) PrefUserInterface::PrefUserInterface(QPrefs * form, QWidget * parent) -: PrefModule(_(LookAndFeel), _("User interface"), form, parent) +: PrefModule(lyx::to_utf8(_(LookAndFeel)), lyx::to_utf8(_("User interface")), form, parent) { setupUi(this); @@ -1695,21 +1695,21 @@ PrefUserInterface::PrefUserInterface(QPrefs * form, QWidget * parent) this, SIGNAL(changed())); connect(loadSessionCB, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - connect(loadWindowSizeCB, SIGNAL(toggled(bool)), + connect(loadWindowSizeCB, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - connect(loadWindowSizeCB, SIGNAL(toggled(bool)), + connect(loadWindowSizeCB, SIGNAL(toggled(bool)), windowWidthLA, SLOT(setDisabled(bool))); - connect(loadWindowSizeCB, SIGNAL(toggled(bool)), + connect(loadWindowSizeCB, SIGNAL(toggled(bool)), windowHeightLA, SLOT(setDisabled(bool))); - connect(loadWindowSizeCB, SIGNAL(toggled(bool)), + connect(loadWindowSizeCB, SIGNAL(toggled(bool)), windowWidthSB, SLOT(setDisabled(bool))); - connect(loadWindowSizeCB, SIGNAL(toggled(bool)), + connect(loadWindowSizeCB, SIGNAL(toggled(bool)), windowHeightSB, SLOT(setDisabled(bool))); - connect(loadWindowLocationCB, SIGNAL(toggled(bool)), + connect(loadWindowLocationCB, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - connect(windowWidthSB, SIGNAL(valueChanged(int)), + connect(windowWidthSB, SIGNAL(valueChanged(int)), this, SIGNAL(changed())); - connect(windowHeightSB, SIGNAL(valueChanged(int)), + connect(windowHeightSB, SIGNAL(valueChanged(int)), this, SIGNAL(changed())); connect(cursorFollowsCB, SIGNAL(toggled(bool)), this, SIGNAL(changed())); @@ -1790,7 +1790,7 @@ void PrefUserInterface::select_bind() PrefIdentity::PrefIdentity(QWidget * parent) -: PrefModule(string(), _("Identity"), 0, parent) +: PrefModule(string(), lyx::to_utf8(_("Identity")), 0, parent) { setupUi(this); @@ -1859,7 +1859,7 @@ QPrefsDialog::QPrefsDialog(QPrefs * form) add(new PrefUserInterface(form_)); add(new PrefIdentity); - prefsPS->setCurrentPanel(_("User interface")); + prefsPS->setCurrentPanel(lyx::to_utf8(_("User interface"))); form_->bcview().setOK(savePB); form_->bcview().setApply(applyPB); diff --git a/src/frontends/qt4/QPrint.C b/src/frontends/qt4/QPrint.C index 325fc3c4cb..6626c7c472 100644 --- a/src/frontends/qt4/QPrint.C +++ b/src/frontends/qt4/QPrint.C @@ -33,7 +33,7 @@ typedef QController > base_class; QPrint::QPrint(Dialog & parent) - : base_class(parent, _("Print Document")) + : base_class(parent, lyx::to_utf8(_("Print Document"))) { } diff --git a/src/frontends/qt4/QRef.C b/src/frontends/qt4/QRef.C index 11984b30c4..d559523bc6 100644 --- a/src/frontends/qt4/QRef.C +++ b/src/frontends/qt4/QRef.C @@ -40,7 +40,7 @@ typedef QController > base_class; QRef::QRef(Dialog & parent) - : base_class(parent, _("Cross-reference")), + : base_class(parent, lyx::to_utf8(_("Cross-reference"))), sort_(false), at_ref_(false) { } diff --git a/src/frontends/qt4/QSearch.C b/src/frontends/qt4/QSearch.C index bf83be2930..f1b427875e 100644 --- a/src/frontends/qt4/QSearch.C +++ b/src/frontends/qt4/QSearch.C @@ -27,7 +27,7 @@ typedef QController > base_class; QSearch::QSearch(Dialog & parent) - : base_class(parent, _("Find and Replace")) + : base_class(parent, lyx::to_utf8(_("Find and Replace"))) { } diff --git a/src/frontends/qt4/QSendto.C b/src/frontends/qt4/QSendto.C index 874c2d727e..dbeca3c88c 100644 --- a/src/frontends/qt4/QSendto.C +++ b/src/frontends/qt4/QSendto.C @@ -32,7 +32,7 @@ typedef QController > base_class; QSendto::QSendto(Dialog & parent) - : base_class(parent, _("Send Document to Command")) + : base_class(parent, lyx::to_utf8(_("Send Document to Command"))) { } diff --git a/src/frontends/qt4/QShowFile.C b/src/frontends/qt4/QShowFile.C index 42789a4220..1f9d75496d 100644 --- a/src/frontends/qt4/QShowFile.C +++ b/src/frontends/qt4/QShowFile.C @@ -29,7 +29,7 @@ typedef QController > base_class; QShowFile::QShowFile(Dialog & parent) - : base_class(parent, _("Show File")) + : base_class(parent, lyx::to_utf8(_("Show File"))) { } diff --git a/src/frontends/qt4/QSpellchecker.C b/src/frontends/qt4/QSpellchecker.C index 510de0a3ce..7c82cff162 100644 --- a/src/frontends/qt4/QSpellchecker.C +++ b/src/frontends/qt4/QSpellchecker.C @@ -31,7 +31,7 @@ namespace frontend { typedef QController > base_class; QSpellchecker::QSpellchecker(Dialog & parent) - : base_class(parent, _("Spellchecker")) + : base_class(parent, lyx::to_utf8(_("Spellchecker"))) {} diff --git a/src/frontends/qt4/QTabular.C b/src/frontends/qt4/QTabular.C index f42c12f1b4..a07ccb5195 100644 --- a/src/frontends/qt4/QTabular.C +++ b/src/frontends/qt4/QTabular.C @@ -39,7 +39,7 @@ namespace frontend { typedef QController > base_class; QTabular::QTabular(Dialog & parent) - : base_class(parent, _("Table Settings")) + : base_class(parent, lyx::to_utf8(_("Table Settings"))) { } diff --git a/src/frontends/qt4/QTabularCreate.C b/src/frontends/qt4/QTabularCreate.C index 1bd9701c0f..faea739a5c 100644 --- a/src/frontends/qt4/QTabularCreate.C +++ b/src/frontends/qt4/QTabularCreate.C @@ -26,7 +26,7 @@ typedef QController > base_cla QTabularCreate::QTabularCreate(Dialog & parent) - : base_class(parent, _("Insert Table")) + : base_class(parent, lyx::to_utf8(_("Insert Table"))) { } diff --git a/src/frontends/qt4/QTexinfo.C b/src/frontends/qt4/QTexinfo.C index 6556770173..797d383633 100644 --- a/src/frontends/qt4/QTexinfo.C +++ b/src/frontends/qt4/QTexinfo.C @@ -29,7 +29,7 @@ namespace frontend { typedef QController > base_class; QTexinfo::QTexinfo(Dialog & parent) - : base_class(parent, _("TeX Information")), + : base_class(parent, lyx::to_utf8(_("TeX Information"))), warningPosted(false), activeStyle(ControlTexinfo::cls) { } diff --git a/src/frontends/qt4/QThesaurus.C b/src/frontends/qt4/QThesaurus.C index ae324a1078..13b86f4daf 100644 --- a/src/frontends/qt4/QThesaurus.C +++ b/src/frontends/qt4/QThesaurus.C @@ -26,7 +26,7 @@ namespace frontend { typedef QController > base_class; QThesaurus::QThesaurus(Dialog & parent) - : base_class(parent, _("Thesaurus")) + : base_class(parent, lyx::to_utf8(_("Thesaurus"))) { } diff --git a/src/frontends/qt4/QVSpace.C b/src/frontends/qt4/QVSpace.C index 7faa734115..b798409be9 100644 --- a/src/frontends/qt4/QVSpace.C +++ b/src/frontends/qt4/QVSpace.C @@ -129,7 +129,7 @@ VSpace setVSpaceFromWidgets(int spacing, typedef QController > base_class; QVSpace::QVSpace(Dialog & parent) - : base_class(parent, _("Vertical Space Settings")) + : base_class(parent, lyx::to_utf8(_("Vertical Space Settings"))) {} diff --git a/src/frontends/qt4/QWrap.C b/src/frontends/qt4/QWrap.C index a3befaa2b3..f54c668bdf 100644 --- a/src/frontends/qt4/QWrap.C +++ b/src/frontends/qt4/QWrap.C @@ -36,7 +36,7 @@ namespace frontend { typedef QController > base_class; QWrap::QWrap(Dialog & parent) - : base_class(parent, _("Text Wrap Settings")) + : base_class(parent, lyx::to_utf8(_("Text Wrap Settings"))) { } diff --git a/src/frontends/qt4/Qt2BC.h b/src/frontends/qt4/Qt2BC.h index 728067cc89..a851a118f1 100644 --- a/src/frontends/qt4/Qt2BC.h +++ b/src/frontends/qt4/Qt2BC.h @@ -33,7 +33,8 @@ class Qt2BC : public GuiBC { public: /// Qt2BC(ButtonController const &, - std::string const & = _("Cancel"), std::string const & = _("Close")); + std::string const & = lyx::to_utf8(_("Cancel")), + std::string const & = lyx::to_utf8(_("Close"))); private: /// Updates the button sensitivity (enabled/disabled) void setButtonEnabled(QPushButton *, bool enabled) const; diff --git a/src/frontends/qt4/UrlView.C b/src/frontends/qt4/UrlView.C index e416d96ac5..60a852053d 100644 --- a/src/frontends/qt4/UrlView.C +++ b/src/frontends/qt4/UrlView.C @@ -30,7 +30,7 @@ namespace frontend { typedef QController< ControlCommand, QView > base_class; UrlView::UrlView(Dialog & parent) - : base_class(parent, _("URL")) + : base_class(parent, lyx::to_utf8(_("URL"))) { } diff --git a/src/frontends/qt4/qt_helpers.C b/src/frontends/qt4/qt_helpers.C index ea3e8d48ff..41324326fa 100644 --- a/src/frontends/qt4/qt_helpers.C +++ b/src/frontends/qt4/qt_helpers.C @@ -177,13 +177,13 @@ QChar const ucs4_to_qchar(char_type const & ucs4) QString const qt_(char const * str) { - return toqstr(_(str)); + return toqstr(lyx::to_utf8(_(str))); } QString const qt_(string const & str) { - return toqstr(_(str)); + return toqstr(lyx::to_utf8(_(str))); } diff --git a/src/frontends/qt4/validators.C b/src/frontends/qt4/validators.C index 34a2e4fa03..e0676ea264 100644 --- a/src/frontends/qt4/validators.C +++ b/src/frontends/qt4/validators.C @@ -109,7 +109,7 @@ string const printable_list(string const & invalid_chars) if (it != begin) ss << ", "; if (*it == ' ') - ss << _("space"); + ss << lyx::to_utf8(_("space")); else ss << *it; } @@ -138,8 +138,8 @@ QValidator::State PathValidator::validate(QString & qtext, int &) const static int counter = 0; if (counter == 0) { - Alert::error(_("Invalid filename"), - _("LyX does not provide LateX support for file names containing any of these characters:\n") + + Alert::error(lyx::to_utf8(_("Invalid filename")), + lyx::to_utf8(_("LyX does not provide LateX support for file names containing any of these characters:\n")) + printable_list(invalid_chars)); } ++counter; diff --git a/src/gettext.C b/src/gettext.C index ea38cc88e9..ec1ea63252 100644 --- a/src/gettext.C +++ b/src/gettext.C @@ -20,8 +20,10 @@ # include #endif -using std::string; using lyx::support::setEnv; +using lyx::docstring; + +using std::string; namespace { @@ -36,9 +38,9 @@ Messages & getLyXMessages() } // anon namespace -string const _(string const & str) +docstring const _(string const & str) { - return lyx::to_utf8(getLyXMessages().get(str)); + return getLyXMessages().get(str); } diff --git a/src/gettext.h b/src/gettext.h index 7cb097af48..eaddb3253a 100644 --- a/src/gettext.h +++ b/src/gettext.h @@ -13,6 +13,8 @@ #ifndef GETTEXT_H #define GETTEXT_H +#include "support/docstring.h" + #include /* @@ -47,7 +49,7 @@ //#ifdef ENABLE_NLS /// -std::string const _(std::string const &); +lyx::docstring const _(std::string const &); //#else // ENABLE_NLS diff --git a/src/importer.C b/src/importer.C index 3f333515d7..7f627f092b 100644 --- a/src/importer.C +++ b/src/importer.C @@ -42,7 +42,7 @@ bool Importer::Import(LyXView * lv, string const & filename, string const & format, ErrorList & errorList) { string const displaypath = makeDisplayPath(filename); - lv->message(bformat(_("Importing %1$s..."), displaypath)); + lv->message(bformat(lyx::to_utf8(_("Importing %1$s...")), displaypath)); string const lyxfile = changeExtension(filename, ".lyx"); @@ -60,8 +60,8 @@ bool Importer::Import(LyXView * lv, string const & filename, } } if (loader_format.empty()) { - Alert::error(_("Couldn't import file"), - bformat(_("No information for importing the format %1$s."), + Alert::error(lyx::to_utf8(_("Couldn't import file")), + bformat(lyx::to_utf8(_("No information for importing the format %1$s.")), formats.prettyName(format))); return false; } @@ -86,7 +86,7 @@ bool Importer::Import(LyXView * lv, string const & filename, } // we are done - lv->message(_("imported.")); + lv->message(lyx::to_utf8(_("imported."))); return true; } diff --git a/src/insets/insetbase.C b/src/insets/insetbase.C index eb7a818ed1..1212ea8c00 100644 --- a/src/insets/insetbase.C +++ b/src/insets/insetbase.C @@ -254,7 +254,8 @@ bool InsetBase::autoDelete() const std::string const InsetBase::editMessage() const { - return _("Opened inset"); + // FIXME UNICODE + return lyx::to_utf8(_("Opened inset")); } diff --git a/src/insets/insetbibtex.C b/src/insets/insetbibtex.C index 834f34981c..7bcb327aef 100644 --- a/src/insets/insetbibtex.C +++ b/src/insets/insetbibtex.C @@ -103,7 +103,8 @@ void InsetBibtex::doDispatch(LCursor & cur, FuncRequest & cmd) string const InsetBibtex::getScreenLabel(Buffer const &) const { - return _("BibTeX Generated Bibliography"); + // FIXME UNICODE + return lyx::to_utf8(_("BibTeX Generated Bibliography")); } @@ -190,9 +191,10 @@ int InsetBibtex::latex(Buffer const & buffer, ostream & os, runparams.nice && db_out.find(' ') != string::npos) { warned_about_spaces = true; - Alert::warning(_("Export Warning!"), - _("There are spaces in the paths to your BibTeX databases.\n" - "BibTeX will be unable to find them.")); + // FIXME UNICODE + Alert::warning(lyx::to_utf8(_("Export Warning!")), + lyx::to_utf8(_("There are spaces in the paths to your BibTeX databases.\n" + "BibTeX will be unable to find them."))); } @@ -241,9 +243,10 @@ int InsetBibtex::latex(Buffer const & buffer, ostream & os, static bool warned_about_bst_spaces = false; if (!warned_about_bst_spaces && runparams.nice && contains(style, ' ')) { warned_about_bst_spaces = true; - Alert::warning(_("Export Warning!"), - _("There are spaces in the path to your BibTeX style file.\n" - "BibTeX will be unable to find it.")); + // FIXME UNICODE + Alert::warning(lyx::to_utf8(_("Export Warning!")), + lyx::to_utf8(_("There are spaces in the path to your BibTeX style file.\n" + "BibTeX will be unable to find it."))); } if (!db_out.empty() && buffer.params().use_bibtopic){ diff --git a/src/insets/insetbox.C b/src/insets/insetbox.C index 7d0a0ad35e..9906caa8af 100644 --- a/src/insets/insetbox.C +++ b/src/insets/insetbox.C @@ -42,7 +42,8 @@ namespace { typedef Translator BoxTranslator; -BoxTranslator const init_boxtranslator() { +BoxTranslator const init_boxtranslator() +{ BoxTranslator translator("Boxed", InsetBox::Boxed); translator.addPair("Frameless", InsetBox::Frameless); translator.addPair("ovalbox", InsetBox::ovalbox); @@ -53,24 +54,28 @@ BoxTranslator const init_boxtranslator() { } -BoxTranslator const init_boxtranslator_loc() { - BoxTranslator translator(_("Boxed"), InsetBox::Boxed); - translator.addPair(_("Frameless"), InsetBox::Frameless); - translator.addPair(_("ovalbox"), InsetBox::ovalbox); - translator.addPair(_("Ovalbox"), InsetBox::Ovalbox); - translator.addPair(_("Shadowbox"), InsetBox::Shadowbox); - translator.addPair(_("Doublebox"), InsetBox::Doublebox); +BoxTranslator const init_boxtranslator_loc() +{ + // FIXME UNICODE + BoxTranslator translator(lyx::to_utf8(_("Boxed")), InsetBox::Boxed); + translator.addPair(lyx::to_utf8(_("Frameless")), InsetBox::Frameless); + translator.addPair(lyx::to_utf8(_("ovalbox")), InsetBox::ovalbox); + translator.addPair(lyx::to_utf8(_("Ovalbox")), InsetBox::Ovalbox); + translator.addPair(lyx::to_utf8(_("Shadowbox")), InsetBox::Shadowbox); + translator.addPair(lyx::to_utf8(_("Doublebox")), InsetBox::Doublebox); return translator; } -BoxTranslator const & boxtranslator() { +BoxTranslator const & boxtranslator() +{ static BoxTranslator translator = init_boxtranslator(); return translator; } -BoxTranslator const & boxtranslator_loc() { +BoxTranslator const & boxtranslator_loc() +{ static BoxTranslator translator = init_boxtranslator_loc(); return translator; } @@ -113,7 +118,7 @@ auto_ptr InsetBox::doClone() const string const InsetBox::editMessage() const { - return _("Opened Box Inset"); + return lyx::to_utf8(_("Opened Box Inset")); } @@ -139,13 +144,21 @@ void InsetBox::setButtonLabel() font.decSize(); BoxType btype = boxtranslator().find(params_.type); + + string label; + // FIXME UNICODE + label += lyx::to_utf8(_("Box")); + label += " ("; if (btype == Frameless) { if (params_.use_parbox) - setLabel(_("Box") + " (" + _("Parbox") + ")"); + label += lyx::to_utf8(_("Parbox")); else - setLabel(_("Box") + " (" + _("Minipage") + ")"); + label += lyx::to_utf8(_("Minipage")); } else - setLabel(_("Box") + " (" + boxtranslator_loc().find(btype) + ")"); + label += boxtranslator_loc().find(btype); + label += ")"; + + setLabel(label); font.setColor(LColor::foreground); setBackgroundColor(LColor::background); diff --git a/src/insets/insetbranch.C b/src/insets/insetbranch.C index ceadb32346..5c3b6a303c 100644 --- a/src/insets/insetbranch.C +++ b/src/insets/insetbranch.C @@ -69,7 +69,8 @@ auto_ptr InsetBranch::doClone() const string const InsetBranch::editMessage() const { - return _("Opened Branch Inset"); + // FIXME UNICODE + return lyx::to_utf8(_("Opened Branch Inset")); } @@ -94,13 +95,15 @@ void InsetBranch::setButtonLabel() font.decSize(); font.decSize(); - string s = _("Branch: ") + params_.branch; + // FIXME UNICODE + string s = lyx::to_utf8(_("Branch: ")) + params_.branch; font.setColor(LColor::foreground); if (!params_.branch.empty()) { LColor_color c = lcolor.getFromLyXName(params_.branch); if (c == LColor::none) { c = LColor::error; - s = _("Undef: ") + s; + // FIXME UNICODE + s = lyx::to_utf8(_("Undef: ")) + s; } setBackgroundColor(c); } else diff --git a/src/insets/insetcaption.C b/src/insets/insetcaption.C index 12ab885106..004e6d9d14 100644 --- a/src/insets/insetcaption.C +++ b/src/insets/insetcaption.C @@ -77,7 +77,8 @@ void InsetCaption::read(Buffer const & buf, LyXLex & lex) string const InsetCaption::editMessage() const { - return _("Opened Caption Inset"); + // FIXME UNICODE + return lyx::to_utf8(_("Opened Caption Inset")); } @@ -93,7 +94,7 @@ void InsetCaption::setLabel(LCursor & cur) const { // Set caption label _only_ if the cursor is in _this_ float: if (cur.top().text() == &text_) { - string s; + string s; size_t i = cur.depth(); while (i > 0) { --i; @@ -109,11 +110,11 @@ void InsetCaption::setLabel(LCursor & cur) const string num; if (s.empty()) s = "Senseless"; - else + else num = convert(counter_); // Generate the label - label = bformat("%1$s %2$s:", _(s), num); + label = bformat("%1$s %2$s:", lyx::to_utf8(_(s)), num); } } @@ -123,7 +124,7 @@ void InsetCaption::metrics(MetricsInfo & mi, Dimension & dim) const mi.base.textwidth -= 2 * TEXT_TO_INSET_OFFSET; LCursor cur = mi.base.bv->cursor(); setLabel(cur); - docstring dlab(label.begin(), label.end()); + docstring dlab(label.begin(), label.end()); labelwidth_ = font_metrics::width(dlab, mi.base.font); dim.wid = labelwidth_; Dimension textdim; @@ -151,7 +152,7 @@ void InsetCaption::draw(PainterInfo & pi, int x, int y) const // belongs to. LCursor cur = pi.base.bv->cursor(); setLabel(cur); - docstring dlab(label.begin(), label.end()); + docstring dlab(label.begin(), label.end()); labelwidth_ = font_metrics::width(dlab, pi.base.font); pi.pain.text(x, y, dlab, pi.base.font); InsetText::draw(pi, x + labelwidth_, y); diff --git a/src/insets/insetcaption.h b/src/insets/insetcaption.h index 13ee45dc56..29383105f6 100644 --- a/src/insets/insetcaption.h +++ b/src/insets/insetcaption.h @@ -29,13 +29,13 @@ public: /// virtual bool display() const; /// - virtual bool neverIndent() const { return true; } + virtual bool neverIndent() const { return true; } /// virtual InsetBase::Code lyxCode() const; /// virtual std::string const editMessage() const; /// - virtual void cursorPos + virtual void cursorPos (CursorSlice const & sl, bool boundary, int & x, int & y) const; /// bool descendable() const { return true; } diff --git a/src/insets/insetcharstyle.C b/src/insets/insetcharstyle.C index e2b0a65098..e6a6de1e83 100644 --- a/src/insets/insetcharstyle.C +++ b/src/insets/insetcharstyle.C @@ -116,7 +116,8 @@ void InsetCharStyle::setDefined(CharStyles::iterator cs) string const InsetCharStyle::editMessage() const { - return _("Opened CharStyle Inset"); + // FIXME UNICODE + return lyx::to_utf8(_("Opened CharStyle Inset")); } @@ -154,8 +155,9 @@ void InsetCharStyle::metrics(MetricsInfo & mi, Dimension & dim) const int d = 0; string s(params_.type); if (undefined()) - s = _("Undef: ") + s; - docstring ds(s.begin(), s.end()); + // FIXME UNICODE + s = lyx::to_utf8(_("Undef: ")) + s; + docstring ds(s.begin(), s.end()); font_metrics::rectText(ds, font, w, a, d); dim.wid = max(dim.wid, w); } @@ -201,8 +203,9 @@ void InsetCharStyle::draw(PainterInfo & pi, int x, int y) const int d = 0; string s(params_.type); if (undefined()) - s = _("Undef: ") + s; - docstring ds(s.begin(), s.end()); + // FIXME UNICODE + s = lyx::to_utf8(_("Undef: ")) + s; + docstring ds(s.begin(), s.end()); font_metrics::rectText(ds, font, w, a, d); pi.pain.rectText(x + (dim_.wid - w) / 2, y + desc + a, ds, font, LColor::none, LColor::none); diff --git a/src/insets/insetenv.C b/src/insets/insetenv.C index 478d2a9f35..58fd9b333f 100644 --- a/src/insets/insetenv.C +++ b/src/insets/insetenv.C @@ -62,7 +62,8 @@ void InsetEnvironment::read(Buffer const & buf, LyXLex & lex) string const InsetEnvironment::editMessage() const { - return _("Opened Environment Inset: ") + getInsetName(); + // FIXME UNICODE + return lyx::to_utf8(_("Opened Environment Inset: ")) + getInsetName(); } diff --git a/src/insets/insetert.C b/src/insets/insetert.C index d3fdd4797d..74ab9af3e8 100644 --- a/src/insets/insetert.C +++ b/src/insets/insetert.C @@ -139,7 +139,8 @@ void InsetERT::read(Buffer const & buf, LyXLex & lex) string const InsetERT::editMessage() const { - return _("Opened ERT Inset"); + // FIXME UNICODE + return lyx::to_utf8(_("Opened ERT Inset")); } @@ -382,7 +383,8 @@ bool InsetERT::getStatus(LCursor & cur, FuncRequest const & cmd, void InsetERT::setButtonLabel() { - setLabel(isOpen() ? _("ERT") : getNewLabel(_("ERT"))); + // FIXME UNICODE + setLabel(isOpen() ? lyx::to_utf8(_("ERT")) : getNewLabel(lyx::to_utf8(_("ERT")))); } diff --git a/src/insets/insetexternal.C b/src/insets/insetexternal.C index 322426f32f..8f1eca6016 100644 --- a/src/insets/insetexternal.C +++ b/src/insets/insetexternal.C @@ -576,7 +576,8 @@ string const getScreenLabel(InsetExternalParams const & params, external::Template const * const ptr = external::getTemplatePtr(params); if (!ptr) - return support::bformat(_("External template %1$s is not installed"), + // FIXME UNICODE + return support::bformat(lyx::to_utf8(_("External template %1$s is not installed")), params.templatename()); return external::doSubstitution(params, buffer, ptr->guiName, false); } diff --git a/src/insets/insetfloat.C b/src/insets/insetfloat.C index 3bf973bf64..a9c48303c1 100644 --- a/src/insets/insetfloat.C +++ b/src/insets/insetfloat.C @@ -122,7 +122,8 @@ string floatname(string const & type, BufferParams const & bp) if (it == floats.end()) return type; - return _(it->second.name()); + // FIXME UNICODE + return lyx::to_utf8(_(it->second.name())); } } // namespace anon @@ -131,7 +132,8 @@ string floatname(string const & type, BufferParams const & bp) InsetFloat::InsetFloat(BufferParams const & bp, string const & type) : InsetCollapsable(bp) { - setLabel(_("float: ") + floatname(type, bp)); + // FIXME UNICODE + setLabel(lyx::to_utf8(_("float: ")) + floatname(type, bp)); LyXFont font(LyXFont::ALL_SANE); font.decSize(); font.decSize(); @@ -288,7 +290,8 @@ auto_ptr InsetFloat::doClone() const string const InsetFloat::editMessage() const { - return _("Opened Float Inset"); + // FIXME UNICODE + return lyx::to_utf8(_("Opened Float Inset")); } @@ -371,7 +374,8 @@ bool InsetFloat::showInsetDialog(BufferView * bv) const void InsetFloat::wide(bool w, BufferParams const & bp) { params_.wide = w; - string lab = _("float: ") + floatname(params_.type, bp); + // FIXME UNICODE + string lab = lyx::to_utf8(_("float: ")) + floatname(params_.type, bp); if (params_.wide) lab += '*'; setLabel(lab); @@ -381,9 +385,10 @@ void InsetFloat::wide(bool w, BufferParams const & bp) void InsetFloat::sideways(bool s, BufferParams const & bp) { params_.sideways = s; - string lab = _("float: ") + floatname(params_.type, bp); + // FIXME UNICODE + string lab = lyx::to_utf8(_("float: ")) + floatname(params_.type, bp); if (params_.sideways) - lab += _(" (sideways)"); + lab += lyx::to_utf8(_(" (sideways)")); setLabel(lab); } diff --git a/src/insets/insetfloatlist.C b/src/insets/insetfloatlist.C index 6789066f19..bdc7312244 100644 --- a/src/insets/insetfloatlist.C +++ b/src/insets/insetfloatlist.C @@ -54,7 +54,8 @@ string const InsetFloatList::getScreenLabel(Buffer const & buf) const // FIXME UNICODE return lyx::to_utf8(buf.B_(it->second.listName())); else - return _("ERROR: Nonexistent float type!"); + // FIXME UNICODE + return lyx::to_utf8(_("ERROR: Nonexistent float type!")); } @@ -118,8 +119,9 @@ int InsetFloatList::latex(Buffer const & buf, ostream & os, << lyx::to_utf8(buf.B_(cit->second.listName())) << "}\n"; } } else { + // FIXME UNICODE os << "%%\\listof{" << getCmdName() << "}{" - << bformat(_("List of %1$s"), cit->second.name()) + << bformat(lyx::to_utf8(_("List of %1$s")), cit->second.name()) << "}\n"; } return 1; diff --git a/src/insets/insetfoot.C b/src/insets/insetfoot.C index 0ed4db0936..cacf06c352 100644 --- a/src/insets/insetfoot.C +++ b/src/insets/insetfoot.C @@ -32,7 +32,8 @@ using std::ostream; InsetFoot::InsetFoot(BufferParams const & bp) : InsetFootlike(bp) { - setLabel(_("foot")); + // FIXME UNICODE + setLabel(lyx::to_utf8(_("foot"))); setInsetName("Foot"); } @@ -40,7 +41,8 @@ InsetFoot::InsetFoot(BufferParams const & bp) InsetFoot::InsetFoot(InsetFoot const & in) : InsetFootlike(in) { - setLabel(_("foot")); + // FIXME UNICODE + setLabel(lyx::to_utf8(_("foot"))); setInsetName("Foot"); } @@ -53,7 +55,8 @@ auto_ptr InsetFoot::doClone() const string const InsetFoot::editMessage() const { - return _("Opened Footnote Inset"); + // FIXME UNICODE + return lyx::to_utf8(_("Opened Footnote Inset")); } diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index 834543491c..e3ad40f403 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -471,9 +471,10 @@ copyFileIfNeeded(string const & file_in, string const & file_out) Mover const & mover = movers(formats.getFormatFromFile(file_in)); bool const success = mover.copy(file_in, file_out); if (!success) { + // FIXME UNICODE lyxerr[Debug::GRAPHICS] - << support::bformat(_("Could not copy the file\n%1$s\n" - "into the temporary directory."), + << support::bformat(lyx::to_utf8(_("Could not copy the file\n%1$s\n" + "into the temporary directory.")), file_in) << std::endl; } @@ -558,7 +559,7 @@ string const InsetGraphics::prepareFile(Buffer const & buf, string const orig_file = params().filename.absFilename(); string const rel_file = params().filename.relFilename(buf.filePath()); - // previewing source code, no file copying or file format conversion + // previewing source code, no file copying or file format conversion if (runparams.dryrun) return stripExtensionIfPossible(rel_file); @@ -703,8 +704,9 @@ string const InsetGraphics::prepareFile(Buffer const & buf, // Do we need to perform the conversion? // Yes if to_file does not exist or if temp_file is newer than to_file if (compare_timestamps(temp_file, to_file) < 0) { + // FIXME UNICODE lyxerr[Debug::GRAPHICS] - << bformat(_("No conversion of %1$s is needed after all"), + << bformat(lyx::to_utf8(_("No conversion of %1$s is needed after all")), rel_file) << std::endl; runparams.exportdata->addExternalFile(tex_format, to_file, @@ -810,7 +812,8 @@ int InsetGraphics::plaintext(Buffer const &, ostream & os, // 1. Convert file to ascii using gifscii // 2. Read ascii output file and add it to the output stream. // at least we send the filename - os << '<' << bformat(_("Graphics file: %1$s"), + // FIXME UNICODE + os << '<' << bformat(lyx::to_utf8(_("Graphics file: %1$s")), params().filename.absFilename()) << ">\n"; return 0; } diff --git a/src/insets/insetinclude.C b/src/insets/insetinclude.C index 9b991c139f..7d7cc36f95 100644 --- a/src/insets/insetinclude.C +++ b/src/insets/insetinclude.C @@ -53,6 +53,7 @@ #include +using lyx::docstring; using lyx::support::addName; using lyx::support::absolutePath; using lyx::support::bformat; @@ -277,23 +278,32 @@ void InsetInclude::read(LyXLex & lex) string const InsetInclude::getScreenLabel(Buffer const &) const { - string temp; + docstring temp; switch (type(params_)) { - case INPUT: temp += _("Input"); break; - case VERB: temp += _("Verbatim Input"); break; - case VERBAST: temp += _("Verbatim Input*"); break; - case INCLUDE: temp += _("Include"); break; + case INPUT: + temp += _("Input"); + break; + case VERB: + temp += _("Verbatim Input"); + break; + case VERBAST: + temp += _("Verbatim Input*"); + break; + case INCLUDE: + temp += _("Include"); + break; } - temp += ": "; + temp += lyx::from_ascii(": "); if (params_.getContents().empty()) - temp += "???"; + temp += lyx::from_ascii("???"); else - temp += onlyFilename(params_.getContents()); + temp += lyx::from_ascii(onlyFilename(params_.getContents())); - return temp; + // FIXME UNICODE + return lyx::to_utf8(temp); } @@ -379,13 +389,14 @@ int InsetInclude::latex(Buffer const & buffer, ostream & os, Buffer * tmp = bufferlist.getBuffer(included_file); if (tmp->params().textclass != m_buffer->params().textclass) { - string text = bformat(_("Included file `%1$s'\n" + // FIXME UNICODE + string text = bformat(lyx::to_utf8(_("Included file `%1$s'\n" "has textclass `%2$s'\n" - "while parent file has textclass `%3$s'."), + "while parent file has textclass `%3$s'.")), makeDisplayPath(included_file), tmp->params().getLyXTextClass().name(), m_buffer->params().getLyXTextClass().name()); - Alert::warning(_("Different textclasses"), text); + Alert::warning(lyx::to_utf8(_("Different textclasses")), text); //return 0; } @@ -410,9 +421,10 @@ int InsetInclude::latex(Buffer const & buffer, ostream & os, if (checksum_in != checksum_out) { if (!copy(included_file, writefile)) { + // FIXME UNICODE lyxerr[Debug::LATEX] - << bformat(_("Could not copy the file\n%1$s\n" - "into the temporary directory."), + << bformat(lyx::to_utf8(_("Could not copy the file\n%1$s\n" + "into the temporary directory.")), included_file) << endl; return 0; diff --git a/src/insets/insetindex.C b/src/insets/insetindex.C index 04b954e99f..f067231148 100644 --- a/src/insets/insetindex.C +++ b/src/insets/insetindex.C @@ -36,7 +36,8 @@ InsetIndex::InsetIndex(InsetCommandParams const & p) string const InsetIndex::getScreenLabel(Buffer const &) const { - return _("Idx"); + // FIXME UNICODE + return lyx::to_utf8(_("Idx")); } @@ -68,7 +69,8 @@ InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p) string const InsetPrintIndex::getScreenLabel(Buffer const &) const { - return _("Index"); + // FIXME UNICODE + return lyx::to_utf8(_("Index")); } diff --git a/src/insets/insetmarginal.C b/src/insets/insetmarginal.C index 08fc084e68..f6e69e6a33 100644 --- a/src/insets/insetmarginal.C +++ b/src/insets/insetmarginal.C @@ -27,7 +27,8 @@ using std::ostream; InsetMarginal::InsetMarginal(BufferParams const & bp) : InsetFootlike(bp) { - setLabel(_("margin")); + // FIXME UNICODE + setLabel(lyx::to_utf8(_("margin"))); setInsetName("Marginal"); } @@ -35,7 +36,8 @@ InsetMarginal::InsetMarginal(BufferParams const & bp) InsetMarginal::InsetMarginal(InsetMarginal const & in) : InsetFootlike(in) { - setLabel(_("margin")); + // FIXME UNICODE + setLabel(lyx::to_utf8(_("margin"))); setInsetName("Marginal"); } @@ -48,7 +50,8 @@ auto_ptr InsetMarginal::doClone() const string const InsetMarginal::editMessage() const { - return _("Opened Marginal Note Inset"); + // FIXME UNICODE + return lyx::to_utf8(_("Opened Marginal Note Inset")); } diff --git a/src/insets/insetnote.C b/src/insets/insetnote.C index 4b1d9c2eb5..4f9dd7114f 100644 --- a/src/insets/insetnote.C +++ b/src/insets/insetnote.C @@ -45,7 +45,8 @@ namespace { typedef Translator NoteTranslator; -NoteTranslator const init_notetranslator() { +NoteTranslator const init_notetranslator() +{ NoteTranslator translator("Note", InsetNoteParams::Note); translator.addPair("Comment", InsetNoteParams::Comment); translator.addPair("Greyedout", InsetNoteParams::Greyedout); @@ -55,23 +56,27 @@ NoteTranslator const init_notetranslator() { } -NoteTranslator const init_notetranslator_loc() { - NoteTranslator translator(_("Note"), InsetNoteParams::Note); - translator.addPair(_("Comment"), InsetNoteParams::Comment); - translator.addPair(_("Greyed out"), InsetNoteParams::Greyedout); - translator.addPair(_("Framed"), InsetNoteParams::Framed); - translator.addPair(_("Shaded"), InsetNoteParams::Shaded); +NoteTranslator const init_notetranslator_loc() +{ + // FIXME UNICODE + NoteTranslator translator(lyx::to_utf8(_("Note")), InsetNoteParams::Note); + translator.addPair(lyx::to_utf8(_("Comment")), InsetNoteParams::Comment); + translator.addPair(lyx::to_utf8(_("Greyed out")), InsetNoteParams::Greyedout); + translator.addPair(lyx::to_utf8(_("Framed")), InsetNoteParams::Framed); + translator.addPair(lyx::to_utf8(_("Shaded")), InsetNoteParams::Shaded); return translator; } -NoteTranslator const & notetranslator() { +NoteTranslator const & notetranslator() +{ static NoteTranslator translator = init_notetranslator(); return translator; } -NoteTranslator const & notetranslator_loc() { +NoteTranslator const & notetranslator_loc() +{ static NoteTranslator translator = init_notetranslator_loc(); return translator; } @@ -138,7 +143,8 @@ auto_ptr InsetNote::doClone() const string const InsetNote::editMessage() const { - return _("Opened Note Inset"); + // FIXME UNICODE + return lyx::to_utf8(_("Opened Note Inset")); } @@ -349,7 +355,7 @@ void InsetNote::validate(LaTeXFeatures & features) const if (params_.type == InsetNoteParams::Shaded) { features.require("color"); features.require("framed"); - } + } if (params_.type == InsetNoteParams::Framed) features.require("framed"); InsetText::validate(features); diff --git a/src/insets/insetoptarg.C b/src/insets/insetoptarg.C index 2954dbe648..9c5db9df4c 100644 --- a/src/insets/insetoptarg.C +++ b/src/insets/insetoptarg.C @@ -31,7 +31,8 @@ InsetOptArg::InsetOptArg(BufferParams const & ins) LyXFont font(LyXFont::ALL_SANE); font.setColor(LColor::collapsable); setLabelFont(font); - setLabel(_("opt")); + // FIXME UNICODE + setLabel(lyx::to_utf8(_("opt"))); } @@ -41,7 +42,8 @@ InsetOptArg::InsetOptArg(InsetOptArg const & in) LyXFont font(LyXFont::ALL_SANE); font.setColor(LColor::collapsable); setLabelFont(font); - setLabel(_("opt")); + // FIXME UNICODE + setLabel(lyx::to_utf8(_("opt"))); } @@ -53,7 +55,8 @@ auto_ptr InsetOptArg::doClone() const string const InsetOptArg::editMessage() const { - return _("Opened Optional Argument Inset"); + // FIXME UNICODE + return lyx::to_utf8(_("Opened Optional Argument Inset")); } diff --git a/src/insets/insetpagebreak.C b/src/insets/insetpagebreak.C index e620c76ec0..7c4b3d56e0 100644 --- a/src/insets/insetpagebreak.C +++ b/src/insets/insetpagebreak.C @@ -51,7 +51,7 @@ void InsetPagebreak::metrics(MetricsInfo & mi, Dimension & dim) const void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const { - static std::string const label = _("Page Break"); + static docstring const label = _("Page Break"); LyXFont font; font.setColor(LColor::pagebreak); @@ -60,13 +60,12 @@ void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const int w = 0; int a = 0; int d = 0; - docstring dlab(label.begin(), label.end()); - font_metrics::rectText(dlab, font, w, a, d); + font_metrics::rectText(label, font, w, a, d); int const text_start = int(x + (dim_.wid - w) / 2); int const text_end = text_start + w; - pi.pain.rectText(text_start, y + d, dlab, font, + pi.pain.rectText(text_start, y + d, label, font, LColor::none, LColor::none); pi.pain.line(x, y, text_start, y, diff --git a/src/insets/insetref.C b/src/insets/insetref.C index 706a7dc2b8..fa8fe76dd1 100644 --- a/src/insets/insetref.C +++ b/src/insets/insetref.C @@ -69,7 +69,8 @@ string const InsetRef::getScreenLabel(Buffer const &) const string temp; for (int i = 0; !types[i].latex_name.empty(); ++i) { if (getCmdName() == types[i].latex_name) { - temp = _(types[i].short_gui_name); + // FIXME UNIOCDE + temp = lyx::to_utf8(_(types[i].short_gui_name)); break; } } diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index 055ca76456..0460ae1124 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -279,7 +279,7 @@ void InsetTabular::metrics(MetricsInfo & mi, Dimension & dim) const tabular.setWidthOfCell(cell, dim.wid); if (p_width.zero()) { m.base.textwidth = dim.wid + 2 * ADD_TO_TABULAR_WIDTH; - // FIXME there must be a way to get rid of + // FIXME there must be a way to get rid of // the second metrics call tabular.getCellInset(cell)->metrics(m, dim); } @@ -451,7 +451,8 @@ void InsetTabular::drawCellLines(Painter & pain, int x, int y, string const InsetTabular::editMessage() const { - return _("Opened table"); + // FIXME UNICODE + return lyx::to_utf8(_("Opened table")); } @@ -494,7 +495,7 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd) case LFUN_MOUSE_PRESS: //lyxerr << "# InsetTabular::MousePress\n" << cur.bv().cursor() << endl; - if (cmd.button() == mouse_button::button1 + if (cmd.button() == mouse_button::button1 || cmd.button() == mouse_button::button3) { cur.selection() = false; setCursorFromCoordinates(cur, cmd.x, cmd.y); @@ -979,11 +980,11 @@ bool InsetTabular::getStatus(LCursor & cur, FuncRequest const & cmd, case LyXTabular::SET_LTNEWPAGE: status.setOnOff(tabular.getLTNewPage(sel_row_start)); break; - + case LyXTabular::SET_BOOKTABS: status.setOnOff(tabular.useBookTabs()); break; - + case LyXTabular::UNSET_BOOKTABS: status.setOnOff(!tabular.useBookTabs()); break; @@ -1163,7 +1164,7 @@ int InsetTabular::dist(idx_type const cell, int x, int y) const int const xend = xbeg + tabular.getWidthOfColumn(cell); row_type const row = tabular.row_of_cell(cell); int const ybeg = o.y_ - tabular.getAscentOfRow(row) - - tabular.getAdditionalHeight(row); + tabular.getAdditionalHeight(row); int const yend = o.y_ + tabular.getDescentOfRow(row); if (x < xbeg) @@ -1557,8 +1558,9 @@ void InsetTabular::tabularFeatures(LCursor & cur, #ifdef WITH_WARNINGS #warning Need I say it ? This is horrible. #endif - Alert::error(_("Error setting multicolumn"), - _("You cannot set multicolumn vertically.")); + // FIXME UNICODE + Alert::error(lyx::to_utf8(_("Error setting multicolumn")), + lyx::to_utf8(_("You cannot set multicolumn vertically."))); return; } if (!cur.selection()) { diff --git a/src/insets/insettext.C b/src/insets/insettext.C index e3ef6234c2..0acd4dd3dc 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -208,7 +208,7 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const int const w = text_.width() + 2 * border_; int const a = text_.ascent() + border_; int const h = a + text_.descent() + border_; - pi.pain.rectangle(x, y - a, (Wide() ? text_.maxwidth_ : w), h, + pi.pain.rectangle(x, y - a, (Wide() ? text_.maxwidth_ : w), h, frameColor()); } } @@ -219,7 +219,7 @@ void InsetText::drawSelection(PainterInfo & pi, int x, int y) const int const w = text_.width() + 2 * border_; int const a = text_.ascent() + border_; int const h = a + text_.descent() + border_; - pi.pain.fillRectangle(x, y - a, (Wide() ? text_.maxwidth_ : w), h, + pi.pain.fillRectangle(x, y - a, (Wide() ? text_.maxwidth_ : w), h, backgroundColor()); text_.drawSelection(pi, x, y); } @@ -227,7 +227,8 @@ void InsetText::drawSelection(PainterInfo & pi, int x, int y) const string const InsetText::editMessage() const { - return _("Opened Text Inset"); + // FIXME UNICODE + return lyx::to_utf8(_("Opened Text Inset")); } diff --git a/src/insets/insettoc.C b/src/insets/insettoc.C index 8efd2929ed..ea06bf37e8 100644 --- a/src/insets/insettoc.C +++ b/src/insets/insettoc.C @@ -38,9 +38,10 @@ std::auto_ptr InsetTOC::doClone() const string const InsetTOC::getScreenLabel(Buffer const &) const { + // FIXME UNICODE if (getCmdName() == "tableofcontents") - return _("Table of Contents"); - return _("Unknown toc list"); + return lyx::to_utf8(_("Table of Contents")); + return lyx::to_utf8(_("Unknown toc list")); } diff --git a/src/insets/inseturl.C b/src/insets/inseturl.C index e376f42545..b6f5e82d78 100644 --- a/src/insets/inseturl.C +++ b/src/insets/inseturl.C @@ -36,10 +36,11 @@ InsetUrl::InsetUrl(InsetCommandParams const & p) string const InsetUrl::getScreenLabel(Buffer const &) const { string temp; + // FIXME UNICODE if (getCmdName() == "url") - temp = _("Url: "); + temp = lyx::to_utf8(_("Url: ")); else - temp = _("HtmlUrl: "); + temp = lyx::to_utf8(_("HtmlUrl: ")); string url; diff --git a/src/insets/insetvspace.C b/src/insets/insetvspace.C index ee6243b723..ff23de9469 100644 --- a/src/insets/insetvspace.C +++ b/src/insets/insetvspace.C @@ -106,7 +106,8 @@ void InsetVSpace::write(Buffer const &, ostream & os) const string const InsetVSpace::label() const { - static string const label = _("Vertical Space"); + // FIXME UNICODE + static string const label = lyx::to_utf8(_("Vertical Space")); return label + " (" + space_.asGUIName() + ')'; } @@ -129,8 +130,8 @@ void InsetVSpace::metrics(MetricsInfo & mi, Dimension & dim) const int w = 0; int a = 0; int d = 0; - string lab = label(); - docstring dlab(lab.begin(), lab.end()); + string lab = label(); + docstring dlab(lab.begin(), lab.end()); font_metrics::rectText(dlab, font, w, a, d); height = max(height, a + d); @@ -181,8 +182,8 @@ void InsetVSpace::draw(PainterInfo & pi, int x, int y) const font.setColor(LColor::added_space); font.decSize(); font.decSize(); - string lab = label(); - docstring dlab(lab.begin(), lab.end()); + string lab = label(); + docstring dlab(lab.begin(), lab.end()); font_metrics::rectText(dlab, font, w, a, d); pi.pain.rectText(x + 2 * arrow_size + 5, diff --git a/src/insets/insetwrap.C b/src/insets/insetwrap.C index 039155ecf3..0a84d31d1a 100644 --- a/src/insets/insetwrap.C +++ b/src/insets/insetwrap.C @@ -48,7 +48,8 @@ string floatname(string const & type, BufferParams const & bp) { FloatList const & floats = bp.getLyXTextClass().floats(); FloatList::const_iterator it = floats[type]; - return (it == floats.end()) ? type : _(it->second.name()); + // FIXME UNICODE + return (it == floats.end()) ? type : lyx::to_utf8(_(it->second.name())); } } // namespace anon @@ -57,7 +58,8 @@ string floatname(string const & type, BufferParams const & bp) InsetWrap::InsetWrap(BufferParams const & bp, string const & type) : InsetCollapsable(bp) { - setLabel(_("wrap: ") + floatname(type, bp)); + // FIXME UNICODE + setLabel(lyx::to_utf8(_("wrap: ")) + floatname(type, bp)); LyXFont font(LyXFont::ALL_SANE); font.decSize(); font.decSize(); @@ -186,7 +188,8 @@ auto_ptr InsetWrap::doClone() const string const InsetWrap::editMessage() const { - return _("Opened Wrap Inset"); + // FIXME UNICODE + return lyx::to_utf8(_("Opened Wrap Inset")); } diff --git a/src/insets/render_graphic.C b/src/insets/render_graphic.C index a7e2bcb7e4..442d89d5a3 100644 --- a/src/insets/render_graphic.C +++ b/src/insets/render_graphic.C @@ -86,34 +86,50 @@ bool displayGraphic(graphics::Params const & params) string const statusMessage(graphics::Params const & params, graphics::ImageStatus status) { + docstring ret; + if (!displayGraphic(params)) - return _("Not shown."); - - switch (status) { - case graphics::WaitingToLoad: - return _("Not shown."); - case graphics::Loading: - return _("Loading..."); - case graphics::Converting: - return _("Converting to loadable format..."); - case graphics::Loaded: - return _("Loaded into memory. Generating pixmap..."); - case graphics::ScalingEtc: - return _("Scaling etc..."); - case graphics::Ready: - return _("Ready to display"); - case graphics::ErrorNoFile: - return _("No file found!"); - case graphics::ErrorConverting: - return _("Error converting to loadable format"); - case graphics::ErrorLoading: - return _("Error loading file into memory"); - case graphics::ErrorGeneratingPixmap: - return _("Error generating the pixmap"); - case graphics::ErrorUnknown: - return _("No image"); + ret = _("Not shown."); + else { + switch (status) { + case graphics::WaitingToLoad: + ret = _("Not shown."); + break; + case graphics::Loading: + ret = _("Loading..."); + break; + case graphics::Converting: + ret = _("Converting to loadable format..."); + break; + case graphics::Loaded: + ret = _("Loaded into memory. Generating pixmap..."); + break; + case graphics::ScalingEtc: + ret = _("Scaling etc..."); + break; + case graphics::Ready: + ret = _("Ready to display"); + break; + case graphics::ErrorNoFile: + ret = _("No file found!"); + break; + case graphics::ErrorConverting: + ret = _("Error converting to loadable format"); + break; + case graphics::ErrorLoading: + ret = _("Error loading file into memory"); + break; + case graphics::ErrorGeneratingPixmap: + ret = _("Error generating the pixmap"); + break; + case graphics::ErrorUnknown: + ret = _("No image"); + break; + } } - return string(); + + // FIXME UNICODE + return lyx::to_utf8(ret); } @@ -144,7 +160,7 @@ void RenderGraphic::metrics(MetricsInfo & mi, Dimension & dim) const msgFont.setFamily(LyXFont::SANS_FAMILY); string const justname = onlyFilename(params_.filename); - docstring djust(justname.begin(), justname.end()); + docstring djust(justname.begin(), justname.end()); if (!justname.empty()) { msgFont.setSize(LyXFont::SIZE_FOOTNOTE); font_width = font_metrics::width(djust, msgFont); @@ -152,7 +168,7 @@ void RenderGraphic::metrics(MetricsInfo & mi, Dimension & dim) const string const msg = statusMessage(params_, loader_.status()); if (!msg.empty()) { - docstring dmsg(msg.begin(), msg.end()); + docstring dmsg(msg.begin(), msg.end()); msgFont.setSize(LyXFont::SIZE_TINY); font_width = std::max(font_width, font_metrics::width(dmsg, msgFont)); @@ -197,7 +213,7 @@ void RenderGraphic::draw(PainterInfo & pi, int x, int y) const string const justname = onlyFilename(params_.filename); if (!justname.empty()) { - docstring djust(justname.begin(), justname.end()); + docstring djust(justname.begin(), justname.end()); msgFont.setSize(LyXFont::SIZE_FOOTNOTE); pi.pain.text(x + InsetOld::TEXT_TO_INSET_OFFSET + 6, y - font_metrics::maxAscent(msgFont) - 4, @@ -207,7 +223,7 @@ void RenderGraphic::draw(PainterInfo & pi, int x, int y) const // Print the message. string const msg = statusMessage(params_, loader_.status()); if (!msg.empty()) { - docstring dmsg(msg.begin(), msg.end()); + docstring dmsg(msg.begin(), msg.end()); msgFont.setSize(LyXFont::SIZE_TINY); pi.pain.text(x + InsetOld::TEXT_TO_INSET_OFFSET + 6, y - 4, dmsg, msgFont); diff --git a/src/insets/render_preview.C b/src/insets/render_preview.C index 21b4d43d8f..dd61fe7134 100644 --- a/src/insets/render_preview.C +++ b/src/insets/render_preview.C @@ -84,7 +84,7 @@ string const statusMessage(BufferView const * bv, string const & snippet) graphics::PreviewLoader const & loader = getPreviewLoader(buffer); graphics::PreviewLoader::Status const status = loader.status(snippet); - string message; + docstring message; switch (status) { case graphics::PreviewLoader::InQueue: case graphics::PreviewLoader::Processing: @@ -98,7 +98,8 @@ string const statusMessage(BufferView const * bv, string const & snippet) break; } - return message; + // FIXME UNICODE + return lyx::to_utf8(message); } } // namespace anon @@ -130,8 +131,8 @@ void RenderPreview::metrics(MetricsInfo & mi, Dimension & dim) const LyXFont font(mi.base.font); font.setFamily(LyXFont::SANS_FAMILY); font.setSize(LyXFont::SIZE_FOOTNOTE); - string stat = statusMessage(mi.base.bv, snippet_); - docstring dstat(stat.begin(), stat.end()); + string stat = statusMessage(mi.base.bv, snippet_); + docstring dstat(stat.begin(), stat.end()); dim.wid = 15 + font_metrics::width(dstat, font); } @@ -164,8 +165,8 @@ void RenderPreview::draw(PainterInfo & pi, int x, int y) const font.setFamily(LyXFont::SANS_FAMILY); font.setSize(LyXFont::SIZE_FOOTNOTE); - string stat = statusMessage(pi.base.bv, snippet_); - docstring dstat(stat.begin(), stat.end()); + string stat = statusMessage(pi.base.bv, snippet_); + docstring dstat(stat.begin(), stat.end()); pi.pain.text(x + offset + 6, y - font_metrics::maxAscent(font) - 4, dstat, font); diff --git a/src/ispell.C b/src/ispell.C index cdef2fb907..124a1d4bf1 100644 --- a/src/ispell.C +++ b/src/ispell.C @@ -203,14 +203,14 @@ ISpell::ISpell(BufferParams const & params, string const & lang) // This is what happens when goto gets banned. if (pipe(pipein) == -1) { - error_ = _("Can't create pipe for spellchecker."); + error_ = lyx::to_utf8(_("Can't create pipe for spellchecker.")); return; } if (pipe(pipeout) == -1) { close(pipein[0]); close(pipein[1]); - error_ = _("Can't create pipe for spellchecker."); + error_ = lyx::to_utf8(_("Can't create pipe for spellchecker.")); return; } @@ -219,22 +219,22 @@ ISpell::ISpell(BufferParams const & params, string const & lang) close(pipein[1]); close(pipeout[0]); close(pipeout[1]); - error_ = _("Can't create pipe for spellchecker."); + error_ = lyx::to_utf8(_("Can't create pipe for spellchecker.")); return; } if ((out = fdopen(pipein[1], "w")) == 0) { - error_ = _("Can't open pipe for spellchecker."); + error_ = lyx::to_utf8(_("Can't open pipe for spellchecker.")); return; } if ((in = fdopen(pipeout[0], "r")) == 0) { - error_ = _("Can't open pipe for spellchecker."); + error_ = lyx::to_utf8(_("Can't open pipe for spellchecker.")); return; } if ((inerr = fdopen(pipeerr[0], "r")) == 0) { - error_ = _("Can't open pipe for spellchecker."); + error_ = lyx::to_utf8(_("Can't open pipe for spellchecker.")); return; } @@ -243,8 +243,8 @@ ISpell::ISpell(BufferParams const & params, string const & lang) LaunchIspell * li = new LaunchIspell(params, lang, pipein, pipeout, pipeerr); child_.reset(li); if (li->start() == -1) { - error_ = _("Could not create an ispell process.\nYou may not have " - "the right languages installed."); + error_ = lyx::to_utf8(_("Could not create an ispell process.\nYou may not have " + "the right languages installed.")); child_.reset(0); return; } @@ -265,8 +265,8 @@ ISpell::ISpell(BufferParams const & params, string const & lang) error_ = buf; } else { // select returned error - error_ = _("The ispell process returned an error.\nPerhaps " - "it has been configured wrongly ?"); + error_ = lyx::to_utf8(_("The ispell process returned an error.\nPerhaps " + "it has been configured wrongly ?")); } close(pipein[0]); @@ -374,7 +374,7 @@ enum ISpell::Result ISpell::check(WordLangTuple const & word) bool error = select(err_read); if (error) { - error_ = _("Could not communicate with the ispell spellchecker process."); + error_ = lyx::to_utf8(_("Could not communicate with the ispell spellchecker process.")); return UNKNOWN_WORD; } diff --git a/src/kbsequence.C b/src/kbsequence.C index 0d701cdb28..708fb99ee5 100644 --- a/src/kbsequence.C +++ b/src/kbsequence.C @@ -157,7 +157,7 @@ string const kb_sequence::printOptions() const if (!curmap) return buf; - buf += _(" options: "); + buf += lyx::to_utf8(_(" options: ")); buf += curmap->print(); return buf; } diff --git a/src/lyx_cb.C b/src/lyx_cb.C index 7faaa80555..6f8f68012a 100644 --- a/src/lyx_cb.C +++ b/src/lyx_cb.C @@ -110,10 +110,10 @@ bool menuWrite(Buffer * buffer) string const file = makeDisplayPath(buffer->fileName(), 30); - string text = bformat(_("The document %1$s could not be saved.\n\n" - "Do you want to rename the document and try again?"), file); - int const ret = Alert::prompt(_("Rename and save?"), - text, 0, 1, _("&Rename"), _("&Cancel")); + string text = bformat(lyx::to_utf8(_("The document %1$s could not be saved.\n\n" + "Do you want to rename the document and try again?")), file); + int const ret = Alert::prompt(lyx::to_utf8(_("Rename and save?")), + text, 0, 1, lyx::to_utf8(_("&Rename")), lyx::to_utf8(_("&Cancel"))); if (ret == 0) return writeAs(buffer); @@ -129,17 +129,17 @@ bool writeAs(Buffer * buffer, string const & filename) if (filename.empty()) { - FileDialog fileDlg(_("Choose a filename to save document as"), + FileDialog fileDlg(lyx::to_utf8(_("Choose a filename to save document as")), LFUN_BUFFER_WRITE_AS, - make_pair(string(_("Documents|#o#O")), + make_pair(string(lyx::to_utf8(_("Documents|#o#O"))), string(lyxrc.document_path)), - make_pair(string(_("Templates|#T#t")), + make_pair(string(lyx::to_utf8(_("Templates|#T#t"))), string(lyxrc.template_path))); if (!isLyXFilename(fname)) fname += ".lyx"; - FileFilterList const filter (_("LyX Documents (*.lyx)")); + FileFilterList const filter (lyx::to_utf8(_("LyX Documents (*.lyx)"))); FileDialog::Result result = fileDlg.save(onlyPath(fname), @@ -163,10 +163,10 @@ bool writeAs(Buffer * buffer, string const & filename) if (fs::exists(fname)) { string const file = makeDisplayPath(fname, 30); - string text = bformat(_("The document %1$s already exists.\n\n" - "Do you want to over-write that document?"), file); - int const ret = Alert::prompt(_("Over-write document?"), - text, 0, 1, _("&Over-write"), _("&Cancel")); + string text = bformat(lyx::to_utf8(_("The document %1$s already exists.\n\n" + "Do you want to over-write that document?")), file); + int const ret = Alert::prompt(lyx::to_utf8(_("Over-write document?")), + text, 0, 1, lyx::to_utf8(_("&Over-write")), lyx::to_utf8(_("&Cancel"))); if (ret == 1) return false; @@ -212,9 +212,9 @@ void quitLyX(bool noask) if (!destroyDir(package().temp_dir())) { string const msg = - bformat(_("Unable to remove the temporary directory %1$s"), + bformat(lyx::to_utf8(_("Unable to remove the temporary directory %1$s")), package().temp_dir()); - Alert::warning(_("Unable to remove temporary directory"), msg); + Alert::warning(lyx::to_utf8(_("Unable to remove temporary directory")), msg); } lyx_gui::exit(0); @@ -246,7 +246,7 @@ private: int AutoSaveBuffer::start() { - command_ = bformat(_("Auto-saving %1$s"), fname_); + command_ = bformat(lyx::to_utf8(_("Auto-saving %1$s")), fname_); return run(DontWait); } @@ -286,7 +286,7 @@ int AutoSaveBuffer::generateChild() // but safe in the parent, so... if (pid == -1) // emit message signal. - bv_.buffer()->message(_("Autosave failed!")); + bv_.buffer()->message(lyx::to_utf8(_("Autosave failed!"))); } } if (pid == 0) { // we are the child so... @@ -313,7 +313,7 @@ void autoSave(BufferView * bv) } // emit message signal. - bv->buffer()->message(_("Autosaving current document...")); + bv->buffer()->message(lyx::to_utf8(_("Autosaving current document..."))); // create autosave filename string fname = bv->buffer()->filePath(); @@ -379,7 +379,7 @@ string getContentsOfAsciiFile(BufferView * bv, string const & f, bool asParagrap string fname = f; if (fname.empty()) { - FileDialog fileDlg(_("Select file to insert"), + FileDialog fileDlg(lyx::to_utf8(_("Select file to insert")), (asParagraph) ? LFUN_FILE_INSERT_ASCII_PARA : LFUN_FILE_INSERT_ASCII); FileDialog::Result result = @@ -398,9 +398,9 @@ string getContentsOfAsciiFile(BufferView * bv, string const & f, bool asParagrap if (!fs::is_readable(fname)) { string const error = strerror(errno); string const file = makeDisplayPath(fname, 50); - string const text = bformat(_("Could not read the specified document\n" - "%1$s\ndue to the error: %2$s"), file, error); - Alert::error(_("Could not read file"), text); + string const text = bformat(lyx::to_utf8(_("Could not read the specified document\n" + "%1$s\ndue to the error: %2$s")), file, error); + Alert::error(lyx::to_utf8(_("Could not read file")), text); return string(); } @@ -408,9 +408,9 @@ string getContentsOfAsciiFile(BufferView * bv, string const & f, bool asParagrap if (!ifs) { string const error = strerror(errno); string const file = makeDisplayPath(fname, 50); - string const text = bformat(_("Could not open the specified document\n" - "%1$s\ndue to the error: %2$s"), file, error); - Alert::error(_("Could not open file"), text); + string const text = bformat(lyx::to_utf8(_("Could not open the specified document\n" + "%1$s\ndue to the error: %2$s")), file, error); + Alert::error(lyx::to_utf8(_("Could not open file")), text); return string(); } @@ -440,7 +440,7 @@ string getContentsOfAsciiFile(BufferView * bv, string const & f, bool asParagrap void reconfigure(BufferView * bv) { // emit message signal. - bv->buffer()->message(_("Running configure...")); + bv->buffer()->message(lyx::to_utf8(_("Running configure..."))); // Run configure in user lyx directory Path p(package().user_support()); @@ -449,13 +449,13 @@ void reconfigure(BufferView * bv) one.startscript(Systemcall::Wait, configure_command); p.pop(); // emit message signal. - bv->buffer()->message(_("Reloading configuration...")); + bv->buffer()->message(lyx::to_utf8(_("Reloading configuration..."))); lyxrc.read(libFileSearch(string(), "lyxrc.defaults")); // Re-read packages.lst LaTeXFeatures::getAvailable(); - Alert::information(_("System reconfigured"), - _("The system has been reconfigured.\n" - "You need to restart LyX to make use of any\n" - "updated document class specifications.")); + Alert::information(lyx::to_utf8(_("System reconfigured")), + lyx::to_utf8(_("The system has been reconfigured.\n" + "You need to restart LyX to make use of any\n" + "updated document class specifications."))); } diff --git a/src/lyx_main.C b/src/lyx_main.C index fdaa60f4bd..16d231b244 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -120,9 +120,9 @@ void lyx_exit(int status) void showFileError(string const & error) { - Alert::warning(_("Could not read configuration file"), - bformat(_("Error while reading the configuration file\n%1$s.\n" - "Please check your installation."), error)); + Alert::warning(lyx::to_utf8(_("Could not read configuration file")), + bformat(lyx::to_utf8(_("Error while reading the configuration file\n%1$s.\n" + "Please check your installation.")), error)); } @@ -130,11 +130,11 @@ void reconfigureUserLyXDir() { string const configure_command = package().configure_command(); - lyxerr << _("LyX: reconfiguring user directory") << endl; + lyxerr << lyx::to_utf8(_("LyX: reconfiguring user directory")) << endl; Path p(package().user_support()); Systemcall one; one.startscript(Systemcall::Wait, configure_command); - lyxerr << "LyX: " << _("Done!") << endl; + lyxerr << "LyX: " << lyx::to_utf8(_("Done!")) << endl; } } // namespace anon @@ -233,7 +233,7 @@ int LyX::exec2(int & argc, char * argv[]) // other than documents for (int argi = 1; argi < argc ; ++argi) { if (argv[argi][0] == '-') { - lyxerr << bformat(_("Wrong command line option `%1$s'. Exiting."), + lyxerr << bformat(lyx::to_utf8(_("Wrong command line option `%1$s'. Exiting.")), argv[argi]) << endl; return EXIT_FAILURE; } @@ -341,7 +341,7 @@ int LyX::exec2(int & argc, char * argv[]) } // create the main window LyXView * view = lyx_gui::create_view(width, height, posx, posy, maximize); - + // load files for_each(files.begin(), files.end(), bind(&LyXView::loadLyXFile, view, _1, true)); @@ -468,7 +468,7 @@ static void error_handler(int err_sig) void LyX::printError(ErrorItem const & ei) { - std::cerr << _("LyX: ") << ei.error + std::cerr << lyx::to_utf8(_("LyX: ")) << ei.error << ':' << ei.description << std::endl; } @@ -518,7 +518,7 @@ bool LyX::init() if (!lyxrc.path_prefix.empty()) prependEnvPath("PATH", lyxrc.path_prefix); - // Check that user LyX directory is ok. + // Check that user LyX directory is ok. if (queryUserLyXDir(package().explicit_user_support())) reconfigureUserLyXDir(); @@ -578,10 +578,10 @@ bool LyX::init() package().temp_dir() = createLyXTmpDir(lyxrc.tempdir_path); if (package().temp_dir().empty()) { - Alert::error(_("Could not create temporary directory"), - bformat(_("Could not create a temporary directory in\n" - "%1$s. Make sure that this\n" - "path exists and is writable and try again."), + Alert::error(lyx::to_utf8(_("Could not create temporary directory")), + bformat(lyx::to_utf8(_("Could not create a temporary directory in\n" + "%1$s. Make sure that this\n" + "path exists and is writable and try again.")), lyxrc.tempdir_path)); // createLyXTmpDir() tries sufficiently hard to create a // usable temp dir, so the probability to come here is @@ -703,7 +703,7 @@ bool needsUpdate(string const & file) addName(package().user_support(), file); return (! fs::exists(absfile)) - || (fs::last_write_time(configure_script) + || (fs::last_write_time(configure_script) > fs::last_write_time(absfile)); } @@ -716,9 +716,9 @@ bool LyX::queryUserLyXDir(bool explicit_userdir) if (fs::exists(package().user_support()) && fs::is_directory(package().user_support())) { first_start = false; - - return needsUpdate("lyxrc.defaults") - || needsUpdate("textclass.lst") + + return needsUpdate("lyxrc.defaults") + || needsUpdate("textclass.lst") || needsUpdate("packages.lst"); } @@ -728,25 +728,25 @@ bool LyX::queryUserLyXDir(bool explicit_userdir) // to create it. If the user says "no", then exit. if (explicit_userdir && Alert::prompt( - _("Missing user LyX directory"), - bformat(_("You have specified a non-existent user " - "LyX directory, %1$s.\n" - "It is needed to keep your own configuration."), + lyx::to_utf8(_("Missing user LyX directory")), + bformat(lyx::to_utf8(_("You have specified a non-existent user " + "LyX directory, %1$s.\n" + "It is needed to keep your own configuration.")), package().user_support()), 1, 0, - _("&Create directory"), - _("&Exit LyX"))) { - lyxerr << _("No user LyX directory. Exiting.") << endl; + lyx::to_utf8(_("&Create directory")), + lyx::to_utf8(_("&Exit LyX")))) { + lyxerr << lyx::to_utf8(_("No user LyX directory. Exiting.")) << endl; lyx_exit(EXIT_FAILURE); } - lyxerr << bformat(_("LyX: Creating directory %1$s"), + lyxerr << bformat(lyx::to_utf8(_("LyX: Creating directory %1$s")), package().user_support()) << endl; if (!createDirectory(package().user_support(), 0755)) { // Failed, so let's exit. - lyxerr << _("Failed to create directory. Exiting.") + lyxerr << lyx::to_utf8(_("Failed to create directory. Exiting.")) << endl; lyx_exit(EXIT_FAILURE); } @@ -902,11 +902,11 @@ typedef boost::function cmd_helper; int parse_dbg(string const & arg, string const &) { if (arg.empty()) { - lyxerr << _("List of supported debug flags:") << endl; + lyxerr << lyx::to_utf8(_("List of supported debug flags:")) << endl; Debug::showTags(lyxerr); exit(0); } - lyxerr << bformat(_("Setting debug level to %1$s"), arg) << endl; + lyxerr << bformat(lyx::to_utf8(_("Setting debug level to %1$s")), arg) << endl; lyxerr.level(Debug::value(arg)); Debug::showLevel(lyxerr, lyxerr.level()); @@ -917,7 +917,7 @@ int parse_dbg(string const & arg, string const &) int parse_help(string const &, string const &) { lyxerr << - _("Usage: lyx [ command line switches ] [ name.lyx ... ]\n" + lyx::to_utf8(_("Usage: lyx [ command line switches ] [ name.lyx ... ]\n" "Command line switches (case sensitive):\n" "\t-help summarize LyX usage\n" "\t-userdir dir set user directory to dir\n" @@ -934,7 +934,7 @@ int parse_help(string const &, string const &) " where fmt is the import format of choice\n" " and file.xxx is the file to be imported.\n" "\t-version summarize version and build info\n" - "Check the LyX man page for more details.") << endl; + "Check the LyX man page for more details.")) << endl; exit(0); return 0; } @@ -953,7 +953,7 @@ int parse_version(string const &, string const &) int parse_sysdir(string const & arg, string const &) { if (arg.empty()) { - lyxerr << _("Missing directory for -sysdir switch") << endl; + lyxerr << lyx::to_utf8(_("Missing directory for -sysdir switch")) << endl; exit(1); } cl_system_support = arg; @@ -963,7 +963,7 @@ int parse_sysdir(string const & arg, string const &) int parse_userdir(string const & arg, string const &) { if (arg.empty()) { - lyxerr << _("Missing directory for -userdir switch") << endl; + lyxerr << lyx::to_utf8(_("Missing directory for -userdir switch")) << endl; exit(1); } cl_user_support = arg; @@ -973,7 +973,7 @@ int parse_userdir(string const & arg, string const &) int parse_execute(string const & arg, string const &) { if (arg.empty()) { - lyxerr << _("Missing command string after --execute switch") << endl; + lyxerr << lyx::to_utf8(_("Missing command string after --execute switch")) << endl; exit(1); } batch = arg; @@ -983,8 +983,8 @@ int parse_execute(string const & arg, string const &) int parse_export(string const & type, string const &) { if (type.empty()) { - lyxerr << _("Missing file type [eg latex, ps...] after " - "--export switch") << endl; + lyxerr << lyx::to_utf8(_("Missing file type [eg latex, ps...] after " + "--export switch")) << endl; exit(1); } batch = "buffer-export " + type; @@ -995,12 +995,12 @@ int parse_export(string const & type, string const &) int parse_import(string const & type, string const & file) { if (type.empty()) { - lyxerr << _("Missing file type [eg latex, ps...] after " - "--import switch") << endl; + lyxerr << lyx::to_utf8(_("Missing file type [eg latex, ps...] after " + "--import switch")) << endl; exit(1); } if (file.empty()) { - lyxerr << _("Missing filename for --import") << endl; + lyxerr << lyx::to_utf8(_("Missing filename for --import")) << endl; exit(1); } diff --git a/src/lyxfind.C b/src/lyxfind.C index 1b0b299e4c..ce3d59b028 100644 --- a/src/lyxfind.C +++ b/src/lyxfind.C @@ -138,7 +138,7 @@ bool findChange(DocIterator & cur) bool searchAllowed(BufferView * bv, string const & str) { if (str.empty()) { - Alert::error(_("Search error"), _("Search string is empty")); + Alert::error(lyx::to_utf8(_("Search error")), lyx::to_utf8(_("Search string is empty"))); return false; } return bv->available(); @@ -289,7 +289,7 @@ void find(BufferView * bv, FuncRequest const & ev) if (!found) // emit message signal. - bv->message(_("String not found!")); + bv->message(lyx::to_utf8(_("String not found!"))); } @@ -320,14 +320,14 @@ void replace(BufferView * bv, FuncRequest const & ev) if (replace_count == 0) { // emit message signal. - buf->message(_("String not found!")); + buf->message(lyx::to_utf8(_("String not found!"))); } else { if (replace_count == 1) { // emit message signal. - buf->message(_("String has been replaced.")); + buf->message(lyx::to_utf8(_("String has been replaced."))); } else { string str = convert(replace_count); - str += _(" strings have been replaced."); + str += lyx::to_utf8(_(" strings have been replaced.")); // emit message signal. buf->message(str); } diff --git a/src/lyxfont.C b/src/lyxfont.C index 4168907ed9..fe884cdc2f 100644 --- a/src/lyxfont.C +++ b/src/lyxfont.C @@ -497,27 +497,31 @@ string const LyXFont::stateText(BufferParams * params) const { ostringstream os; if (family() != INHERIT_FAMILY) - os << _(GUIFamilyNames[family()]) << ", "; + os << lyx::to_utf8(_(GUIFamilyNames[family()])) << ", "; if (series() != INHERIT_SERIES) - os << _(GUISeriesNames[series()]) << ", "; + os << lyx::to_utf8(_(GUISeriesNames[series()])) << ", "; if (shape() != INHERIT_SHAPE) - os << _(GUIShapeNames[shape()]) << ", "; + os << lyx::to_utf8(_(GUIShapeNames[shape()])) << ", "; if (size() != INHERIT_SIZE) - os << _(GUISizeNames[size()]) << ", "; + os << lyx::to_utf8(_(GUISizeNames[size()])) << ", "; if (color() != LColor::inherit) os << lcolor.getGUIName(color()) << ", "; if (emph() != INHERIT) - os << bformat(_("Emphasis %1$s, "), _(GUIMiscNames[emph()])); + os << bformat(lyx::to_utf8(_("Emphasis %1$s, ")), + lyx::to_utf8(_(GUIMiscNames[emph()]))); if (underbar() != INHERIT) - os << bformat(_("Underline %1$s, "), _(GUIMiscNames[underbar()])); + os << bformat(lyx::to_utf8(_("Underline %1$s, ")), + lyx::to_utf8(_(GUIMiscNames[underbar()]))); if (noun() != INHERIT) - os << bformat(_("Noun %1$s, "), _(GUIMiscNames[noun()])); + os << bformat(lyx::to_utf8(_("Noun %1$s, ")), + lyx::to_utf8(_(GUIMiscNames[noun()]))); if (bits == inherit) - os << _("Default") << ", "; + os << lyx::to_utf8(_("Default")) << ", "; if (!params || (language() != params->language)) - os << bformat(_("Language: %1$s, "), _(language()->display())); + os << bformat(lyx::to_utf8(_("Language: %1$s, ")), + lyx::to_utf8(_(language()->display()))); if (number() != OFF) - os << bformat(_(" Number %1$s"), _(GUIMiscNames[number()])); + os << bformat(lyx::to_utf8(_(" Number %1$s")), lyx::to_utf8(_(GUIMiscNames[number()]))); return rtrim(os.str(), ", "); } diff --git a/src/lyxfunc.C b/src/lyxfunc.C index a5c12c42ed..44b13b27d4 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -317,7 +317,7 @@ void LyXFunc::processKeySym(LyXKeySymPtr keysym, key_modifier::state state) FuncRequest::KEYBOARD); } else { lyxerr[Debug::KEY] << "Unknown, !isText() - giving up" << endl; - owner->message(_("Unknown function.")); + owner->message(lyx::to_utf8(_("Unknown function."))); return; } } @@ -661,12 +661,12 @@ bool ensureBufferClean(BufferView * bv) return true; string const file = makeDisplayPath(buf.fileName(), 30); - string text = bformat(_("The document %1$s has unsaved " - "changes.\n\nDo you want to save " - "the document?"), file); - int const ret = Alert::prompt(_("Save changed document?"), - text, 0, 1, _("&Save"), - _("&Cancel")); + string text = bformat(lyx::to_utf8(_("The document %1$s has unsaved " + "changes.\n\nDo you want to save " + "the document?")), file); + int const ret = Alert::prompt(lyx::to_utf8(_("Save changed document?")), + text, 0, 1, lyx::to_utf8(_("&Save")), + lyx::to_utf8(_("&Cancel"))); if (ret == 0) bv->owner()->dispatch(FuncRequest(LFUN_BUFFER_WRITE)); @@ -677,10 +677,10 @@ bool ensureBufferClean(BufferView * bv) void showPrintError(string const & name) { - string str = bformat(_("Could not print the document %1$s.\n" - "Check that your printer is set up correctly."), + string str = bformat(lyx::to_utf8(_("Could not print the document %1$s.\n" + "Check that your printer is set up correctly.")), makeDisplayPath(name, 50)); - Alert::error(_("Print document failed"), str); + Alert::error(lyx::to_utf8(_("Print document failed")), str); } @@ -699,10 +699,10 @@ void loadTextclass(string const & name) lyx::textclass_type const tc = tc_pair.second; if (!textclasslist[tc].load()) { - string s = bformat(_("The document could not be converted\n" - "into the document class %1$s."), + string s = bformat(lyx::to_utf8(_("The document could not be converted\n" + "into the document class %1$s.")), textclasslist[tc].name()); - Alert::error(_("Could not change class"), s); + Alert::error(lyx::to_utf8(_("Could not change class")), s); } } @@ -810,11 +810,11 @@ void LyXFunc::dispatch(FuncRequest const & cmd) case LFUN_BUFFER_WRITE: if (!owner->buffer()->isUnnamed()) { - string const str = bformat(_("Saving document %1$s..."), + string const str = bformat(lyx::to_utf8(_("Saving document %1$s...")), makeDisplayPath(owner->buffer()->fileName())); owner->message(str); menuWrite(owner->buffer()); - owner->message(str + _(" done.")); + owner->message(str + lyx::to_utf8(_(" done."))); } else writeAs(owner->buffer()); update = false; @@ -827,10 +827,10 @@ void LyXFunc::dispatch(FuncRequest const & cmd) case LFUN_BUFFER_RELOAD: { string const file = makeDisplayPath(view()->buffer()->fileName(), 20); - string text = bformat(_("Any changes will be lost. Are you sure " - "you want to revert to the saved version of the document %1$s?"), file); - int const ret = Alert::prompt(_("Revert to saved document?"), - text, 0, 1, _("&Revert"), _("&Cancel")); + string text = bformat(lyx::to_utf8(_("Any changes will be lost. Are you sure " + "you want to revert to the saved version of the document %1$s?")), file); + int const ret = Alert::prompt(lyx::to_utf8(_("Revert to saved document?")), + text, 0, 1, lyx::to_utf8(_("&Revert")), lyx::to_utf8(_("&Cancel"))); if (ret == 0) view()->reload(); @@ -1036,7 +1036,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) << arg << "'. Bad installation?" << endl; break; } - owner->message(bformat(_("Opening help file %1$s..."), + owner->message(bformat(lyx::to_utf8(_("Opening help file %1$s...")), makeDisplayPath(fname))); owner->loadLyXFile(fname, false); break; @@ -1374,9 +1374,9 @@ void LyXFunc::dispatch(FuncRequest const & cmd) if (!lcolor.setColor(lyx_name, x11_name)) { setErrorMessage( - bformat(_("Set-color \"%1$s\" failed " - "- color is undefined or " - "may not be redefined"), lyx_name)); + bformat(lyx::to_utf8(_("Set-color \"%1$s\" failed " + "- color is undefined or " + "may not be redefined")), lyx_name)); break; } @@ -1487,10 +1487,10 @@ void LyXFunc::dispatch(FuncRequest const & cmd) } if (defaults.writeFile(defaults.fileName())) - setMessage(_("Document defaults saved in ") + setMessage(lyx::to_utf8(_("Document defaults saved in ")) + makeDisplayPath(fname)); else - setErrorMessage(_("Unable to save document defaults")); + setErrorMessage(lyx::to_utf8(_("Unable to save document defaults"))); break; } @@ -1544,7 +1544,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) // nothing to do break; - owner->message(_("Converting document to new document class...")); + owner->message(lyx::to_utf8(_("Converting document to new document class..."))); recordUndoFullDocument(view()); buffer->params().textclass = new_class; StableDocIterator backcur(view()->cursor()); @@ -1614,7 +1614,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) } } if (!quitting) - sendDispatchMessage(_(getMessage()), cmd); + sendDispatchMessage(lyx::to_utf8(_(getMessage())), cmd); } @@ -1710,16 +1710,16 @@ void LyXFunc::menuNew(string const & name, bool fromTemplate) // The template stuff string templname; if (fromTemplate) { - FileDialog fileDlg(_("Select template file"), + FileDialog fileDlg(lyx::to_utf8(_("Select template file")), LFUN_SELECT_FILE_SYNC, - make_pair(string(_("Documents|#o#O")), + make_pair(string(lyx::to_utf8(_("Documents|#o#O"))), string(lyxrc.document_path)), - make_pair(string(_("Templates|#T#t")), + make_pair(string(lyx::to_utf8(_("Templates|#T#t"))), string(lyxrc.template_path))); FileDialog::Result result = fileDlg.open(lyxrc.template_path, - FileFilterList(_("LyX Documents (*.lyx)")), + FileFilterList(lyx::to_utf8(_("LyX Documents (*.lyx)"))), string()); if (result.first == FileDialog::Later) @@ -1749,16 +1749,16 @@ void LyXFunc::open(string const & fname) string filename; if (fname.empty()) { - FileDialog fileDlg(_("Select document to open"), + FileDialog fileDlg(lyx::to_utf8(_("Select document to open")), LFUN_FILE_OPEN, - make_pair(string(_("Documents|#o#O")), + make_pair(string(lyx::to_utf8(_("Documents|#o#O"))), string(lyxrc.document_path)), - make_pair(string(_("Examples|#E#e")), + make_pair(string(lyx::to_utf8(_("Examples|#E#e"))), string(addPath(package().system_support(), "examples")))); FileDialog::Result result = fileDlg.open(initpath, - FileFilterList(_("LyX Documents (*.lyx)")), + FileFilterList(lyx::to_utf8(_("LyX Documents (*.lyx)"))), string()); if (result.first == FileDialog::Later) @@ -1768,7 +1768,7 @@ void LyXFunc::open(string const & fname) // check selected filename if (filename.empty()) { - owner->message(_("Canceled.")); + owner->message(lyx::to_utf8(_("Canceled."))); return; } } else @@ -1792,13 +1792,13 @@ void LyXFunc::open(string const & fname) return; } - owner->message(bformat(_("Opening document %1$s..."), disp_fn)); + owner->message(bformat(lyx::to_utf8(_("Opening document %1$s...")), disp_fn)); string str2; if (owner->loadLyXFile(filename)) { - str2 = bformat(_("Document %1$s opened."), disp_fn); + str2 = bformat(lyx::to_utf8(_("Document %1$s opened.")), disp_fn); } else { - str2 = bformat(_("Could not open document %1$s"), disp_fn); + str2 = bformat(lyx::to_utf8(_("Could not open document %1$s")), disp_fn); } owner->message(str2); } @@ -1823,14 +1823,14 @@ void LyXFunc::doImport(string const & argument) initpath = trypath; } - string const text = bformat(_("Select %1$s file to import"), + string const text = bformat(lyx::to_utf8(_("Select %1$s file to import")), formats.prettyName(format)); FileDialog fileDlg(text, LFUN_BUFFER_IMPORT, - make_pair(string(_("Documents|#o#O")), + make_pair(string(lyx::to_utf8(_("Documents|#o#O"))), string(lyxrc.document_path)), - make_pair(string(_("Examples|#E#e")), + make_pair(string(lyx::to_utf8(_("Examples|#E#e"))), string(addPath(package().system_support(), "examples")))); string const filter = formats.prettyName(format) @@ -1848,7 +1848,7 @@ void LyXFunc::doImport(string const & argument) // check selected filename if (filename.empty()) - owner->message(_("Canceled.")); + owner->message(lyx::to_utf8(_("Canceled."))); } if (filename.empty()) @@ -1862,7 +1862,7 @@ void LyXFunc::doImport(string const & argument) // Check if the document already is open if (lyx_gui::use_gui && bufferlist.exists(lyxfile)) { if (!bufferlist.close(bufferlist.getBuffer(lyxfile), true)) { - owner->message(_("Canceled.")); + owner->message(lyx::to_utf8(_("Canceled."))); return; } } @@ -1872,13 +1872,13 @@ void LyXFunc::doImport(string const & argument) if (fs::exists(lyxfile) && filename != lyxfile) { string const file = makeDisplayPath(lyxfile, 30); - string text = bformat(_("The document %1$s already exists.\n\n" - "Do you want to over-write that document?"), file); - int const ret = Alert::prompt(_("Over-write document?"), - text, 0, 1, _("&Over-write"), _("&Cancel")); + string text = bformat(lyx::to_utf8(_("The document %1$s already exists.\n\n" + "Do you want to over-write that document?")), file); + int const ret = Alert::prompt(lyx::to_utf8(_("Over-write document?")), + text, 0, 1, lyx::to_utf8(_("&Over-write")), lyx::to_utf8(_("&Cancel"))); if (ret == 1) { - owner->message(_("Canceled.")); + owner->message(lyx::to_utf8(_("Canceled."))); return; } } @@ -1938,7 +1938,7 @@ string const LyXFunc::viewStatusMessage() return keyseq.printOptions(); if (!view()->available()) - return _("Welcome to LyX!"); + return lyx::to_utf8(_("Welcome to LyX!")); return view()->cursor().currentState(); } diff --git a/src/lyxrc.C b/src/lyxrc.C index fd741ab8ff..6d3d101b33 100644 --- a/src/lyxrc.C +++ b/src/lyxrc.C @@ -42,6 +42,7 @@ namespace os = lyx::support::os; +using lyx::docstring; using lyx::support::ascii_lowercase; using lyx::support::bformat; using lyx::support::expandPath; @@ -1104,7 +1105,7 @@ int LyXRC::read(LyXLex & lexrc) (tokenPos(flags, ',', "document") >= 0); if (!flags.empty() && flags != "document") lyxerr << "Ignoring flags other than " - "`document' in `" << flags + "`document' in `" << flags << "' for format `" << format << "'." << endl; if (prettyname.empty()) { @@ -2119,7 +2120,7 @@ void LyXRC::set_font_norm_type() string const LyXRC::getDescription(LyXRCTags tag) { - string str; + docstring str; switch (tag) { case RC_ACCEPT_COMPOUND: @@ -2293,7 +2294,7 @@ string const LyXRC::getDescription(LyXRCTags tag) break; case RC_NUMLASTFILES: - str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."), maxlastfiles); + str = lyx::from_utf8(bformat(lyx::to_utf8(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu.")), maxlastfiles)); break; case RC_PATH_PREFIX: @@ -2368,7 +2369,7 @@ string const LyXRC::getDescription(LyXRCTags tag) break; case RC_PRINTPAPERDIMENSIONFLAG: - str = _("Option to specify the dimensions of the print paper."); + str = _("Option to specify the dimensions of the print paper."); break; case RC_PRINTPAPERFLAG: @@ -2498,7 +2499,7 @@ string const LyXRC::getDescription(LyXRCTags tag) break; case RC_VIEWDVI_PAPEROPTION: - str = _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")"); + _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")"); break; case RC_VIEWER: @@ -2508,7 +2509,7 @@ string const LyXRC::getDescription(LyXRCTags tag) break; } - return str; + return lyx::to_utf8(str); } // The global instance diff --git a/src/lyxvc.C b/src/lyxvc.C index d05c292f7a..b7de1af96f 100644 --- a/src/lyxvc.C +++ b/src/lyxvc.C @@ -90,9 +90,9 @@ void LyXVC::registrer() // there must be a file to save if (!isFileReadable(filename)) { - Alert::error(_("Document not saved"), - _("You must save the document " - "before it can be registered.")); + Alert::error(lyx::to_utf8(_("Document not saved")), + lyx::to_utf8(_("You must save the document " + "before it can be registered."))); return; } @@ -120,8 +120,8 @@ void LyXVC::registrer() lyxerr[Debug::LYXVC] << "LyXVC: registrer" << endl; pair tmp = - Alert::askForText(_("LyX VC: Initial description"), - _("(no initial description)")); + Alert::askForText(lyx::to_utf8(_("LyX VC: Initial description")), + lyx::to_utf8(_("(no initial description)"))); if (!tmp.first || tmp.second.empty()) { // should we insist on checking tmp.second.empty()? lyxerr[Debug::LYXVC] << "LyXVC: user cancelled" << endl; @@ -136,10 +136,10 @@ void LyXVC::checkIn() { lyxerr[Debug::LYXVC] << "LyXVC: checkIn" << endl; - pair tmp = Alert::askForText(_("LyX VC: Log Message")); + pair tmp = Alert::askForText(lyx::to_utf8(_("LyX VC: Log Message"))); if (tmp.first) { if (tmp.second.empty()) { - tmp.second = _("(no log message)"); + tmp.second = lyx::to_utf8(_("(no log message)")); } vcs->checkIn(tmp.second); } else { @@ -161,11 +161,11 @@ void LyXVC::revert() lyxerr[Debug::LYXVC] << "LyXVC: revert" << endl; string const file = makeDisplayPath(owner_->fileName(), 20); - string text = bformat(_("Reverting to the stored version of the " + string text = bformat(lyx::to_utf8(_("Reverting to the stored version of the " "document %1$s will lose all current changes.\n\n" - "Do you want to revert to the saved version?"), file); - int const ret = Alert::prompt(_("Revert to stored version of document?"), - text, 0, 1, _("&Revert"), _("&Cancel")); + "Do you want to revert to the saved version?")), file); + int const ret = Alert::prompt(lyx::to_utf8(_("Revert to stored version of document?")), + text, 0, 1, lyx::to_utf8(_("&Revert")), lyx::to_utf8(_("&Cancel"))); if (ret == 0) vcs->revert(); diff --git a/src/mathed/math_gridinset.C b/src/mathed/math_gridinset.C index 879f8e1090..af651cb33f 100644 --- a/src/mathed/math_gridinset.C +++ b/src/mathed/math_gridinset.C @@ -1204,7 +1204,8 @@ void MathGridInset::doDispatch(LCursor & cur, FuncRequest & cmd) } case LFUN_PASTE: { - cur.message(_("Paste")); + // FIXME UNICODE + cur.message(lyx::to_utf8(_("Paste"))); lyx::cap::replaceSelection(cur); istringstream is(lyx::to_utf8(cmd.argument())); int n = 0; diff --git a/src/mathed/math_hullinset.C b/src/mathed/math_hullinset.C index 14ea3a0810..360209b35b 100644 --- a/src/mathed/math_hullinset.C +++ b/src/mathed/math_hullinset.C @@ -341,8 +341,8 @@ void MathHullInset::draw(PainterInfo & pi, int x, int y) const for (row_type row = 0; row < nrows(); ++row) { int const yy = y + rowinfo_[row].offset_; FontSetChanger dummy(pi.base, "mathrm"); - string const nl = nicelabel(row); - docstring const dnl(nl.begin(), nl.end()); + string const nl = nicelabel(row); + docstring const dnl(nl.begin(), nl.end()); pi.draw(xx, yy, dnl); } } @@ -1042,7 +1042,8 @@ void MathHullInset::doDispatch(LCursor & cur, FuncRequest & cmd) else for (row_type row = 0; row < nrows(); ++row) numbered(row, !old); - cur.message(old ? _("No number") : _("Number")); + // FIXME UNICODE + cur.message(old ? lyx::to_utf8(_("No number")) : lyx::to_utf8(_("Number"))); } break; @@ -1051,7 +1052,8 @@ void MathHullInset::doDispatch(LCursor & cur, FuncRequest & cmd) recordUndoInset(cur); row_type r = (type_ == hullMultline) ? nrows() - 1 : cur.row(); bool old = numbered(r); - cur.message(old ? _("No number") : _("Number")); + // FIXME UNICODE + cur.message(old ? lyx::to_utf8(_("No number")) : lyx::to_utf8(_("Number"))); numbered(r, !old); } break; @@ -1310,7 +1312,8 @@ void MathHullInset::edit(LCursor & cur, bool left) string const MathHullInset::editMessage() const { - return _("Math editor mode"); + // FIXME UNICODE + return lyx::to_utf8(_("Math editor mode")); } diff --git a/src/mathed/math_macrotemplate.C b/src/mathed/math_macrotemplate.C index 9cba8e8b93..c8f9453361 100644 --- a/src/mathed/math_macrotemplate.C +++ b/src/mathed/math_macrotemplate.C @@ -104,8 +104,10 @@ string MathMacroTemplate::name() const docstring MathMacroTemplate::prefix() const { - // FIXME: delete the conversion when bformat() will return a docstring. - return lyx::from_utf8(bformat(_(" Macro: %1$s: "), name_)); + // FIXME UNICODE + // delete the conversion when bformat() will return a docstring. + // delete the conversion when bformat() takes a docstring arg. + return lyx::from_utf8(bformat(lyx::to_utf8(_(" Macro: %1$s: ")), name_)); } diff --git a/src/mathed/math_nestinset.C b/src/mathed/math_nestinset.C index bf0baadd86..cc6e751754 100644 --- a/src/mathed/math_nestinset.C +++ b/src/mathed/math_nestinset.C @@ -421,7 +421,8 @@ void MathNestInset::doDispatch(LCursor & cur, FuncRequest & cmd) case LFUN_PASTE: { recordUndo(cur); - cur.message(_("Paste")); + // FIXME UNICODE + cur.message(lyx::to_utf8(_("Paste"))); replaceSelection(cur); size_t n = 0; istringstream is(lyx::to_utf8(cmd.argument())); @@ -437,7 +438,8 @@ void MathNestInset::doDispatch(LCursor & cur, FuncRequest & cmd) case LFUN_CUT: recordUndo(cur); cutSelection(cur, true, true); - cur.message(_("Cut")); + // FIXME UNICODE + cur.message(lyx::to_utf8(_("Cut"))); // Prevent stale position >= size crash // Probably not necessary anymore, see eraseSelection (gb 2005-10-09) cur.normalize(); @@ -445,7 +447,8 @@ void MathNestInset::doDispatch(LCursor & cur, FuncRequest & cmd) case LFUN_COPY: copySelection(cur); - cur.message(_("Copy")); + // FIXME UNICODE + cur.message(lyx::to_utf8(_("Copy"))); break; case LFUN_MOUSE_PRESS: @@ -1374,10 +1377,10 @@ bool MathNestInset::script(LCursor & cur, bool up, string const & MathScriptInset * inset = cur.nextAtom().nucleus()->asScriptInset(); // special handling of {}-bases // is this always correct? - if (inset->nuc().size() == 1 + if (inset->nuc().size() == 1 && inset->nuc().back()->asBraceInset()) inset->nuc() = inset->nuc().back()->asNestInset()->cell(0); - + cur.push(*inset); cur.idx() = 1; cur.pos() = 0; diff --git a/src/mathed/ref_inset.C b/src/mathed/ref_inset.C index ffb8d11add..0a0d227580 100644 --- a/src/mathed/ref_inset.C +++ b/src/mathed/ref_inset.C @@ -128,7 +128,8 @@ string const RefInset::screenLabel() const string str; for (int i = 0; !types[i].latex_name.empty(); ++i) if (commandname() == types[i].latex_name) { - str = _(types[i].short_gui_name); + // FIXME UNICODE + str = lyx::to_utf8(_(types[i].short_gui_name)); break; } str += asString(cell(0)); diff --git a/src/output.C b/src/output.C index a5a3db5ece..11e96aee6a 100644 --- a/src/output.C +++ b/src/output.C @@ -31,9 +31,9 @@ bool openFileWrite(ofstream & ofs, string const & fname) ofs.open(fname.c_str()); if (!ofs) { string const file = makeDisplayPath(fname, 50); - string text = bformat(_("Could not open the specified " - "document\n%1$s."), file); - Alert::error(_("Could not open file"), text); + string text = bformat(lyx::to_utf8(_("Could not open the specified " + "document\n%1$s.")), file); + Alert::error(lyx::to_utf8(_("Could not open file")), text); return false; } return true; diff --git a/src/output_plaintext.C b/src/output_plaintext.C index 2327206b9f..311a0058e7 100644 --- a/src/output_plaintext.C +++ b/src/output_plaintext.C @@ -152,10 +152,10 @@ void asciiParagraph(Buffer const & buf, case 6: // Abstract if (runparams.linelen > 0) { - os << _("Abstract") << "\n\n"; + os << lyx::to_utf8(_("Abstract")) << "\n\n"; currlinelen = 0; } else { - string const abst = _("Abstract: "); + string const abst = lyx::to_utf8(_("Abstract: ")); os << abst; currlinelen += abst.length(); } @@ -164,10 +164,10 @@ void asciiParagraph(Buffer const & buf, case 7: // Bibliography if (!ref_printed) { if (runparams.linelen > 0) { - os << _("References") << "\n\n"; + os << lyx::to_utf8(_("References")) << "\n\n"; currlinelen = 0; } else { - string const refs = _("References: "); + string const refs = lyx::to_utf8(_("References: ")); os << refs; currlinelen += refs.length(); } diff --git a/src/paragraph.C b/src/paragraph.C index 6975c091f0..2ca17c2ef2 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -612,7 +612,7 @@ string const Paragraph::getLabelWidthString() const if (!params().labelWidthString().empty()) return params().labelWidthString(); else - return _("Senseless with this layout!"); + return lyx::to_utf8(_("Senseless with this layout!")); } diff --git a/src/rowpainter.C b/src/rowpainter.C index 45bae7438c..53c27fc1b1 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -457,7 +457,7 @@ int RowPainter::paintAppendixStart(int y) pb_font.setColor(LColor::appendix); pb_font.decSize(); - string const label = _("Appendix"); + string const label = lyx::to_utf8(_("Appendix")); int w = 0; int a = 0; int d = 0; diff --git a/src/support/filefilterlist.C b/src/support/filefilterlist.C index 9c53eb3f6f..061b5d2211 100644 --- a/src/support/filefilterlist.C +++ b/src/support/filefilterlist.C @@ -101,9 +101,10 @@ FileFilterList::Filter::Filter(std::string const & description, FileFilterList::FileFilterList(string const & qt_style_filter) { + // FIXME UNICODE string const filter = qt_style_filter + (qt_style_filter.empty() ? string() : ";;") - + _("All files (*)"); + + lyx::to_utf8(_("All files (*)")); // Split data such as "TeX documents (*.tex);;LyX Documents (*.lyx)" // into individual filters. diff --git a/src/support/package.C.in b/src/support/package.C.in index a81f33dc0c..690943974b 100644 --- a/src/support/package.C.in +++ b/src/support/package.C.in @@ -149,7 +149,7 @@ Package::Package(string const & command_line_arg0, string const configure_script = addName(system_support(), "configure.py"); configure_command_ = os::python() + ' ' + quoteName(configure_script) - + with_version_suffix(); + + with_version_suffix(); lyxerr[Debug::INIT] << "\n" @@ -436,8 +436,9 @@ string const abs_path_from_binary_name(string const & exe) { string const abs_binary = get_binary_path(exe); if (abs_binary.empty()) { - lyxerr << bformat(_("Unable to determine the path to the " - "LyX binary from the command line %1$s"), + // FIXME UNICODE + lyxerr << bformat(lyx::to_utf8(_("Unable to determine the path to the " + "LyX binary from the command line %1$s")), exe) << std::endl; bail_out(); @@ -557,13 +558,14 @@ get_system_support_dir(string const & abs_binary, searched_dirs_str += *it; } - lyxerr << bformat(_("Unable to determine the system directory " - "having searched\n" - "\t%1$s\n" - "Use the '-sysdir' command line parameter or " - "set the environment variable LYX_DIR_14x to " - "the LyX system directory containing the file " - "`chkconfig.ltx'."), + // FIXME UNICODE + lyxerr << bformat(lyx::to_utf8(_("Unable to determine the system directory " + "having searched\n" + "\t%1$s\n" + "Use the '-sysdir' command line parameter or " + "set the environment variable LYX_DIR_14x to " + "the LyX system directory containing the file " + "`chkconfig.ltx'.")), searched_dirs_str) << std::endl; @@ -642,8 +644,9 @@ bool check_command_line_dir(string const & dir, { string const abs_path = fileSearch(dir, file); if (abs_path.empty()) { - lyxerr << bformat(_("Invalid %1$s switch.\n" - "Directory %2$s does not contain %3$s."), + // FIXME UNICODE + lyxerr << bformat(lyx::to_utf8(_("Invalid %1$s switch.\n" + "Directory %2$s does not contain %3$s.")), command_line_switch, dir, file) << std::endl; } @@ -668,8 +671,9 @@ bool check_env_var_dir(string const & dir, { string const abs_path = fileSearch(dir, file); if (abs_path.empty()) { - lyxerr << bformat(_("Invalid %1$s environment variable.\n" - "Directory %2$s does not contain %3$s."), + // FIXME UNICODE + lyxerr << bformat(lyx::to_utf8(_("Invalid %1$s environment variable.\n" + "Directory %2$s does not contain %3$s.")), env_var, dir, file) << std::endl; } @@ -690,8 +694,9 @@ bool check_env_var_dir(string const & dir, // search mechanism in po/Makefile.in.in will register // package.C.in as a file containing strings that need // translation. + // FIXME UNICODE string const fmt = - _("Invalid %1$s environment variable.\n%2$s is not a directory."); + lyx::to_utf8(_("Invalid %1$s environment variable.\n%2$s is not a directory.")); lyxerr << bformat(fmt, env_var, dir) << std::endl; diff --git a/src/text.C b/src/text.C index 4cb9e50b66..56f2d4da0e 100644 --- a/src/text.C +++ b/src/text.C @@ -190,8 +190,8 @@ void readParToken(Buffer const & buf, Paragraph & par, LyXLex & lex, bool hasLayout = tclass.hasLayout(layoutname); if (!hasLayout) { - errorList.push_back(ErrorItem(_("Unknown layout"), - bformat(_("Layout '%1$s' does not exist in textclass '%2$s'\nTrying to use the default instead.\n"), + errorList.push_back(ErrorItem(lyx::to_utf8(_("Unknown layout")), + bformat(lyx::to_utf8(_("Layout '%1$s' does not exist in textclass '%2$s'\nTrying to use the default instead.\n")), layoutname, tclass.name()), par.id(), 0, par.size())); layoutname = tclass.defaultLayoutName(); } @@ -222,7 +222,7 @@ void readParToken(Buffer const & buf, Paragraph & par, LyXLex & lex, else { lex.eatLine(); string line = lex.getString(); - errorList.push_back(ErrorItem(_("Unknown Inset"), line, + errorList.push_back(ErrorItem(lyx::to_utf8(_("Unknown Inset")), line, par.id(), 0, par.size())); } } else if (token == "\\family") { @@ -339,8 +339,8 @@ void readParToken(Buffer const & buf, Paragraph & par, LyXLex & lex, lyx::time_type ct; is >> aid >> ct; if (aid >= bp.author_map.size()) { - errorList.push_back(ErrorItem(_("Change tracking error"), - bformat(_("Unknown author index for insertion: %1$d\n"), aid), + errorList.push_back(ErrorItem(lyx::to_utf8(_("Change tracking error")), + bformat(lyx::to_utf8(_("Unknown author index for insertion: %1$d\n")), aid), par.id(), 0, par.size())); change = Change(Change::UNCHANGED); @@ -353,8 +353,8 @@ void readParToken(Buffer const & buf, Paragraph & par, LyXLex & lex, lyx::time_type ct; is >> aid >> ct; if (aid >= bp.author_map.size()) { - errorList.push_back(ErrorItem(_("Change tracking error"), - bformat(_("Unknown author index for deletion: %1$d\n"), aid), + errorList.push_back(ErrorItem(lyx::to_utf8(_("Change tracking error")), + bformat(lyx::to_utf8(_("Unknown author index for deletion: %1$d\n")), aid), par.id(), 0, par.size())); change = Change(Change::UNCHANGED); @@ -362,8 +362,8 @@ void readParToken(Buffer const & buf, Paragraph & par, LyXLex & lex, change = Change(Change::DELETED, bp.author_map[aid], ct); } else { lex.eatLine(); - errorList.push_back(ErrorItem(_("Unknown token"), - bformat(_("Unknown token: %1$s %2$s\n"), token, lex.getString()), + errorList.push_back(ErrorItem(lyx::to_utf8(_("Unknown token")), + bformat(lyx::to_utf8(_("Unknown token: %1$s %2$s\n")), token, lex.getString()), par.id(), 0, par.size())); } } @@ -502,8 +502,8 @@ int LyXText::leftMargin(pit_type const pit, pos_type const pos) const if (isMainText()) l_margin += changebarMargin(); - string leftm = tclass.leftmargin(); - docstring dleft(leftm.begin(), leftm.end()); + string leftm = tclass.leftmargin(); + docstring dleft(leftm.begin(), leftm.end()); l_margin += font_metrics::signedWidth(dleft, params.getFont()); if (par.getDepth() != 0) { @@ -532,64 +532,64 @@ int LyXText::leftMargin(pit_type const pit, pos_type const pos) const LyXFont const labelfont = getLabelFont(par); switch (layout->margintype) { case MARGIN_DYNAMIC: - if (!layout->leftmargin.empty()) { - string leftm = layout->leftmargin; - docstring dleft(leftm.begin(), leftm.end()); - l_margin += font_metrics::signedWidth(dleft, - params.getFont()); - } - if (!par.getLabelstring().empty()) { - string labin = layout->labelindent; - docstring dlabin(labin.begin(), labin.end()); + if (!layout->leftmargin.empty()) { + string leftm = layout->leftmargin; + docstring dleft(leftm.begin(), leftm.end()); + l_margin += font_metrics::signedWidth(dleft, + params.getFont()); + } + if (!par.getLabelstring().empty()) { + string labin = layout->labelindent; + docstring dlabin(labin.begin(), labin.end()); l_margin += font_metrics::signedWidth(dlabin, labelfont); - string labstr = par.getLabelstring(); - docstring dlabstr(labstr.begin(), labstr.end()); + string labstr = par.getLabelstring(); + docstring dlabstr(labstr.begin(), labstr.end()); l_margin += font_metrics::width(dlabstr, labelfont); - string labsep = layout->labelsep; - docstring dlabsep(labsep.begin(), labsep.end()); + string labsep = layout->labelsep; + docstring dlabsep(labsep.begin(), labsep.end()); l_margin += font_metrics::width(dlabsep, labelfont); } break; case MARGIN_MANUAL: { - string labin = layout->labelindent; - docstring dlabin(labin.begin(), labin.end()); + string labin = layout->labelindent; + docstring dlabin(labin.begin(), labin.end()); l_margin += font_metrics::signedWidth(dlabin, labelfont); // The width of an empty par, even with manual label, should be 0 if (!par.empty() && pos >= par.beginOfBody()) { if (!par.getLabelWidthString().empty()) { - string labstr = par.getLabelWidthString(); - docstring dlabstr(labstr.begin(), labstr.end()); + string labstr = par.getLabelWidthString(); + docstring dlabstr(labstr.begin(), labstr.end()); l_margin += font_metrics::width(dlabstr, labelfont); - string labsep = layout->labelsep; - docstring dlabsep(labsep.begin(), labsep.end()); + string labsep = layout->labelsep; + docstring dlabsep(labsep.begin(), labsep.end()); l_margin += font_metrics::width(dlabsep, labelfont); } } break; - } - + } + case MARGIN_STATIC: { - string leftm = layout->leftmargin; - docstring dleft(leftm.begin(), leftm.end()); + string leftm = layout->leftmargin; + docstring dleft(leftm.begin(), leftm.end()); l_margin += font_metrics::signedWidth(dleft, params.getFont()) * 4 / (par.getDepth() + 4); break; - } + } case MARGIN_FIRST_DYNAMIC: if (layout->labeltype == LABEL_MANUAL) { if (pos >= par.beginOfBody()) { - string leftm = layout->leftmargin; - docstring dleft(leftm.begin(), leftm.end()); + string leftm = layout->leftmargin; + docstring dleft(leftm.begin(), leftm.end()); l_margin += font_metrics::signedWidth(dleft, labelfont); } else { - string labin = layout->labelindent; - docstring dlabin(labin.begin(), labin.end()); + string labin = layout->labelindent; + docstring dlabin(labin.begin(), labin.end()); l_margin += font_metrics::signedWidth(dlabin, labelfont); } @@ -599,23 +599,23 @@ int LyXText::leftMargin(pit_type const pit, pos_type const pos) const || (layout->labeltype == LABEL_STATIC && layout->latextype == LATEX_ENVIRONMENT && !isFirstInSequence(pit, pars_))) { - string leftm = layout->leftmargin; - docstring dleft(leftm.begin(), leftm.end()); + string leftm = layout->leftmargin; + docstring dleft(leftm.begin(), leftm.end()); l_margin += font_metrics::signedWidth(dleft, labelfont); } else if (layout->labeltype != LABEL_TOP_ENVIRONMENT && layout->labeltype != LABEL_BIBLIO && layout->labeltype != LABEL_CENTERED_TOP_ENVIRONMENT) { - string labin = layout->labelindent; - docstring dlabin(labin.begin(), labin.end()); + string labin = layout->labelindent; + docstring dlabin(labin.begin(), labin.end()); l_margin += font_metrics::signedWidth(dlabin, labelfont); - string labsep = layout->labelsep; - docstring dlabsep(labsep.begin(), labsep.end()); + string labsep = layout->labelsep; + docstring dlabsep(labsep.begin(), labsep.end()); l_margin += font_metrics::width(dlabsep, labelfont); - string labstr = par.getLabelstring(); - docstring dlabstr(labstr.begin(), labstr.end()); + string labstr = par.getLabelstring(); + docstring dlabstr(labstr.begin(), labstr.end()); l_margin += font_metrics::width(dlabstr, labelfont); } break; @@ -673,7 +673,7 @@ int LyXText::leftMargin(pit_type const pit, pos_type const pos) const || bv()->buffer()->params().paragraph_separation == BufferParams::PARSEP_INDENT)) { - docstring din(parindent.begin(), parindent.end()); + docstring din(parindent.begin(), parindent.end()); l_margin += font_metrics::signedWidth(din, params.getFont()); } @@ -689,10 +689,10 @@ int LyXText::rightMargin(Paragraph const & par) const BufferParams const & params = bv()->buffer()->params(); LyXTextClass const & tclass = params.getLyXTextClass(); - string trmarg = tclass.rightmargin(); - docstring dtrmarg(trmarg.begin(), trmarg.end()); - string lrmarg = par.layout()->rightmargin; - docstring dlrmarg(lrmarg.begin(), lrmarg.end()); + string trmarg = tclass.rightmargin(); + docstring dtrmarg(trmarg.begin(), trmarg.end()); + string lrmarg = par.layout()->rightmargin; + docstring dlrmarg(lrmarg.begin(), lrmarg.end()); int const r_margin = ::rightMargin() + font_metrics::signedWidth(dtrmarg, @@ -778,8 +778,8 @@ void LyXText::rowBreakPoint(pit_type const pit, Row & row) const // add the auto-hfill from label end to the body if (body_pos && i == body_pos) { - string lsep = layout->labelsep; - docstring dlsep(lsep.begin(), lsep.end()); + string lsep = layout->labelsep; + docstring dlsep(lsep.begin(), lsep.end()); int add = font_metrics::width(dlsep, getLabelFont(par)); if (par.isLineSeparator(i - 1)) add -= singleWidth(par, i - 1); @@ -854,7 +854,7 @@ void LyXText::setRowWidth(pit_type const pit, Row & row) const Paragraph const & par = pars_[pit]; string const & labelsep = par.layout()->labelsep; - docstring dlsep(labelsep.begin(), labelsep.end()); + docstring dlsep(labelsep.begin(), labelsep.end()); int w = leftMargin(pit, row.pos()); pos_type const body_pos = par.beginOfBody(); @@ -907,7 +907,7 @@ int LyXText::labelFill(Paragraph const & par, Row const & row) const if (label.empty()) return 0; - docstring dlab(label.begin(), label.end()); + docstring dlab(label.begin(), label.end()); return max(0, font_metrics::width(dlab, getLabelFont(par)) - w); } @@ -1240,8 +1240,8 @@ void LyXText::insertChar(LCursor & cur, char_type c) if (cur.pos() == 0) { static bool sent_space_message = false; if (!sent_space_message) { - cur.message(_("You cannot insert a space at the " - "beginning of a paragraph. Please read the Tutorial.")); + cur.message(lyx::to_utf8(_("You cannot insert a space at the " + "beginning of a paragraph. Please read the Tutorial."))); sent_space_message = true; } return; @@ -1252,8 +1252,8 @@ void LyXText::insertChar(LCursor & cur, char_type c) && par.lookupChange(cur.pos() - 1) != Change::DELETED) { static bool sent_space_message = false; if (!sent_space_message) { - cur.message(_("You cannot type two spaces this way. " - "Please read the Tutorial.")); + cur.message(lyx::to_utf8(_("You cannot type two spaces this way. " + "Please read the Tutorial."))); sent_space_message = true; } return; @@ -1383,8 +1383,8 @@ LyXText::computeRowMetrics(pit_type const pit, Row const & row) const if (body_pos > 0 && (body_pos > end || !par.isLineSeparator(body_pos - 1))) { - string lsep = layout->labelsep; - docstring dlsep(lsep.begin(), lsep.end()); + string lsep = layout->labelsep; + docstring dlsep(lsep.begin(), lsep.end()); result.x += font_metrics::width(dlsep, getLabelFont(par)); if (body_pos <= end) result.x += result.label_hfill; @@ -1674,7 +1674,7 @@ bool LyXText::erase(LCursor & cur) } } else needsUpdate = dissolveInset(cur); - + return needsUpdate; } @@ -1806,7 +1806,7 @@ bool LyXText::backspace(LCursor & cur) bool LyXText::dissolveInset(LCursor & cur) { BOOST_ASSERT(this == cur.text()); - if (isMainText() || cur.inset().nargs() != 1) + if (isMainText() || cur.inset().nargs() != 1) return false; recordUndoInset(cur); @@ -1815,7 +1815,7 @@ bool LyXText::dissolveInset(LCursor & cur) { lyx::pos_type spos = cur.pos(); lyx::pit_type spit = cur.pit(); ParagraphList plist; - if (cur.lastpit() != 0 || cur.lastpos() != 0) + if (cur.lastpit() != 0 || cur.lastpos() != 0) plist = paragraphs(); cur.popLeft(); // store cursor offset @@ -1825,7 +1825,7 @@ bool LyXText::dissolveInset(LCursor & cur) { cur.paragraph().erase(cur.pos()); if (!plist.empty()) { Buffer & b = cur.buffer(); - pasteParagraphList(cur, plist, b.params().textclass, + pasteParagraphList(cur, plist, b.params().textclass, b.errorList("Paste")); // restore position cur.pit() = std::min(cur.lastpit(), spit); @@ -2293,8 +2293,8 @@ int LyXText::cursorX(CursorSlice const & sl, bool boundary) const for (pos_type vpos = row_pos; vpos < cursor_vpos; ++vpos) { pos_type pos = bidi.vis2log(vpos); if (body_pos > 0 && pos == body_pos - 1) { - string lsep = par.layout()->labelsep; - docstring dlsep(lsep.begin(), lsep.end()); + string lsep = par.layout()->labelsep; + docstring dlsep(lsep.begin(), lsep.end()); x += m.label_hfill + font_metrics::width(dlsep, getLabelFont(par)); @@ -2374,11 +2374,11 @@ string LyXText::currentState(LCursor & cur) if (show_change) { Change change = par.lookupChange(cur.pos()); Author const & a = buf.params().authors().get(change.author); - os << _("Change: ") << a.name(); + os << lyx::to_utf8(_("Change: ")) << a.name(); if (!a.email().empty()) os << " (" << a.email() << ")"; if (change.changetime) - os << _(" at ") << ctime(&change.changetime); + os << lyx::to_utf8(_(" at ")) << ctime(&change.changetime); os << " : "; } @@ -2388,34 +2388,34 @@ string LyXText::currentState(LCursor & cur) LyXFont font = real_current_font; font.reduce(buf.params().getFont()); - // avoid _(...) re-entrance problem + // avoid lyx::to_utf8(_(...)) re-entrance problem string const s = font.stateText(&buf.params()); - os << bformat(_("Font: %1$s"), s); + os << bformat(lyx::to_utf8(_("Font: %1$s")), s); - // os << bformat(_("Font: %1$s"), font.stateText(&buf.params)); + // os << bformat(lyx::to_utf8(_("Font: %1$s")), font.stateText(&buf.params)); // The paragraph depth int depth = cur.paragraph().getDepth(); if (depth > 0) - os << bformat(_(", Depth: %1$d"), depth); + os << bformat(lyx::to_utf8(_(", Depth: %1$d")), depth); // The paragraph spacing, but only if different from // buffer spacing. Spacing const & spacing = par.params().spacing(); if (!spacing.isDefault()) { - os << _(", Spacing: "); + os << lyx::to_utf8(_(", Spacing: ")); switch (spacing.getSpace()) { case Spacing::Single: - os << _("Single"); + os << lyx::to_utf8(_("Single")); break; case Spacing::Onehalf: - os << _("OneHalf"); + os << lyx::to_utf8(_("OneHalf")); break; case Spacing::Double: - os << _("Double"); + os << lyx::to_utf8(_("Double")); break; case Spacing::Other: - os << _("Other (") << spacing.getValueAsString() << ')'; + os << lyx::to_utf8(_("Other (")) << spacing.getValueAsString() << ')'; break; case Spacing::Default: // should never happen, do nothing @@ -2424,11 +2424,11 @@ string LyXText::currentState(LCursor & cur) } #ifdef DEVEL_VERSION - os << _(", Inset: ") << &cur.inset(); - os << _(", Paragraph: ") << cur.pit(); - os << _(", Id: ") << par.id(); - os << _(", Position: ") << cur.pos(); - os << _(", Boundary: ") << cur.boundary(); + os << lyx::to_utf8(_(", Inset: ")) << &cur.inset(); + os << lyx::to_utf8(_(", Paragraph: ")) << cur.pit(); + os << lyx::to_utf8(_(", Id: ")) << par.id(); + os << lyx::to_utf8(_(", Position: ")) << cur.pos(); + os << lyx::to_utf8(_(", Boundary: ")) << cur.boundary(); // Row & row = cur.textRow(); // os << bformat(_(", Row b:%1$d e:%2$d"), row.pos(), row.endpos()); #endif diff --git a/src/text2.C b/src/text2.C index 0824e42d18..ea0abd304b 100644 --- a/src/text2.C +++ b/src/text2.C @@ -554,8 +554,8 @@ void LyXText::toggleFree(LCursor & cur, LyXFont const & font, bool toggleall) // If the mask is completely neutral, tell user if (font == LyXFont(LyXFont::ALL_IGNORE)) { // Could only happen with user style - cur.message(_("No font change defined. " - "Use Character under the Layout menu to define font change.")); + cur.message(lyx::to_utf8(_("No font change defined. " + "Use Character under the Layout menu to define font change."))); return; } @@ -596,9 +596,9 @@ string LyXText::getStringToIndex(LCursor const & cur) selectWord(tmpcur, lyx::PREVIOUS_WORD); if (!tmpcur.selection()) - cur.message(_("Nothing to index!")); + cur.message(lyx::to_utf8(_("Nothing to index!"))); else if (tmpcur.selBegin().pit() != tmpcur.selEnd().pit()) - cur.message(_("Cannot index more than one paragraph!")); + cur.message(lyx::to_utf8(_("Cannot index more than one paragraph!"))); else idxstring = tmpcur.selectionAsString(false); } @@ -803,8 +803,8 @@ pos_type LyXText::getColumnNearX(pit_type const pit, c = bidi.vis2log(vc); last_tmpx = tmpx; if (body_pos > 0 && c == body_pos - 1) { - string lsep = layout->labelsep; - docstring dlsep(lsep.begin(), lsep.end()); + string lsep = layout->labelsep; + docstring dlsep(lsep.begin(), lsep.end()); tmpx += r.label_hfill + font_metrics::width(dlsep, getLabelFont(par)); if (par.isLineSeparator(body_pos - 1)) diff --git a/src/text3.C b/src/text3.C index b4ea505061..27e5b90367 100644 --- a/src/text3.C +++ b/src/text3.C @@ -690,7 +690,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) } else if (tmp == "default") { new_spacing = Spacing::Default; } else { - lyxerr << _("Unknown spacing argument: ") + lyxerr << lyx::to_utf8(_("Unknown spacing argument: ")) << lyx::to_utf8(cmd.argument()) << endl; } if (cur_spacing != new_spacing || cur_value != new_value) @@ -763,7 +763,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) break; case LFUN_PASTE: - cur.message(_("Paste")); + cur.message(lyx::to_utf8(_("Paste"))); lyx::cap::replaceSelection(cur); if (isStrUnsignedInt(lyx::to_utf8(cmd.argument()))) pasteSelection(cur, bv->buffer()->errorList("Paste"), @@ -779,12 +779,12 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) case LFUN_CUT: cutSelection(cur, true, true); - cur.message(_("Cut")); + cur.message(lyx::to_utf8(_("Cut"))); break; case LFUN_COPY: copySelection(cur); - cur.message(_("Copy")); + cur.message(lyx::to_utf8(_("Copy"))); break; case LFUN_SERVER_GET_XY: @@ -828,7 +828,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) // function list/array with information about what // functions needs arguments and their type. if (cmd.argument().empty()) { - cur.errorMessage(_("LyX function 'layout' needs an argument.")); + cur.errorMessage(lyx::to_utf8(_("LyX function 'layout' needs an argument."))); break; } @@ -1306,7 +1306,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) case LFUN_FONT_FREE_APPLY: toggleAndShow(cur, this, freefont, toggleall); - cur.message(_("Character set")); + cur.message(lyx::to_utf8(_("Character set"))); break; // Set the freefont using the contents of \param data dispatched from @@ -1318,7 +1318,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) freefont = font; toggleall = toggle; toggleAndShow(cur, this, freefont, toggleall); - cur.message(_("Character set")); + cur.message(lyx::to_utf8(_("Character set"))); } break; } @@ -1451,7 +1451,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) params.align(), params.labelWidthString(), params.noindent()); - cur.message(_("Paragraph layout set")); + cur.message(lyx::to_utf8(_("Paragraph layout set"))); break; } diff --git a/src/vspace.C b/src/vspace.C index 3e80d370a2..d97cb8eca3 100644 --- a/src/vspace.C +++ b/src/vspace.C @@ -484,26 +484,26 @@ string const VSpace::asGUIName() const string result; switch (kind_) { case DEFSKIP: - result = _("Default skip"); + result = lyx::to_utf8(_("Default skip")); break; case SMALLSKIP: - result = _("Small skip"); + result = lyx::to_utf8(_("Small skip")); break; case MEDSKIP: - result = _("Medium skip"); + result = lyx::to_utf8(_("Medium skip")); break; case BIGSKIP: - result = _("Big skip"); + result = lyx::to_utf8(_("Big skip")); break; case VFILL: - result = _("Vertical fill"); + result = lyx::to_utf8(_("Vertical fill")); break; case LENGTH: result = len_.asString(); break; } if (keep_) - result += ", " + _("protected"); + result += ", " + lyx::to_utf8(_("protected")); return result; } -- 2.39.5