]> git.lyx.org Git - features.git/commitdiff
Change _() to return a docstring. Fixup callers with the help of lyx::to_utf8.
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 9 Sep 2006 15:27:44 +0000 (15:27 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 9 Sep 2006 15:27:44 +0000 (15:27 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14952 a592a061-630c-0410-9148-cb99ea01b6c8

208 files changed:
src/BufferView_pimpl.C
src/Chktex.C
src/CutAndPaste.C
src/LColor.C
src/LaTeX.C
src/MenuBackend.C
src/SpellBase.C
src/ToolbarBackend.C
src/buffer.C
src/buffer_funcs.C
src/bufferlist.C
src/bufferparams.C
src/bufferview_funcs.C
src/converter.C
src/debug.C
src/exporter.C
src/format.C
src/frontends/LyXView.C
src/frontends/Toolbars.C
src/frontends/WorkArea.C
src/frontends/controllers/ControlAboutlyx.C
src/frontends/controllers/ControlBibtex.C
src/frontends/controllers/ControlBox.C
src/frontends/controllers/ControlErrorList.C
src/frontends/controllers/ControlExternal.C
src/frontends/controllers/ControlGraphics.C
src/frontends/controllers/ControlInclude.C
src/frontends/controllers/ControlLog.C
src/frontends/controllers/ControlPrefs.C
src/frontends/controllers/ControlPrint.C
src/frontends/controllers/ControlSpellchecker.C
src/frontends/controllers/ControlToc.C
src/frontends/controllers/ControlViewSource.C
src/frontends/controllers/biblio.C
src/frontends/controllers/character.C
src/frontends/controllers/frnt_lang.C
src/frontends/controllers/helper_funcs.C
src/frontends/controllers/tex_helpers.C
src/frontends/gtk/Dialogs.C
src/frontends/gtk/GAboutlyx.C
src/frontends/gtk/GBC.h
src/frontends/gtk/GBibItem.C
src/frontends/gtk/GBibtex.C
src/frontends/gtk/GBox.C
src/frontends/gtk/GBranch.C
src/frontends/gtk/GChanges.C
src/frontends/gtk/GCharacter.C
src/frontends/gtk/GCitation.C
src/frontends/gtk/GDocument.C
src/frontends/gtk/GERT.C
src/frontends/gtk/GErrorList.C
src/frontends/gtk/GExternal.C
src/frontends/gtk/GFloat.C
src/frontends/gtk/GGraphics.C
src/frontends/gtk/GInclude.C
src/frontends/gtk/GLog.C
src/frontends/gtk/GMathDelim.C
src/frontends/gtk/GMathPanel.C
src/frontends/gtk/GMathsMatrix.C
src/frontends/gtk/GNote.C
src/frontends/gtk/GParagraph.C
src/frontends/gtk/GPreferences.C
src/frontends/gtk/GRef.C
src/frontends/gtk/GSearch.C
src/frontends/gtk/GSendto.C
src/frontends/gtk/GShowFile.C
src/frontends/gtk/GSpellchecker.C
src/frontends/gtk/GTableCreate.C
src/frontends/gtk/GTabular.C
src/frontends/gtk/GTexinfo.C
src/frontends/gtk/GThesaurus.C
src/frontends/gtk/GToc.C
src/frontends/gtk/GUrl.C
src/frontends/gtk/GVSpace.C
src/frontends/gtk/GWrap.C
src/frontends/qt3/Alert_pimpl.C
src/frontends/qt3/Dialogs.C
src/frontends/qt3/FileDialog.C
src/frontends/qt3/QAbout.C
src/frontends/qt3/QBibitem.C
src/frontends/qt3/QBibtex.C
src/frontends/qt3/QBox.C
src/frontends/qt3/QBranch.C
src/frontends/qt3/QChanges.C
src/frontends/qt3/QCharacter.C
src/frontends/qt3/QCitation.C
src/frontends/qt3/QDocument.C
src/frontends/qt3/QDocumentDialog.C
src/frontends/qt3/QERT.C
src/frontends/qt3/QExternal.C
src/frontends/qt3/QFloat.C
src/frontends/qt3/QGraphics.C
src/frontends/qt3/QInclude.C
src/frontends/qt3/QMath.C
src/frontends/qt3/QNote.C
src/frontends/qt3/QParagraph.C
src/frontends/qt3/QPrefs.C
src/frontends/qt3/QPrefsDialog.C
src/frontends/qt3/QPrint.C
src/frontends/qt3/QRef.C
src/frontends/qt3/QSearch.C
src/frontends/qt3/QSendto.C
src/frontends/qt3/QShowFile.C
src/frontends/qt3/QSpellchecker.C
src/frontends/qt3/QTabular.C
src/frontends/qt3/QTabularCreate.C
src/frontends/qt3/QTexinfo.C
src/frontends/qt3/QThesaurus.C
src/frontends/qt3/QToc.C
src/frontends/qt3/QURL.C
src/frontends/qt3/QVSpace.C
src/frontends/qt3/QWrap.C
src/frontends/qt3/Qt2BC.h
src/frontends/qt3/validators.C
src/frontends/qt4/Alert_pimpl.C
src/frontends/qt4/Dialogs.C
src/frontends/qt4/FileDialog.C
src/frontends/qt4/QAbout.C
src/frontends/qt4/QBibitem.C
src/frontends/qt4/QBibtex.C
src/frontends/qt4/QBox.C
src/frontends/qt4/QBranch.C
src/frontends/qt4/QChanges.C
src/frontends/qt4/QCharacter.C
src/frontends/qt4/QDocument.C
src/frontends/qt4/QDocumentDialog.C
src/frontends/qt4/QERT.C
src/frontends/qt4/QExternal.C
src/frontends/qt4/QFloat.C
src/frontends/qt4/QGraphics.C
src/frontends/qt4/QInclude.C
src/frontends/qt4/QMath.C
src/frontends/qt4/QNote.C
src/frontends/qt4/QParagraph.C
src/frontends/qt4/QPrefs.C
src/frontends/qt4/QPrefsDialog.C
src/frontends/qt4/QPrint.C
src/frontends/qt4/QRef.C
src/frontends/qt4/QSearch.C
src/frontends/qt4/QSendto.C
src/frontends/qt4/QShowFile.C
src/frontends/qt4/QSpellchecker.C
src/frontends/qt4/QTabular.C
src/frontends/qt4/QTabularCreate.C
src/frontends/qt4/QTexinfo.C
src/frontends/qt4/QThesaurus.C
src/frontends/qt4/QVSpace.C
src/frontends/qt4/QWrap.C
src/frontends/qt4/Qt2BC.h
src/frontends/qt4/UrlView.C
src/frontends/qt4/qt_helpers.C
src/frontends/qt4/validators.C
src/gettext.C
src/gettext.h
src/importer.C
src/insets/insetbase.C
src/insets/insetbibtex.C
src/insets/insetbox.C
src/insets/insetbranch.C
src/insets/insetcaption.C
src/insets/insetcaption.h
src/insets/insetcharstyle.C
src/insets/insetenv.C
src/insets/insetert.C
src/insets/insetexternal.C
src/insets/insetfloat.C
src/insets/insetfloatlist.C
src/insets/insetfoot.C
src/insets/insetgraphics.C
src/insets/insetinclude.C
src/insets/insetindex.C
src/insets/insetmarginal.C
src/insets/insetnote.C
src/insets/insetoptarg.C
src/insets/insetpagebreak.C
src/insets/insetref.C
src/insets/insettabular.C
src/insets/insettext.C
src/insets/insettoc.C
src/insets/inseturl.C
src/insets/insetvspace.C
src/insets/insetwrap.C
src/insets/render_graphic.C
src/insets/render_preview.C
src/ispell.C
src/kbsequence.C
src/lyx_cb.C
src/lyx_main.C
src/lyxfind.C
src/lyxfont.C
src/lyxfunc.C
src/lyxrc.C
src/lyxvc.C
src/mathed/math_gridinset.C
src/mathed/math_hullinset.C
src/mathed/math_macrotemplate.C
src/mathed/math_nestinset.C
src/mathed/ref_inset.C
src/output.C
src/output_plaintext.C
src/paragraph.C
src/rowpainter.C
src/support/filefilterlist.C
src/support/package.C.in
src/text.C
src/text2.C
src/text3.C
src/vspace.C

index 7130d456172f07597cc2c75ed9a24efe5ef1726c..136a45e19d43771f597d8adec6462a5fe09f5496 100644 (file)
@@ -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;
        }
 
index 8ca81b294c1e3b784f36989859ecda70cd4ef22b..6ae01d7df850bc8c83da896f489fd957db0dad66 100644 (file)
@@ -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)) {
index 8dc3e7be8a20fb2b9d4bd257f67ebd4aeed4d2d8..32e862797cf252faaf4500a1de75e5bd7ef3f03b 100644 (file)
@@ -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);
index 08badd8b1079bb2d71d57c9b0bbe998ede5e43c4..b63f716fbd59a400f8745d6e1dcc2db0dfc6b4be 100644 (file)
@@ -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;
index b2866bbd21041a7a5f9c696b663069b29ccd817c..5c5a966eb4a19a452bde36066086b8889ba7b1bf 100644 (file)
@@ -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);
        }
 
index 10b2c99e0b51fa53fc5c247720fbeccbb1b018f8..795ed667ce74990f85e58bc3d09c8dde2460b18a 100644 (file)
@@ -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 {
index 7b5b04e1bfbf176e6228f3028ea00f9d01c0c994..3fbe1751549118675853e1a84e5df594d9d87974 100644 (file)
@@ -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."));
 }
index fe848c6b83a0bbf4ca6db8e31ca4a7a632e8cc47..b4cd8042fe8bc3377b10e15b0e5c3e7943bc1786 100644 (file)
@@ -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]
index d92deff60c02ae23a1e67904c6cb3bbe039d7380..21b8b37aaa967b5c9993c9bfd26c00b7545a1863 100644 (file)
@@ -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);
 }
 
 
index f796951aa29f7569bfd3e8d07ce3796e08cea4a3..0de992187c5a135520c022edfaa181bb3df799c6 100644 (file)
@@ -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
index 861bb6fb43bab197ca981a2d719775cadd28f3f5..ae1057bfcf264300a9400400ab6979a63d582d96 100644 (file)
@@ -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;
 }
 
 
index 8b105ec539ccefc5fe031e34cd5bea22cf962a8c..243a7df3a6821ebb2245147a4b8d0613dbb65ac5 100644 (file)
@@ -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") {
index 2125c5706b5eae0b73e56904c3b762aa0d0bd700..8669126de95936f4c221eab1f3b49b8f46b8089d 100644 (file)
@@ -300,7 +300,7 @@ void gotoInset(BufferView * bv, vector<InsetBase_code> 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;
        }
 
index 5dc703fed9e1dfbc5f23fe74735f94b8868abd7c..ad54732087a3e66bce829c898f500bd9f1ef8df6 100644 (file)
@@ -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.")));
        }
 
 
index 2b4badfcfabc86a6175d55a892d596b174911f25..f27ee939422c2c270616a64b44d90b84e16a720c 100644 (file)
@@ -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<unsigned int>(errorTags[i].level)
                   << setw(10) << errorTags[i].name
-                  << "  " << _(errorTags[i].desc) << '\n';
+                  << "  " << lyx::to_utf8(_(errorTags[i].desc)) << '\n';
        os.flush();
 }
 
index 39ff61944074f47a8a44a6d531f8ba185f7136e0..73e257be524ee9a681f20d42c45e14721f1e9e2f 100644 (file)
@@ -74,13 +74,13 @@ vector<string> 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)));
                }
        }
index a8fd1f2828bb1923f7050c5701d6f162500e84fa..f4e88d68add0abfd0232a09c56fabfdc32ec682d 100644 (file)
@@ -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;
        }
index aba2a2658f65cca735848dd697a6c1734cf3b58f..35ad7bce60ccaf3cd6f4e65e51b40efc6b8efce6 100644 (file)
@@ -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)"));
                }
        }
 
index ac7c2017cd66d8b770d4ad66373082575b1811ad..7ca15c0afc48140e60906cad39b2f6c008538387 100644 (file)
@@ -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);
index b2ada8e48a496937563d170f89258652e6444ce1..c7fc36dfd777126079d03699f47a5ad6ea7f708b 100644 (file)
@@ -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();
index d7deb90ec7bc934a52b041983ce7d3c5310aec39..9d375777de7892a99cd140cdfa85e58a121c260c 100644 (file)
@@ -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();
index 37ab488b0d9899b34ec30d8b77c3e7d3b79bdef6..5e6c7afb2dac2370e1636184aa7743d10ac975a0 100644 (file)
@@ -50,22 +50,24 @@ ControlBibtex::ControlBibtex(Dialog & d)
 
 string const ControlBibtex::browseBib(string const & in_name) const
 {
-       pair<string, string> dir1(_("Documents|#o#O"),
+       // FIXME UNICODE
+       pair<string, string> 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<string, string> dir1(_("Documents|#o#O"),
+       // FIXME UNICODE
+       pair<string, string> 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);
 }
 
 
index c73b173edad89bddc1d4d42b60df544e64c0c0a4..615bbf2b7ba9c5a42290f741887bab2755d12853 100644 (file)
@@ -59,12 +59,13 @@ void box_gui_tokens(vector<string> & ids, vector<string> & gui_names)
        size_t const ids_size = sizeof(ids_) / sizeof(char *);
        ids = vector<string>(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<string> & ids,
@@ -76,11 +77,12 @@ void box_gui_tokens_special_length(vector<string> & ids,
        size_t const ids_size = sizeof(ids_) / sizeof(char *);
        ids = vector<string>(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
index 4ea92b835ace206d0e9891527bb272868a32ab84..a76a310977e79a1a0eefacc80bc2ab1bc8494da0 100644 (file)
@@ -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;
index 520a1f4e2382eb1c9b8adfd545a1f7732147686d..37f417493e9283b160a0cc6eccd652f4f6b5c3ae 100644 (file)
@@ -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<RotationDataType> 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
index af2ef5532482d99c58f76a4e1919d43199f34ad7..a9d950410121e64c0281c66fb7d12125d9ab87ed 100644 (file)
@@ -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<string, string> dir1(_("Clipart|#C#c"), clipdir);
-       pair<string, string> dir2(_("Documents|#o#O"), string(lyxrc.document_path));
+       pair<string, string> dir1(lyx::to_utf8(_("Clipart|#C#c")), clipdir);
+       pair<string, string> 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<RotationOriginPair> 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]);
        }
 
index 7e497b9fd55b67fd6cbfd490506cded52abe3ecb..d0d7b4f8f9bf32456ea92c8f8b1da67368a5c76f 100644 (file)
@@ -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<string, string> dir1(N_("Documents|#o#O"),
index 2dd73a29302eb8d76bba912fe4071f5c255eaad0..026319f215ca54239559d5d9165738f67c5b57c1 100644 (file)
@@ -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;
        }
 }
index 13f587935afe29e1a22192c5ce2f97532e6a8afd..2ecdf043c4e29ce506864c5fe9e440ddcfbe4f98 100644 (file)
@@ -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"))));
 }
 
 
index 2405bc16a564227d9f134670b09e6753f2c0f14d..3749bf0d2af85e268344cd3486d4977621fc4b43 100644 (file)
@@ -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);
 }
 
index 44d565c1ed6a47aac48bb24a27d3e003648233a6..26a2cf4c918535317fb961d5efd97a6b9563ceb0 100644 (file)
@@ -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);
 }
 
 
index fae3cf7458165612e502d375bc522d618479d3d2..6b2a14937b43c82248657b6c511bcaa2696b053c 100644 (file)
@@ -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())));
 }
 
 
index c2b834c89148d4137e11f40fb2f6608d7c757aee..f1bfbd14ff88ec76a1ff3877f0c8adc144822f8d 100644 (file)
@@ -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
index 23aba00b22a951f9d5c2e02a1e853c37475de6cc..813000a0c3d421d74ba71353322267646a77dd9e 100644 (file)
@@ -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:
index d13387cf66046e49c36cadd522cd41b2f35142ad..a39e435a10a38db85f0753f62bdc0abccea88b7a 100644 (file)
@@ -26,23 +26,23 @@ vector<FamilyPair> 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<SeriesPair> 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<ShapePair> 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<SizePair> 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<BarPair> 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<ColorPair> 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;
 
index 1c3bee9ad7a5b2f7ff871353c167ff11743c12c8..638bdf9338c12d430af6fd5bf8ff1b371ca5c49f 100644 (file)
@@ -49,16 +49,16 @@ vector<LanguagePair> const getLanguageData(bool character_dlg)
        vector<LanguagePair> 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<string>::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;
        }
index 2aa81d893a7dd9a2580707f7f2241ed46a4632ce..333d8e50ec5db6267a35c8e845521a7bd83cb4d9 100644 (file)
@@ -97,10 +97,11 @@ string const browseLibFile(string const & dir,
                           string const & title,
                           FileFilterList const & filters)
 {
-       pair<string,string> const dir1(_("System files|#S#s"),
+       // FIXME UNICODE
+       pair<string,string> const dir1(lyx::to_utf8(_("System files|#S#s")),
                                       addName(package().system_support(), dir));
 
-       pair<string,string> const dir2(_("User files|#U#u"),
+       pair<string,string> const dir2(lyx::to_utf8(_("User files|#U#u")),
                                       addName(package().user_support(), dir));
 
        string const result = browseFile(libFileSearch(dir, name, ext), title,
index 2441403e73729fcdcd1aec4727f4550be2089b37..7046a8e229f4cec7b71c3af9c5a719330bda077f 100644 (file)
@@ -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));
 }
 
 
index 65abdfbf4df1258b3e84c9715df403bd2165a934..1d06ab22218e901b7669498549731aba1f82932e 100644 (file)
@@ -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));
index 96d98e5664971cb14bbec1bbc520daaa0ba0d534..f942a1f51aecabba536a07fcbd35d405192871c2 100644 (file)
@@ -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);
index 14885b44485e21b8366824eb5e65f8a3cdf28ad5..9990830275b12b9d71fec60eca506a23fcf29620 100644 (file)
@@ -24,8 +24,8 @@ namespace frontend {
 class GBC : public GuiBC<Gtk::Button, Gtk::Widget> {
 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;
index 1cbc2b4eb9d76e78cad76e8569f97fcc1a250679..2ac096ee63735e41eb84f64c3d2999d6a7110397 100644 (file)
@@ -29,8 +29,9 @@ using std::string;
 namespace lyx {
 namespace frontend {
 
+// FIXME UNICODE
 GBibItem::GBibItem(Dialog & parent)
-       : GViewCB<ControlCommand, GViewGladeB>(parent, _("Bibliography Entry Settings"), false)
+       : GViewCB<ControlCommand, GViewGladeB>(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()
index d1a33986519ee3edb6ee21dcc8ba24d44ff96d75..72cc9b9de23d30903a07a61df3ce7c3a09a00553 100644 (file)
@@ -37,8 +37,9 @@ using std::string;
 namespace lyx {
 namespace frontend {
 
+// FIXME UNICODE
 GBibtex::GBibtex(Dialog & parent)
-       : GViewCB<ControlBibtex, GViewGladeB>(parent, _("BibTeX Bibliography"), false)
+       : GViewCB<ControlBibtex, GViewGladeB>(parent, lyx::to_utf8(_("BibTeX Bibliography")), false)
 {}
 
 
index 4bc5e162d11050eddd3abb2a7cc1436965c657fe..b485b4127b47894143eff2faa0d3c0d084b37f37 100644 (file)
@@ -38,8 +38,9 @@ namespace {
 string defaultUnit("cm");
 } // namespace anon
 
+// FIXME UNICODE
 GBox::GBox(Dialog & parent)
-       : GViewCB<ControlBox, GViewGladeB>(parent, _("Box Settings"), false)
+       : GViewCB<ControlBox, GViewGladeB>(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);
 
index 18cf62fbbd554c580a7921a426c4254aa5c9485d..aeec17b9d5a3dc120214b9f5f85593f684d1abe2 100644 (file)
@@ -33,9 +33,9 @@ using std::string;
 namespace lyx {
 namespace frontend {
 
-
+// FIXME UNICODE
 GBranch::GBranch(Dialog & parent)
-       : GViewCB<ControlBranch, GViewGladeB>(parent, _("Branch Settings"), false)
+       : GViewCB<ControlBranch, GViewGladeB>(parent, lyx::to_utf8(_("Branch Settings")), false)
 {}
 
 
index 771ac148e0658e2d12d441991ea6ba00f4805ec4..728a6a4514d85f36cc38252176d50be3b4b1d90f 100644 (file)
@@ -28,9 +28,9 @@ using std::string;
 namespace lyx {
 namespace frontend {
 
-
+// FIXME UNICODE
 GChanges::GChanges(Dialog & parent)
-       : GViewCB<ControlChanges, GViewGladeB>(parent, _("Merge Changes"), false)
+       : GViewCB<ControlChanges, GViewGladeB>(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("<big><b>" + header +
-                               "</b></big>\n\nChanged by <b>" + author
-                               + "</b> on <b>" + date + "</b>");
+                               "</b></big>\n\nChanged by <b>" + author
+                               + "</b> on <b>" + date + "</b>");
 
        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("<big><b>" + header +
-                               "</b></big>");
+                               "</b></big>");
 
        // Disable all buttons but close.
        acceptbutton_->set_sensitive(false);
index c3caa93a718ca204f1cd1c6c3fc86adfbfe1c596..bb88a695ccaddbe3e6d2eed75b230d9e0eafedab 100644 (file)
@@ -35,9 +35,9 @@ using std::string;
 namespace lyx {
 namespace frontend {
 
-
+// FIXME UNICODE
 GCharacter::GCharacter(Dialog & parent)
-       : GViewCB<ControlCharacter, GViewGladeB>(parent, _("Text Style"), false)
+       : GViewCB<ControlCharacter, GViewGladeB>(parent, lyx::to_utf8(_("Text Style")), false)
 {}
 
 
index e49b33beb520d1a49ec97201b934ffbdaa3d99b1..a9f50033be1003819592f510cab330b87327571c 100644 (file)
@@ -67,8 +67,9 @@ bool GCitation::bib_visible(const Gtk::TreeModel::const_iterator& iter)
 styleModelColumns styleColumns;
 
 
+// FIXME UNICODE
 GCitation::GCitation(Dialog & parent)
-       : GViewCB<ControlCitation, GViewGladeB>(parent, _("Citation"), false)
+       : GViewCB<ControlCitation, GViewGladeB>(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();
index 067364ecb5f0244966f473c097e1327a780f91b1..3afbd20c2a2c696c76da54f3a81c69b96fde7f9c 100644 (file)
@@ -55,8 +55,9 @@ char const * const encodings[] = { "Language Default", "LaTeX default",
 }
 
 
+// FIXME UNICODE
 GDocument::GDocument(Dialog & parent)
-       : GViewCB<ControlDocument, GViewGladeB>(parent, _("Document Settings"), false),
+       : GViewCB<ControlDocument, GViewGladeB>(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("<i>" + numberinglabels[value] + "</i>");
+       // FIXME UNICODE
+       numberinglabel_->set_label("<i>" + lyx::to_utf8(numberinglabels[value]) + "</i>");
 }
 
 
 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("<i>" + TOClabels[value] + "</i>");
+       // FIXME UNICODE
+       TOClabel_->set_label("<i>" + lyx::to_utf8(TOClabels[value]) + "</i>");
 }
 
 
index ef0b5c4023ad074c893f6c505340809fdff8d17d..438217e743e873cf55ce73e5bf9e833fd93d9d91 100644 (file)
@@ -30,7 +30,7 @@ namespace lyx {
 namespace frontend {
 
 GERT::GERT(Dialog & parent)
-       : GViewCB<ControlERT, GViewGladeB>(parent, _("TeX Settings"), false)
+       : GViewCB<ControlERT, GViewGladeB>(parent, lyx::to_utf8(_("TeX Settings")), false)
 {}
 
 
index 83fdfbbffe34083c5badbfac6f8e773acc18da81..8a0970b26bbf6d2d72d9c009cd36a224e3055314 100644 (file)
@@ -29,7 +29,7 @@ namespace lyx {
 namespace frontend {
 
 GErrorList::GErrorList(Dialog & parent)
-       : GViewCB<ControlErrorList, GViewGladeB>(parent, _("Errors"), false)
+       : GViewCB<ControlErrorList, GViewGladeB>(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;
        }
index a6a0704c322d86be493012d79da46644b6e30c75..70c967cc78b7d7f4d0d954bf6808ceaf4d007de9 100644 (file)
@@ -114,27 +114,27 @@ std::vector<Gtk::FileFilter* > 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 Gtk::TreeModel> const display_store = 
+       Glib::RefPtr<const Gtk::TreeModel> 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<ControlExternal, GViewGladeB>(parent, _("External Settings"), false)
+       : GViewCB<ControlExternal, GViewGladeB>(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);
 }
index 816b86afe181f1ce7f5901428bd9c62505c9c619..277a0afc1bca713c2b9b5a330e0dba93bb97d61e 100644 (file)
@@ -38,7 +38,7 @@ using support::contains;
 namespace frontend {
 
 GFloat::GFloat(Dialog & parent)
-       : GViewCB<ControlFloat, GViewGladeB>(parent, _("Float Settings"), false)
+       : GViewCB<ControlFloat, GViewGladeB>(parent, lyx::to_utf8(_("Float Settings")), false)
 {}
 
 
index 14f53632b416c5b89b996ad0c54b9ef0b1c35497..353df6fdbdf4e1af44229e2bb63cf78350202a08 100644 (file)
@@ -50,7 +50,7 @@ string defaultUnit("cm");
 } // namespace anon
 
 GGraphics::GGraphics(Dialog & parent)
-       : GViewCB<ControlGraphics, GViewGladeB>(parent, _("Graphics"), false)
+       : GViewCB<ControlGraphics, GViewGladeB>(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);
 }
index 6420c4c3c34902078ed6d4c232e8684ac344bcc4..e2616685c833f68d52be01ca45ec080b9ebd63fe 100644 (file)
@@ -31,7 +31,7 @@ namespace lyx {
 namespace frontend {
 
 GInclude::GInclude(Dialog & parent)
-       : GViewCB<ControlInclude, GViewGladeB>(parent, _("Child Document"), false)
+       : GViewCB<ControlInclude, GViewGladeB>(parent, lyx::to_utf8(_("Child Document")), false)
 {}
 
 
index dba2a814eee5b10fed03d13b2ecd4536f27a40aa..57b8f7312c4ded55862e58914f62b067fc274cff 100644 (file)
@@ -31,7 +31,7 @@ namespace lyx {
 namespace frontend {
 
 GLog::GLog(Dialog & parent)
-       : GViewCB<ControlLog, GViewGladeB>(parent, _("Log Viewer"), false)
+       : GViewCB<ControlLog, GViewGladeB>(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
index d94e4acf5ada9ed6e3086e1203f408444e72a3e3..c113c544a618d067e34df137af3a7b9edbf05f97 100644 (file)
@@ -104,7 +104,7 @@ inline int indexToCol(int index)
 
 
 GMathDelim::GMathDelim(Dialog & parent) :
-       GViewCB<ControlMath, GViewGladeB>(parent, _("Math Delimiters")),
+       GViewCB<ControlMath, GViewGladeB>(parent, lyx::to_utf8(_("Math Delimiters"))),
        delimTbl_(delimTblRows, delimTblCols, xbm)
 {
 }
index 2181511218c10eb5657b53f31ff94560af27cd10..57226e681f7aa0c1c60153c9f189abce5cc613ac 100644 (file)
@@ -104,7 +104,7 @@ GXpmBtnTbl::XpmData xpmDown[] =
 
 
 GMathPanel::GMathPanel(Dialog & parent)
-       : GViewCB<ControlMath, GViewGladeB>(parent, _("Math Panel")),
+       : GViewCB<ControlMath, GViewGladeB>(parent, lyx::to_utf8(_("Math Panel"))),
          tableUp_(2, 5, xpmUp), tableDown_(4, 3, xpmDown)
 {
 }
index 3cfd4649c16532739a9b6908afb93fbe10c039dd..00e72880638241eba81dd736b9576414c0f92a19 100644 (file)
@@ -35,7 +35,7 @@ namespace frontend {
 
 
 GMathsMatrix::GMathsMatrix(Dialog & parent)
-       : GViewCB<ControlMath, GViewGladeB>(parent, _("Math Matrix"), false)
+       : GViewCB<ControlMath, GViewGladeB>(parent, lyx::to_utf8(_("Math Matrix")), false)
 {}
 
 
index 65a622154c05e2e7e88d6cd21179f9067459ed23..eb8735e9f34bdb3e0bb8d13c542ffdbe81da7b29 100644 (file)
@@ -32,7 +32,7 @@ namespace lyx {
 namespace frontend {
 
 GNote::GNote(Dialog & parent)
-       : GViewCB<ControlNote, GViewGladeB>(parent, _("Note Settings"), false)
+       : GViewCB<ControlNote, GViewGladeB>(parent, lyx::to_utf8(_("Note Settings")), false)
 {}
 
 
index ecaf2d4073fc7fb9f116efb5f1eeeec77f73d4ce..7d8aa727febd3fd90e3660252e8d59daf57a27ff 100644 (file)
@@ -41,7 +41,7 @@ namespace {
 
 
 GParagraph::GParagraph(Dialog & parent)
-       : GViewCB<ControlParagraph, GViewGladeB>(parent, _("Paragraph Settings"), false)
+       : GViewCB<ControlParagraph, GViewGladeB>(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();
index 31d9635afd304bfda2c648e5984ad54fd0a97969..928a4d5d235a077736f26c1c935b41e77a5d1376 100644 (file)
@@ -35,7 +35,7 @@ namespace lyx {
 namespace frontend {
 
 GPreferences::GPreferences(Dialog & parent)
-       : GViewCB<ControlPrefs, GViewGladeB>(parent, _("Preferences"), false)
+       : GViewCB<ControlPrefs, GViewGladeB>(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<LanguagePair> 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()];
index a354f1ed933923220418b4b9edfaaf5a24de3851..5efd8a5e9525ee81f00c6e5f97be3f0e1f2569fe 100644 (file)
@@ -62,7 +62,7 @@ bufferModelColumns bufferColumns;
 
 
 GRef::GRef(Dialog & parent)
-       : GViewCB<ControlRef, GViewGladeB>(parent, _("Cross-reference"), false)
+       : GViewCB<ControlRef, GViewGladeB>(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<string>::const_iterator it = buffers.begin();
        vector<string>::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_);
index 0db25350f21948b42edb67df5577cbcf84db6947..54a77c4554b89365f5e5efe988ba6f0d85491f43 100644 (file)
@@ -33,7 +33,7 @@ typedef GViewCB<ControlSearch, GViewGladeB> 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);
 }
 
 
index 4ff9179baeb44b285ac012b1c23eaeb26390241f..26aa55f159e7fa996cb5fc2d1162e56c6264340e 100644 (file)
@@ -33,7 +33,7 @@ namespace lyx {
 namespace frontend {
 
 GSendto::GSendto(Dialog & parent)
-       : GViewCB<ControlSendto, GViewGladeB>(parent, _("Send document to command"), false)
+       : GViewCB<ControlSendto, GViewGladeB>(parent, lyx::to_utf8(_("Send document to command")), false)
 {}
 
 
index a6df1ce3fd56b2c46d1f578674104e21b95db7be..2a9594ca951022d2c1d24610a896bff813d2b04a 100644 (file)
@@ -29,7 +29,7 @@ namespace lyx {
 namespace frontend {
 
 GShowFile::GShowFile(Dialog & parent)
-       : GViewCB<ControlShowFile, GViewGladeB>(parent, _("Show File"), false)
+       : GViewCB<ControlShowFile, GViewGladeB>(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
index f0d7332d6cfb606b657da8f4ef156b42234f736a..d67c6860eb49a654d50973f23145fcb884c10af3 100644 (file)
@@ -31,8 +31,7 @@ namespace lyx {
 namespace frontend {
 
 GSpellchecker::GSpellchecker(Dialog & parent)
-       : GViewCB<ControlSpellchecker, GViewGladeB>
-               (parent, _("Spellchecker"), false)
+       : GViewCB<ControlSpellchecker, GViewGladeB>(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<string>(progress) + "% " + _("checked"));
+               progress_->set_text(convert<string>(progress) + "% " + lyx::to_utf8(_("checked")));
        }
 }
 
index 6f172ff2cac4567014044cea0436620db156f224..5c208c548d1bc5ff92a7d7f44e0d66021fb09717 100644 (file)
@@ -31,7 +31,7 @@ namespace lyx {
 namespace frontend {
 
 GTableCreate::GTableCreate(Dialog & parent)
-       : GViewCB<ControlTabularCreate, GViewGladeB>(parent, _("Insert Table"))
+       : GViewCB<ControlTabularCreate, GViewGladeB>(parent, lyx::to_utf8(_("Insert Table")))
 {
 }
 
index f68c1482a38005acfa7781ce0c816dec314087e1..103c02d603a55bcced2d5b3f54c1f217f58dd4ea 100644 (file)
@@ -39,7 +39,7 @@ namespace lyx {
 namespace frontend {
 
 GTabular::GTabular(Dialog & parent)
-       : GViewCB<ControlTabular, GViewGladeB>(parent, _("Table Settings"), false)
+       : GViewCB<ControlTabular, GViewGladeB>(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
index 1a4c5941f0cc4dc623304357cf0b2d498ee3dedb..81038c721aa321e23f2717104f39cb825fab2507 100644 (file)
@@ -34,7 +34,7 @@ namespace frontend {
 
 
 GTexinfo::GTexinfo(Dialog & parent)
-       : GViewCB<ControlTexinfo, GViewGladeB>(parent, _("TeX Information"), false),
+       : GViewCB<ControlTexinfo, GViewGladeB>(parent, lyx::to_utf8(_("TeX Information")), false),
          activeStyle(ControlTexinfo::cls)
 {}
 
@@ -80,18 +80,18 @@ void GTexinfo::doBuild() {
                sigc::mem_fun(*this, &GTexinfo::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();
index 4b7f8d659cc8fb7f96ee3023ff5f1be9118c3834..331995ef96bffd2dc458e96f5caecb0fb485fa31 100644 (file)
@@ -44,7 +44,7 @@ synModelColumns synColumns;
 
 
 GThesaurus::GThesaurus(Dialog & parent)
-       : GViewCB<ControlThesaurus, GViewGladeB>(parent, _("Thesaurus"), false)
+       : GViewCB<ControlThesaurus, GViewGladeB>(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<string>::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_);
index 1c812c875ceac0a96ec48c83bdb63b3ff0da3cc8..3eee0a40ab49fdc0b4f4d36d1f366a65bbae4023 100644 (file)
@@ -30,7 +30,7 @@ namespace lyx {
 namespace frontend {
 
 GToc::GToc(Dialog & parent)
-       : GViewCB<ControlToc, GViewGladeB>(parent, _("Table of Contents"), false)
+       : GViewCB<ControlToc, GViewGladeB>(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;
        }
index 6b762dd65a63f0756ccc7227d72847b6322218a9..76f344fa019c27d38156d8d55b76119edd20b16c 100644 (file)
@@ -34,7 +34,7 @@ namespace frontend {
 
 
 GUrl::GUrl(Dialog & parent)
-       : GViewCB<ControlCommand, GViewGladeB>(parent, _("URL"))
+       : GViewCB<ControlCommand, GViewGladeB>(parent, lyx::to_utf8(_("URL")))
 {
 }
 
index 44991567a251542816767eec4e3e073b4fc3a80b..f3e3aeed8e11a12afcac583d73d1df83cd36ff8b 100644 (file)
@@ -31,7 +31,7 @@ namespace lyx {
 namespace frontend {
 
 GVSpace::GVSpace(Dialog & parent)
-       : GViewCB<ControlVSpace, GViewGladeB>(parent, _("VSpace Settings"), false)
+       : GViewCB<ControlVSpace, GViewGladeB>(parent, lyx::to_utf8(_("VSpace Settings")), false)
 {}
 
 
index 1435e4ee68b1b91ee5cff5b60d24dfb1f0999e9f..20c2dc656af4af08fdf156435f34fe9e29de6c1f 100644 (file)
@@ -32,7 +32,7 @@ namespace lyx {
 namespace frontend {
 
 GWrap::GWrap(Dialog & parent)
-       : GViewCB<ControlWrap, GViewGladeB>(parent, _("Text Wrap Settings"), false)
+       : GViewCB<ControlWrap, GViewGladeB>(parent, lyx::to_utf8(_("Text Wrap Settings")), false)
 {}
 
 
index 49b631d0019a0c8bee006d4b869a905a6e240c8f..2e0986b08520d6b915203ceeae70ee7bac642fc3 100644 (file)
@@ -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));
index bd273e23d4340148c1ec0c481607bd8088601846..f923071af50fde83b1b38a68525fd871e6a6d7d4 100644 (file)
@@ -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") {
index 9160319c1b5cf9a9720dd5db3b85aa8f8c5c9041..d23c3d087bcee61f13df14955553ae2f89f84d60 100644 (file)
@@ -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);
 
index 50588c1bb7272d439f037bb1088bd2f074f7e950..b6f03cfbc74b8153be5c553bfc352b7698f982cd 100644 (file)
@@ -41,7 +41,7 @@ namespace frontend {
 typedef QController<ControlAboutlyx, QView<QAboutDialog> > base_class;
 
 QAbout::QAbout(Dialog & parent)
-       : base_class(parent, _("About LyX"))
+       : base_class(parent, lyx::to_utf8(_("About LyX")))
 {
 }
 
index 5d4ea733a5c4d72c979d77470f491e58fd7b6627..e338343788aaf0c5f081ef7b7baff7e27883dc9a 100644 (file)
@@ -28,7 +28,7 @@ typedef QController<ControlCommand, QView<QBibitemDialog> > base_class;
 
 
 QBibitem::QBibitem(Dialog & parent)
-       : base_class(parent, _("Bibliography Entry Settings"))
+       : base_class(parent, lyx::to_utf8(_("Bibliography Entry Settings")))
 {
 }
 
index 2a1e30b8269610efe6ea62e88c0aa66b450fb5d3..bb64313984a41986a6baf94557c45ad17846196c 100644 (file)
@@ -45,7 +45,7 @@ namespace frontend {
 typedef QController<ControlBibtex, QView<QBibtexDialog> > base_class;
 
 QBibtex::QBibtex(Dialog & parent)
-       : base_class(parent, _("BibTeX Bibliography"))
+       : base_class(parent, lyx::to_utf8(_("BibTeX Bibliography")))
 {
 }
 
index 65a64c4283b847cc7418c9f7c1ea3f7220ab15a8..fec3843b38b30a77af6d0dc3b2f8203d2b78e98d 100644 (file)
@@ -48,7 +48,7 @@ namespace frontend {
 typedef QController<ControlBox, QView<QBoxDialog> > base_class;
 
 QBox::QBox(Dialog & parent)
-       : base_class(parent, _("Box Settings"))
+       : base_class(parent, lyx::to_utf8(_("Box Settings")))
 {}
 
 
index a5ba149ebba254a177c4e5ddb3d4b7874454fb49..25602180093f26a3321cefb10f302c52747e99ef 100644 (file)
@@ -33,7 +33,7 @@ typedef QController<ControlBranch, QView<QBranchDialog> > base_class;
 
 
 QBranch::QBranch(Dialog & parent)
-       : base_class(parent, _("Branch Settings"))
+       : base_class(parent, lyx::to_utf8(_("Branch Settings")))
 {}
 
 
index 16a2c1c2303db0205991c98eb5244fc29cfc251b..f465799df2724bda4002c968d4c7c4feba47dfaf 100644 (file)
@@ -33,7 +33,7 @@ typedef QController<ControlChanges, QView<QChangesDialog> > 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));
 }
index ef92642f7142c85d9a289f8ff9cefbb10ae46b5b..04ef3c52027e6d023f1a459096dc5294036a0ff3 100644 (file)
@@ -32,7 +32,7 @@ typedef QController<ControlCharacter, QView<QCharacterDialog> > base_class;
 
 
 QCharacter::QCharacter(Dialog & parent)
-       : base_class(parent, _("Text Style"))
+       : base_class(parent, lyx::to_utf8(_("Text Style")))
 {
 }
 
index 8055ec32cac2b57065f9eb1a6b28b0dcc891c819..0728fae85bdbeff12e883d63037cc986d66211bb 100644 (file)
@@ -47,7 +47,7 @@ namespace frontend {
 typedef QController<ControlCitation, QView<QCitationDialog> > base_class;
 
 QCitation::QCitation(Dialog & parent)
-       : base_class(parent, _("Citation"))
+       : base_class(parent, lyx::to_utf8(_("Citation")))
 {}
 
 
index 82262b1e1dd33b5fb614e6ac82f511ccd4e60084..922435f7db8e5f71aa5e95437e491b274c03dd70 100644 (file)
@@ -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));
                }
        }
index a2fe4ba72dfecc9b0597a1c0fc1322fb3deecea7..6e4ed82b881ca1180446e4e5eb696a131e220606 100644 (file)
@@ -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));
 }
index fcf40832196eddf82bb37820afca7f68e0688b1b..c766fcaf27b865d4d3ca7e1e20aafb5b546be7b8 100644 (file)
@@ -27,7 +27,7 @@ typedef QController<ControlERT, QView<QERTDialog> > base_class;
 
 
 QERT::QERT(Dialog & parent)
-       : base_class(parent, _("TeX Code Settings"))
+       : base_class(parent, lyx::to_utf8(_("TeX Code Settings")))
 {
 }
 
index ec342dab5bfb698b46181a192a9879add8688ea5..70f15a756a8cd1a71411fd3b872db3816f186748 100644 (file)
@@ -277,7 +277,7 @@ void getExtra(external::ExtraData & data,
 typedef QController<ControlExternal, QView<QExternalDialog> > base_class;
 
 QExternal::QExternal(Dialog & parent)
-       : base_class(parent, _("External Material"))
+       : base_class(parent, lyx::to_utf8(_("External Material")))
 {}
 
 
index c08f09400de800814b150c36aa9fda016a8bfa10..e7988d2f079677c9771717510ebd87f9452dca76 100644 (file)
@@ -28,7 +28,7 @@ typedef QController<ControlFloat, QView<QFloatDialog> > base_class;
 
 
 QFloat::QFloat(Dialog & parent)
-       : base_class(parent, _("Float Settings"))
+       : base_class(parent, lyx::to_utf8(_("Float Settings")))
 {
 }
 
index 4fb844d397d3f6c7ef2f7990aabd9f1851ef81e1..2215c073dab4e554ee9a38385e662d2e16f6aae6 100644 (file)
@@ -57,7 +57,7 @@ namespace frontend {
 typedef QController<ControlGraphics, QView<QGraphicsDialog> > base_class;
 
 QGraphics::QGraphics(Dialog & parent)
-       : base_class(parent, _("Graphics"))
+       : base_class(parent, lyx::to_utf8(_("Graphics")))
 {
 }
 
index df6ac70f877109bb5960ca7b145f4865e70549c1..bb69c54f96ad9732e1e32b0cc2d44eeab11e9269 100644 (file)
@@ -36,7 +36,7 @@ typedef QController<ControlInclude, QView<QIncludeDialog> > base_class;
 
 
 QInclude::QInclude(Dialog & parent)
-       : base_class(parent, _("Child Document"))
+       : base_class(parent, lyx::to_utf8(_("Child Document")))
 {}
 
 
index 59e6ce6d0cb560dcb896ac4eb69b396bf650f5e0..f50b92774f962c02d4c833d623404f78e5f2667e 100644 (file)
@@ -24,7 +24,7 @@ typedef QController<ControlMath, QView<QMathDialog> > 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<ControlMath, QView<QMathMatrixDialog> > 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<ControlMath, QView<QDelimiterDialog> > delimiter_base;
 
 
 QMathDelimiter::QMathDelimiter(Dialog & parent)
-       : delimiter_base(parent, _("Math Delimiter"))
+       : delimiter_base(parent, lyx::to_utf8(_("Math Delimiter")))
 {}
 
 
index 6e3f9f9a6fadc5beb91e38cca58f331b0fbf99b4..20f45c14cd3e641c8f36cfff036bfc991db33024 100644 (file)
@@ -31,7 +31,7 @@ typedef QController<ControlNote, QView<QNoteDialog> > base_class;
 
 
 QNote::QNote(Dialog & parent)
-       : base_class(parent, _("Note Settings"))
+       : base_class(parent, lyx::to_utf8(_("Note Settings")))
 {}
 
 
index fc7bf7d821041c8d20819c71160cf1f9f82b6e1d..80094bf692972678c164c80b146c6bb4685a8177 100644 (file)
@@ -37,7 +37,7 @@ typedef QController<ControlParagraph, QView<QParagraphDialog> > 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 {
index 2e185d05efa01b89d56283e00d942c8f48fa2c53..8bcf36ad5575ec6ad73f0e3daf803b37269fc82a 100644 (file)
@@ -78,7 +78,7 @@ namespace frontend {
 typedef QController<ControlPrefs, QView<QPrefsDialog> > base_class;
 
 QPrefs::QPrefs(Dialog & parent)
-       : base_class(parent, _("Preferences"))
+       : base_class(parent, lyx::to_utf8(_("Preferences")))
 {
 }
 
index c151691d05f23b69482f4a0a6c090c4902fe0bdd..7c58329b785673378f560293f68ef0861bf38e4a 100644 (file)
@@ -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));
 }
index 325fc3c4cb1493ba7a502000f050bf174148606b..6626c7c472ebadec177998ff89d5de510ce52073 100644 (file)
@@ -33,7 +33,7 @@ typedef QController<ControlPrint, QView<QLPrintDialog> > base_class;
 
 
 QPrint::QPrint(Dialog & parent)
-       : base_class(parent, _("Print Document"))
+       : base_class(parent, lyx::to_utf8(_("Print Document")))
 {
 }
 
index 0b33f3b72cc6c35b88a6d1a56efa066df957efac..c6f5e70899cf7b0cee6991b462c2c6ee7eb35654 100644 (file)
@@ -39,7 +39,7 @@ typedef QController<ControlRef, QView<QRefDialog> > base_class;
 
 
 QRef::QRef(Dialog & parent)
-       : base_class(parent, _("Cross-reference")),
+       : base_class(parent, lyx::to_utf8(_("Cross-reference"))),
        sort_(false), at_ref_(false)
 {
 }
index 7d0d55c1f1b96066adc8389789d83fa050161e7d..2393b4dc53d1ffc80aa306987baa9f25a35d8f17 100644 (file)
@@ -28,7 +28,7 @@ typedef QController<ControlSearch, QView<QSearchDialog> > base_class;
 
 
 QSearch::QSearch(Dialog & parent)
-       : base_class(parent, _("Find and Replace"))
+       : base_class(parent, lyx::to_utf8(_("Find and Replace")))
 {
 }
 
index ce11b5545e51091aecf48e796b7dcb7e4ae8a7ca..6e4bedd92e9086831fe02091ec04faae1cb596e6 100644 (file)
@@ -33,7 +33,7 @@ typedef QController<ControlSendto, QView<QSendtoDialog> > base_class;
 
 
 QSendto::QSendto(Dialog & parent)
-       : base_class(parent, _("Send Document to Command"))
+       : base_class(parent, lyx::to_utf8(_("Send Document to Command")))
 {
 }
 
index 996cabaf72de92e15903d99ad7c0a97dccf68c37..7e3b160532105cf7c9bddb044d848907a08e22a6 100644 (file)
@@ -29,7 +29,7 @@ typedef QController<ControlShowFile, QView<QShowFileDialog> > base_class;
 
 
 QShowFile::QShowFile(Dialog & parent)
-       : base_class(parent, _("Show File"))
+       : base_class(parent, lyx::to_utf8(_("Show File")))
 {
 }
 
index 680086a4db4417b901e52ad31836ccea9c56597c..7d7ee002dcd65728d0e3ea55fbd2faa6033235aa 100644 (file)
@@ -32,7 +32,7 @@ typedef QController<ControlSpellchecker, QView<QSpellcheckerDialog> > base_class
 
 
 QSpellchecker::QSpellchecker(Dialog & parent)
-       : base_class(parent, _("Spellchecker"))
+       : base_class(parent, lyx::to_utf8(_("Spellchecker")))
 {}
 
 
index dbe60bc803eb7273da51f6d715fcdb6e02ba1115..e0a7b70ad7c731901b57b0e96c2aba5e2a951598 100644 (file)
@@ -39,7 +39,7 @@ namespace frontend {
 typedef QController<ControlTabular, QView<QTabularDialog> > base_class;
 
 QTabular::QTabular(Dialog & parent)
-       : base_class(parent, _("Table Settings"))
+       : base_class(parent, lyx::to_utf8(_("Table Settings")))
 {
 }
 
index 1bd9701c0ffa67f8f5e71d6c7c25605415c2618d..faea739a5cd6405c99802fa6be584d30769257aa 100644 (file)
@@ -26,7 +26,7 @@ typedef QController<ControlTabularCreate, QView<QTabularCreateDialog> > base_cla
 
 
 QTabularCreate::QTabularCreate(Dialog & parent)
-       : base_class(parent, _("Insert Table"))
+       : base_class(parent, lyx::to_utf8(_("Insert Table")))
 {
 }
 
index 87055d2fd00e2cdfe0f37bd921a3897bfaf9c337..b0b3a150181a1ddf8b84cdd57eb6dd3d5418c8f8 100644 (file)
@@ -31,7 +31,7 @@ namespace frontend {
 typedef QController<ControlTexinfo, QView<QTexinfoDialog> > base_class;
 
 QTexinfo::QTexinfo(Dialog & parent)
-       : base_class(parent, _("TeX Information")),
+       : base_class(parent, lyx::to_utf8(_("TeX Information"))),
          warningPosted(false), activeStyle(ControlTexinfo::cls)
 {
 }
index 9d08737ae4c63d4ba15aff90ecd993411db1398b..40dca16cda64f27e2b7278c18c4d298936e250aa 100644 (file)
@@ -26,7 +26,7 @@ namespace frontend {
 typedef QController<ControlThesaurus, QView<QThesaurusDialog> > base_class;
 
 QThesaurus::QThesaurus(Dialog & parent)
-       : base_class(parent, _("Thesaurus"))
+       : base_class(parent, lyx::to_utf8(_("Thesaurus")))
 {
 }
 
index 4cdd0db3de064fd3b9b020ba1971a3cf073f9de4..f3446a31fb93f7cc4e8e5b6d2873c7cc9e4ba802 100644 (file)
@@ -38,7 +38,7 @@ namespace frontend {
 typedef QController<ControlToc, QView<QTocDialog> > 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)
 {}
 
 
index cd8324df1e8c993a88558109ab9c9d414214c708..0636d0d8ce9ef493c1c6c1fffb366042a8c4a125 100644 (file)
@@ -30,7 +30,7 @@ namespace frontend {
 typedef QController<ControlCommand, QView<QURLDialog> > base_class;
 
 QURL::QURL(Dialog & parent)
-       : base_class(parent, _("URL"))
+       : base_class(parent, lyx::to_utf8(_("URL")))
 {
 }
 
index e968a08b75e213fdf34cb912fb562ee7afc1462b..11749920e174df1c67d967adab9a6aa04b135219 100644 (file)
@@ -130,7 +130,7 @@ VSpace setVSpaceFromWidgets(int spacing,
 typedef QController<ControlVSpace, QView<QVSpaceDialog> > base_class;
 
 QVSpace::QVSpace(Dialog & parent)
-       : base_class(parent, _("Vertical Space Settings"))
+       : base_class(parent, lyx::to_utf8(_("Vertical Space Settings")))
 {}
 
 
index d6aac12e8967f12364508f21d671df50787c3d46..b0be065a51f18ce8ad6404545cefc35d2c5a1fd6 100644 (file)
@@ -36,7 +36,7 @@ namespace frontend {
 typedef QController<ControlWrap, QView<QWrapDialog> > base_class;
 
 QWrap::QWrap(Dialog & parent)
-       : base_class(parent, _("Text Wrap Settings"))
+       : base_class(parent, lyx::to_utf8(_("Text Wrap Settings")))
 {
 }
 
index c28e08d2bdd70595b4f771e4dd7effff7a8431c3..8b838e7ee1a035aafad16274483dc075eb31691b 100644 (file)
@@ -33,7 +33,8 @@ class Qt2BC : public GuiBC<QButton, QWidget> {
 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;
index 2de6e5df000b80c72d764194b88df757f11f02b7..42dba72efc062ca93a1f051ddd42b154953468a1 100644 (file)
@@ -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;
index b4991b735205c44c10f556329c59730206864fae..7c669d551a5c0d14e1e9d9c2995edc1bb18fa2e3 100644 (file)
@@ -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<bool, string> 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(),
index 5606bc190f5d9f45b6dda9604047344ad8754f0e..7d03a3433e18e51391dd6c6f5aea0a02c669e2c4 100644 (file)
@@ -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") {
index f9ee1f564d1a1fee87d7b81132a9a815498b368e..4b749e66ac36916e447abbf231a8397ce4219216 100644 (file)
@@ -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);
 
index ecfe9e3b18a1b0d61fe4237acc5d94cc9e4dfe8a..4457c2053979f041505343f497e52d1472f0ba16 100644 (file)
@@ -41,7 +41,7 @@ namespace frontend {
 typedef QController<ControlAboutlyx, QView<QAboutDialog> > base_class;
 
 QAbout::QAbout(Dialog & parent)
-       : base_class(parent, _("About LyX"))
+       : base_class(parent, lyx::to_utf8(_("About LyX")))
 {
 }
 
index 5d4ea733a5c4d72c979d77470f491e58fd7b6627..e338343788aaf0c5f081ef7b7baff7e27883dc9a 100644 (file)
@@ -28,7 +28,7 @@ typedef QController<ControlCommand, QView<QBibitemDialog> > base_class;
 
 
 QBibitem::QBibitem(Dialog & parent)
-       : base_class(parent, _("Bibliography Entry Settings"))
+       : base_class(parent, lyx::to_utf8(_("Bibliography Entry Settings")))
 {
 }
 
index fbc12f9e0243adb2567df0d52bdfdff08b4f9223..b4bae450d3f742cf3611016f92d2d67f463be24f 100644 (file)
@@ -44,7 +44,7 @@ namespace frontend {
 typedef QController<ControlBibtex, QView<QBibtexDialog> > base_class;
 
 QBibtex::QBibtex(Dialog & parent)
-       : base_class(parent, _("BibTeX Bibliography"))
+       : base_class(parent, lyx::to_utf8(_("BibTeX Bibliography")))
 {
 }
 
index 64db6c3f388a38b416bd32ebb7d808140affd87e..567a843f3a9264e7a25bb486f62854d0e837e817 100644 (file)
@@ -46,7 +46,7 @@ namespace frontend {
 typedef QController<ControlBox, QView<QBoxDialog> > base_class;
 
 QBox::QBox(Dialog & parent)
-       : base_class(parent, _("Box Settings"))
+       : base_class(parent, lyx::to_utf8(_("Box Settings")))
 {}
 
 
index 002353cbcbe20b857bfeac2a4379a206685f9ecd..033cd24fff5118bd9880d0238efc6da2a18c4881 100644 (file)
@@ -32,7 +32,7 @@ typedef QController<ControlBranch, QView<QBranchDialog> > base_class;
 
 
 QBranch::QBranch(Dialog & parent)
-       : base_class(parent, _("Branch Settings"))
+       : base_class(parent, lyx::to_utf8(_("Branch Settings")))
 {}
 
 
index 287f700b30a29cf437d6079afa916629d3ca6a5f..dc75ee7ab2bba7caec3cf87ad2e86ee06ec4216d 100644 (file)
@@ -33,7 +33,7 @@ typedef QController<ControlChanges, QView<QChangesDialog> > 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));
 }
index 70ff96fe837fbdc02eb9a6709dbd1bef3108b34d..5574dd618adb67ec20d58cef6ac24844a9d405b6 100644 (file)
@@ -31,7 +31,7 @@ typedef QController<ControlCharacter, QView<QCharacterDialog> > base_class;
 
 
 QCharacter::QCharacter(Dialog & parent)
-       : base_class(parent, _("Text Style"))
+       : base_class(parent, lyx::to_utf8(_("Text Style")))
 {
 }
 
index e357eee876a863668513c9e82c01dcaf102faadd..5094e5e185f341479426dee755d8e8a870ff76cc 100644 (file)
@@ -45,7 +45,7 @@ typedef QController<ControlDocument, QView<QDocumentDialog> > base_class;
 
 
 QDocument::QDocument(Dialog & parent)
-       : base_class(parent, _("Document Settings"))
+       : base_class(parent, lyx::to_utf8(_("Document Settings")))
 {}
 
 
index 3c555a31fca5fb3353a626febaf829990f1420b1..d5a604878eeeae50ad4beda62b63b9759c3a70f5 100644 (file)
@@ -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")));
 }
 
 
index fcf40832196eddf82bb37820afca7f68e0688b1b..c766fcaf27b865d4d3ca7e1e20aafb5b546be7b8 100644 (file)
@@ -27,7 +27,7 @@ typedef QController<ControlERT, QView<QERTDialog> > base_class;
 
 
 QERT::QERT(Dialog & parent)
-       : base_class(parent, _("TeX Code Settings"))
+       : base_class(parent, lyx::to_utf8(_("TeX Code Settings")))
 {
 }
 
index 3df19563756f525dfb8d80b8c87ce19d7278e4c6..73967cd05920c26668fc835164ed7424baf6a567 100644 (file)
@@ -276,7 +276,7 @@ void getExtra(external::ExtraData & data,
 typedef QController<ControlExternal, QView<QExternalDialog> > base_class;
 
 QExternal::QExternal(Dialog & parent)
-       : base_class(parent, _("External Material"))
+       : base_class(parent, lyx::to_utf8(_("External Material")))
 {}
 
 
index 1d1ccfc581c70f547e19dfae85a124a2a661d223..3d9cd6e85fd273f8c66cf50dc4f274519de52514 100644 (file)
@@ -28,7 +28,7 @@ typedef QController<ControlFloat, QView<QFloatDialog> > base_class;
 
 
 QFloat::QFloat(Dialog & parent)
-       : base_class(parent, _("Float Settings"))
+       : base_class(parent, lyx::to_utf8(_("Float Settings")))
 {
 }
 
index 77cdbc670306b7e962072dcf1649fad2bbee5620..ed2340f4fd1c9d613f597bf872826efe7710c539 100644 (file)
@@ -56,7 +56,7 @@ namespace frontend {
 typedef QController<ControlGraphics, QView<QGraphicsDialog> > base_class;
 
 QGraphics::QGraphics(Dialog & parent)
-       : base_class(parent, _("Graphics"))
+       : base_class(parent, lyx::to_utf8(_("Graphics")))
 {
 }
 
index 1241a1b7e84fd5a627d410c7a90512a25aca5384..0a3243b946237878a7ac4921caf3e060b745a8d0 100644 (file)
@@ -35,7 +35,7 @@ typedef QController<ControlInclude, QView<QIncludeDialog> > base_class;
 
 
 QInclude::QInclude(Dialog & parent)
-       : base_class(parent, _("Child Document"))
+       : base_class(parent, lyx::to_utf8(_("Child Document")))
 {}
 
 
index 59e6ce6d0cb560dcb896ac4eb69b396bf650f5e0..f50b92774f962c02d4c833d623404f78e5f2667e 100644 (file)
@@ -24,7 +24,7 @@ typedef QController<ControlMath, QView<QMathDialog> > 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<ControlMath, QView<QMathMatrixDialog> > 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<ControlMath, QView<QDelimiterDialog> > delimiter_base;
 
 
 QMathDelimiter::QMathDelimiter(Dialog & parent)
-       : delimiter_base(parent, _("Math Delimiter"))
+       : delimiter_base(parent, lyx::to_utf8(_("Math Delimiter")))
 {}
 
 
index 24118ad6d551913276534593fb3bc12757b6373a..af1b5ab4baddd6397f9d9c98b3ce51c99677d383 100644 (file)
@@ -31,7 +31,7 @@ typedef QController<ControlNote, QView<QNoteDialog> > base_class;
 
 
 QNote::QNote(Dialog & parent)
-       : base_class(parent, _("Note Settings"))
+       : base_class(parent, lyx::to_utf8(_("Note Settings")))
 {}
 
 
index 275dc91c92a0c83f50dd76f6ee809d2366213dfb..4361f4ce397d81cb56540da6cda043b2b930e262 100644 (file)
@@ -35,7 +35,7 @@ typedef QController<ControlParagraph, QView<QParagraphDialog> > 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 {
index cce7420a99dab4508f2b4bc5a857791c194fa596..4f2e3f51ff850367861884783efa636cfc02f218 100644 (file)
@@ -38,7 +38,7 @@ namespace frontend {
 typedef QController<ControlPrefs, QView<QPrefsDialog> > base_class;
 
 QPrefs::QPrefs(Dialog & parent)
-       : base_class(parent, _("Preferences"))
+       : base_class(parent, lyx::to_utf8(_("Preferences")))
 {
 
 }
index 22e38518ecc8204cc802f29f3a9de1f068e5b48a..959bbbacfe4bfc46d04dcf3d111a79f1a7415551 100644 (file)
@@ -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);
index 325fc3c4cb1493ba7a502000f050bf174148606b..6626c7c472ebadec177998ff89d5de510ce52073 100644 (file)
@@ -33,7 +33,7 @@ typedef QController<ControlPrint, QView<QLPrintDialog> > base_class;
 
 
 QPrint::QPrint(Dialog & parent)
-       : base_class(parent, _("Print Document"))
+       : base_class(parent, lyx::to_utf8(_("Print Document")))
 {
 }
 
index 11984b30c44a4217a4df4cbc75adeca92b19a3fd..d559523bc65488d6b033a15fefc1f637e3363bf7 100644 (file)
@@ -40,7 +40,7 @@ typedef QController<lyx::frontend::ControlRef, QView<QRefDialog> > base_class;
 
 
 QRef::QRef(Dialog & parent)
-       : base_class(parent, _("Cross-reference")),
+       : base_class(parent, lyx::to_utf8(_("Cross-reference"))),
        sort_(false), at_ref_(false)
 {
 }
index bf83be2930df554228d053ad29dc361231a7c92f..f1b427875ecc98e5027a3a4e5710bd361dfd76cb 100644 (file)
@@ -27,7 +27,7 @@ typedef QController<ControlSearch, QView<QSearchDialog> > base_class;
 
 
 QSearch::QSearch(Dialog & parent)
-       : base_class(parent, _("Find and Replace"))
+       : base_class(parent, lyx::to_utf8(_("Find and Replace")))
 {
 }
 
index 874c2d727eacfec50b6f1cf8ee6163c5e23668e3..dbeca3c88cef50ef8ac11003906713d9bd3e8643 100644 (file)
@@ -32,7 +32,7 @@ typedef QController<ControlSendto, QView<QSendtoDialog> > base_class;
 
 
 QSendto::QSendto(Dialog & parent)
-       : base_class(parent, _("Send Document to Command"))
+       : base_class(parent, lyx::to_utf8(_("Send Document to Command")))
 {
 }
 
index 42789a4220f2c361556d2ae78afdc919d74115df..1f9d75496d9540d32b8318ab6215e276dbc8d1cf 100644 (file)
@@ -29,7 +29,7 @@ typedef QController<ControlShowFile, QView<QShowFileDialog> > base_class;
 
 
 QShowFile::QShowFile(Dialog & parent)
-       : base_class(parent, _("Show File"))
+       : base_class(parent, lyx::to_utf8(_("Show File")))
 {
 }
 
index 510de0a3ce1c3c9d2cc5be2bd52c9e2ccb6378a1..7c82cff162d89b5a58f999461e1396089ef534af 100644 (file)
@@ -31,7 +31,7 @@ namespace frontend {
 typedef QController<ControlSpellchecker, QView<QSpellcheckerDialog> > base_class;
 
 QSpellchecker::QSpellchecker(Dialog & parent)
-       : base_class(parent, _("Spellchecker"))
+       : base_class(parent, lyx::to_utf8(_("Spellchecker")))
 {}
 
 
index f42c12f1b4e9d6ceb633b8884a2558f0a9a38fed..a07ccb5195c5bf7680216107abfbb54f79e83ed4 100644 (file)
@@ -39,7 +39,7 @@ namespace frontend {
 typedef QController<ControlTabular, QView<QTabularDialog> > base_class;
 
 QTabular::QTabular(Dialog & parent)
-       : base_class(parent, _("Table Settings"))
+       : base_class(parent, lyx::to_utf8(_("Table Settings")))
 {
 }
 
index 1bd9701c0ffa67f8f5e71d6c7c25605415c2618d..faea739a5cd6405c99802fa6be584d30769257aa 100644 (file)
@@ -26,7 +26,7 @@ typedef QController<ControlTabularCreate, QView<QTabularCreateDialog> > base_cla
 
 
 QTabularCreate::QTabularCreate(Dialog & parent)
-       : base_class(parent, _("Insert Table"))
+       : base_class(parent, lyx::to_utf8(_("Insert Table")))
 {
 }
 
index 6556770173c121de502396bc8cda91631120e3f3..797d3836336dad0e9718cb0dcab3b115e41b7d04 100644 (file)
@@ -29,7 +29,7 @@ namespace frontend {
 typedef QController<ControlTexinfo, QView<QTexinfoDialog> > base_class;
 
 QTexinfo::QTexinfo(Dialog & parent)
-       : base_class(parent, _("TeX Information")),
+       : base_class(parent, lyx::to_utf8(_("TeX Information"))),
          warningPosted(false), activeStyle(ControlTexinfo::cls)
 {
 }
index ae324a1078f91da6a457ab8dffaa765f18384223..13b86f4daf5a7564d8011c8ffbd3fda86438d1df 100644 (file)
@@ -26,7 +26,7 @@ namespace frontend {
 typedef QController<ControlThesaurus, QView<QThesaurusDialog> > base_class;
 
 QThesaurus::QThesaurus(Dialog & parent)
-       : base_class(parent, _("Thesaurus"))
+       : base_class(parent, lyx::to_utf8(_("Thesaurus")))
 {
 }
 
index 7faa7341157d5612f88d0560175031ac12678571..b798409be9bc763f1b31dd9de0cf98cb438aea7a 100644 (file)
@@ -129,7 +129,7 @@ VSpace setVSpaceFromWidgets(int spacing,
 typedef QController<ControlVSpace, QView<QVSpaceDialog> > base_class;
 
 QVSpace::QVSpace(Dialog & parent)
-       : base_class(parent, _("Vertical Space Settings"))
+       : base_class(parent, lyx::to_utf8(_("Vertical Space Settings")))
 {}
 
 
index a3befaa2b34b68a34a9629bd85bffad9158a3936..f54c668bdf9a4d40211df00fb256382ce033a0da 100644 (file)
@@ -36,7 +36,7 @@ namespace frontend {
 typedef QController<ControlWrap, QView<QWrapDialog> > base_class;
 
 QWrap::QWrap(Dialog & parent)
-       : base_class(parent, _("Text Wrap Settings"))
+       : base_class(parent, lyx::to_utf8(_("Text Wrap Settings")))
 {
 }
 
index 728067cc8902afcc6b81a1a218c08cd5fda392ee..a851a118f1c456c50fa59d2a43c2b07ee13f663b 100644 (file)
@@ -33,7 +33,8 @@ class Qt2BC : public GuiBC<QPushButton, QWidget> {
 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;
index e416d96ac57c998fbee6ce201220f24924556a96..60a852053df1f6d3664db3c65def7bdfe50012c2 100644 (file)
@@ -30,7 +30,7 @@ namespace frontend {
 typedef QController< ControlCommand, QView<QURLDialog> > base_class;
 
 UrlView::UrlView(Dialog & parent)
-       : base_class(parent, _("URL"))
+       : base_class(parent, lyx::to_utf8(_("URL")))
 {
 }
 
index ea3e8d48ff7d5a200d1afa386572980da4e36332..41324326faeac300298d1ff762f7dffdfb230be5 100644 (file)
@@ -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)));
 }
 
 
index 34a2e4fa033bd2df29f1bfba464dac115bcd0f7f..e0676ea264cd793d0efaaa199646cbe24a9dd255 100644 (file)
@@ -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;
index ea38cc88e9e2ade06473572ddb741e7a6259eb25..ec1ea632521d3bcb71b921bfc3281cb502d0a160 100644 (file)
 #  include <locale.h>
 #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);
 }
 
 
index 7cb097af487d089f9b1170f9c0854dfec5e85c6b..eaddb3253afee452a0599b106a639baa75807664 100644 (file)
@@ -13,6 +13,8 @@
 #ifndef GETTEXT_H
 #define GETTEXT_H
 
+#include "support/docstring.h"
+
 #include <string>
 
 /*
@@ -47,7 +49,7 @@
 //#ifdef ENABLE_NLS
 
 ///
-std::string const _(std::string const &);
+lyx::docstring const _(std::string const &);
 
 //#else // ENABLE_NLS
 
index 3f333515d7f33c39045f2bdd04bd4b92117f4adc..7f627f092bfdd021fd0cf668fc2f09d1d4158dc0 100644 (file)
@@ -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;
 }
 
index eb7a818ed1f52f73a28f8c17e90157d13015ffa2..1212ea8c0027fe701a6d1491992a807ae853a639 100644 (file)
@@ -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"));
 }
 
 
index 834f34981c1d2f697e44f1df0f660a6836ee4fa1..7bcb327aef8387d6aee4eb8df17fc1fffb09fca0 100644 (file)
@@ -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){
index 7d0a0ad35ea511970d95e92d6ae9da663bb0a6e7..9906caa8af25d334e12284fb20b27ffffb70226a 100644 (file)
@@ -42,7 +42,8 @@ namespace {
 
 typedef Translator<std::string, InsetBox::BoxType> 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<InsetBase> 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);
index ceadb3234668935adfe8ac2b4b6e9ee10087e0bf..5c3b6a303c68df72f37283cd00c4a8b2d33a1eef 100644 (file)
@@ -69,7 +69,8 @@ auto_ptr<InsetBase> 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
index 12ab885106e89960061c928c4a473237dc9e638b..004e6d9d146435c2fa4be836375e482ed5aab3e3 100644 (file)
@@ -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<string>(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);
index 13ee45dc5674a14a0dade0358b63417c19535603..29383105f6c14de865052596f177ece9dfd15df5 100644 (file)
@@ -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; }
index e2b0a65098c6b64e1bbd27f1fa12cb63cb67a41f..e6a6de1e83225bc390e9edb1ef52c6a50b94e604 100644 (file)
@@ -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);
index 478d2a9f359ba1940387330a5e2638404f7342f0..58fd9b333f08f22a4f5c7b0db3c8947d8c6e6a6b 100644 (file)
@@ -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();
 }
 
 
index d3fdd4797dfad0af74324a05c89f98b44b2917f8..74ab9af3e8eda77d4855bf89d8c8d0be1a984bf7 100644 (file)
@@ -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"))));
 }
 
 
index 322426f32f1896e7d328cdbe955710680c4838d9..8f1eca60169c1fc782027d0e057df13ce4005e6b 100644 (file)
@@ -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);
 }
index 3bf973bf64d2ba1e4bd68523104acbe9028f6b0d..a9c48303c1bcfce4fd43086ef739480a3340d75e 100644 (file)
@@ -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<InsetBase> 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);
 }
 
index 6789066f19fcd8ab97f2c547963393b79154cf9d..bdc731224453f75ef73e980561fdae82f4b6ddd7 100644 (file)
@@ -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;
index 0ed4db0936ad0cca6a193579f68fcf816d5eb102..cacf06c352e229b49950fa27ae8bb07abe8a208d 100644 (file)
@@ -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<InsetBase> InsetFoot::doClone() const
 
 string const InsetFoot::editMessage() const
 {
-       return _("Opened Footnote Inset");
+       // FIXME UNICODE
+       return lyx::to_utf8(_("Opened Footnote Inset"));
 }
 
 
index 834543491cd414d1ade8fa438fdf04365aaee6b3..e3ad40f4039b469b790a6cfca03f81f016c8518a 100644 (file)
@@ -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;
 }
index 9b991c139f49c56b582082809c7e94289ea306e0..7d7cc36f95176eb2b30d8d04205343001d47fbb7 100644 (file)
@@ -53,6 +53,7 @@
 
 #include <sstream>
 
+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;
index 04b954e99f21bd05c3602acd3e8e339cef8ae680..f067231148e8014d0940f646268e70b0a706f423 100644 (file)
@@ -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"));
 }
 
 
index 08fc084e68d4722e0f5252ad3798820902296c3a..f6e69e6a333e06c7b068215f566f436b0a1f2bf3 100644 (file)
@@ -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<InsetBase> InsetMarginal::doClone() const
 
 string const InsetMarginal::editMessage() const
 {
-       return _("Opened Marginal Note Inset");
+       // FIXME UNICODE
+       return lyx::to_utf8(_("Opened Marginal Note Inset"));
 }
 
 
index 4b1d9c2eb5a1425775ec13cc40f44c6bf6574b88..4f9dd7114f9ad56cd5b313e29f10d7d6a7286c20 100644 (file)
@@ -45,7 +45,8 @@ namespace {
 
 typedef Translator<std::string, InsetNoteParams::Type> 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<InsetBase> 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);
index 2954dbe64808a36481939fd8aaf721783b39ce3e..9c5db9df4ce8c016536a3f574f8242e972912a4e 100644 (file)
@@ -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<InsetBase> InsetOptArg::doClone() const
 
 string const InsetOptArg::editMessage() const
 {
-       return _("Opened Optional Argument Inset");
+       // FIXME UNICODE
+       return lyx::to_utf8(_("Opened Optional Argument Inset"));
 }
 
 
index e620c76ec0bcce54b21a1877275f2e30a3b54e74..7c4b3d56e060c4fe165dc9ee693e08954b070b96 100644 (file)
@@ -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,
index 706a7dc2b8b63aeb38f5d1d63bcbf2c64dbdca70..fa8fe76dd1a88f5ecb034dbac48232b78c635d2e 100644 (file)
@@ -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;
                }
        }
index 055ca76456e1df49b372495ed62f94ab696bc76c..0460ae11245bfaf8b3e835df7ee8546f66e09cbe 100644 (file)
@@ -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()) {
index e3ef6234c2dd7dcda530426c559bb44c00c0df04..0acd4dd3dc2d2c1809a9aa57cb0f00139e810cd7 100644 (file)
@@ -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"));
 }
 
 
index 8efd2929ed26d35362fb32757d863b1e33b8f12c..ea06bf37e8da1518901c8c076a5b77252ce1c0d3 100644 (file)
@@ -38,9 +38,10 @@ std::auto_ptr<InsetBase> 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"));
 }
 
 
index e376f42545b92cc549b19ea68884054b22efabda..b6f5e82d78b7d8a6588d7de83f74cfe987a9e551 100644 (file)
@@ -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;
 
index ee6243b723f926da33512a51154f6d183d8f1d80..ff23de94694832f50a70ed86999eb41ef2bb6410 100644 (file)
@@ -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,
index 039155ecf3d53825eeacb6b6683ffde15687d5e6..0a84d31d1a0719003662c1ebb6ea52e8f917271f 100644 (file)
@@ -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<InsetBase> InsetWrap::doClone() const
 
 string const InsetWrap::editMessage() const
 {
-       return _("Opened Wrap Inset");
+       // FIXME UNICODE
+       return lyx::to_utf8(_("Opened Wrap Inset"));
 }
 
 
index a7e2bcb7e4e5420214a8c51b615e0109fe991580..442d89d5a3693ae1a28da928d1abc8d6f6360e05 100644 (file)
@@ -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);
index 21b4d43d8fed0457a67c23d2c118b3b52abcb75a..dd61fe71348ef3336dbcc256593a3ac824d775b7 100644 (file)
@@ -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);
index cdef2fb907acef9cf7565b763bb704ec4a0a663d..124a1d4bf18b124d9a055dc2fcb46e81d235eee1 100644 (file)
@@ -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;
        }
 
index 0d701cdb28ea982ad740bf828fecd98f9f4d7287..708fb99ee5b8b2b072789933fbe296131fedf603 100644 (file)
@@ -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;
 }
index 7faaa8055504066038e98ced9921d34719a93482..6f8f68012ac2a3a7e41be947b5d771a73b1ecdf8 100644 (file)
@@ -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.")));
 }
index fdaa60f4bdc46a91c3d2ecbf0ae6b475f7958375..16d231b2440cd6dcb331306842a1e18aa5051e95 100644 (file)
@@ -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<int(string const &, string const &)> 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);
        }
 
index 1b0b299e4ce58968c43588e3cb9c6ff962136157..ce3d59b028ec9ac2f0a5f0cba609948dca570e54 100644 (file)
@@ -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<string>(replace_count);
-                       str += _(" strings have been replaced.");
+                       str += lyx::to_utf8(_(" strings have been replaced."));
                        // emit message signal.
                        buf->message(str);
                }
index 4168907ed94e02ed4fe8a7229848c8ec5a2bd032..fe884cdc2f308adb5131ee3d685363087d83d5cd 100644 (file)
@@ -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(), ", ");
 }
 
index a5c12c42ed5ca8ddfb40d40dec429391efd83f66..44b13b27d45022b5598342cbd7b5501bcb7f3cb3 100644 (file)
@@ -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();
 }
index fd741ab8ff8cfb8f82ee92b43a2c184f8f9eef5d..6d3d101b332bab4cf79f3fa43e977671c6f66864 100644 (file)
@@ -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
index d05c292f7a20aab3b0859d0836ae6031c198e2f4..b7de1af96f0dcabd88bd6d53fb52316dff9e2ea4 100644 (file)
@@ -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<bool, string> 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<bool, string> tmp = Alert::askForText(_("LyX VC: Log Message"));
+       pair<bool, string> 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();
index 879f8e1090d1f853f1e5f05e92ad5fe7da051be5..af651cb33f385c7b14bafe6921a8ebf81a0a46cc 100644 (file)
@@ -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;
index 14ea3a08107fe09de8f7c1630900034abbc628e3..360209b35bb6e455f2115a843e1f0091978416e2 100644 (file)
@@ -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"));
 }
 
 
index 9cba8e8b93d72df4b350dd731807d940d1b17267..c8f94533611b9f21fe137135f0342a10a35d9e2b 100644 (file)
@@ -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_));
 }
 
 
index bf0baadd861ff364d700b2e1348187f93eedf364..cc6e7517548ba3b529246e0a270a9ca7985bf833 100644 (file)
@@ -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;
index ffb8d11add1e10f72c52b09e7ba91ec7660283c3..0a0d227580afec3d6b73a21b0fc15ac54572deca 100644 (file)
@@ -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));
index a5a3db5ecee40589be6da8f12bceec369ab4926c..11e96aee6a42a5818b0bafc307c59ff56c6d4e66 100644 (file)
@@ -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;
index 2327206b9f072a294e96c07cd245104aeec9bda2..311a0058e746d4a3bd3a5fa685507385aa518c02 100644 (file)
@@ -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();
                        }
index 6975c091f04510b1fbc97ea793775cbc825b8144..2ca17c2ef2ab804ac93f9a7404aff85a9c88a6fa 100644 (file)
@@ -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!"));
 }
 
 
index 45bae7438c8b98a0d038623f75ad8f8d609a3e18..53c27fc1b1c2cfe009808906c9e670ef7e8d5711 100644 (file)
@@ -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;
index 9c53eb3f6fb5fb564a4ca60fd35ad884d252ad7b..061b5d221143755d715f103a5d098d49f215b3a7 100644 (file)
@@ -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.
index a81f33dc0c04501033a2163ae89e5441b265a4db..690943974bf4a840f78f7730ba7d8b2e75c8e7d2 100644 (file)
@@ -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]
                << "<package>\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;
index 4cb9e50b6684532a477f18d040a07c8efaf79b04..56f2d4da0e3878793a27fb6acb76c3a3e8345aa5 100644 (file)
@@ -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
index 0824e42d184c2d87300d029d62460b69c47468b6..ea0abd304b64da70fe6b49d6420ff546a18f651b 100644 (file)
@@ -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))
index b4ea505061ca45ac8999f55a2cc1a13420120227..27e5b9036770643805d3e375f8afb97a30c75493 100644 (file)
@@ -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;
        }
 
index 3e80d370a256f165a9f6556357fa3abec23187da..d97cb8eca35ec7649e517a1476b8a309a4eb5850 100644 (file)
@@ -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;
 }