]> git.lyx.org Git - lyx.git/commitdiff
l10n work:
authorJürgen Spitzmüller <spitz@lyx.org>
Fri, 25 May 2007 09:20:35 +0000 (09:20 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Fri, 25 May 2007 09:20:35 +0000 (09:20 +0000)
* src/Buffer.cpp:
- make view-source string translatable

* src/frontends/controllers/ControlToc.h:
- make getGuiName public

* src/frontends/qt4/TocWidget.cpp:
- use getGuiName for the combo.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18505 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp
src/frontends/controllers/ControlToc.h
src/frontends/qt4/TocWidget.cpp

index f4088ae8ac904d1d195fceb8ef896a489d3b6268..f686bd51b30f1205b27ba2ed8488acce4a25d8e7 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -1739,7 +1739,7 @@ void Buffer::getSourceCode(odocstream & os, pit_type par_begin,
        runparams.dryrun = true;
 
        if (full_source) {
-               os << "% Preview source code\n\n";
+               os << "% " << _("Preview source code") << "\n\n";
                if (isLatex())
                        writeLaTeXSource(os, filePath(), runparams, true, true);
                else {
@@ -1749,10 +1749,15 @@ void Buffer::getSourceCode(odocstream & os, pit_type par_begin,
                runparams.par_begin = par_begin;
                runparams.par_end = par_end;
                if (par_begin + 1 == par_end)
-                       os << "% Preview source code for paragraph " << par_begin << "\n\n";
+                       os << "% "
+                          << bformat(_("Preview source code for paragraph %1$s"), par_begin)
+                          << "\n\n";
                else
-                       os << "% Preview source code from paragraph " << par_begin
-                          << " to " << par_end - 1 << "\n\n";
+                       os << "% "
+                          << bformat(_("Preview source code from paragraph %1$s to %2$s"),
+                                       convert<docstring>(par_begin),
+                                       convert<docstring>(par_end - 1))
+                          << "\n\n";
                // output paragraphs
                if (isLatex()) {
                        texrow().reset();
index 640e9a5815205b57a1e8e7bea361d74fe8bf3a58..e71c18c830115b7b1844816715f313cd8bee9870 100644 (file)
@@ -44,6 +44,9 @@ public:
        std::vector<docstring> const & typeNames() const
        { return type_names_; }
 
+       /// Return the guiname from a given cmdName of the TOC param
+       docstring const getGuiName(std::string const & type) const;
+
        ///
        int selectedType() { return selected_type_; }
 
@@ -64,9 +67,6 @@ public:
        void updateBackend();
 
 private:
-       /// Return the guiname from a given cmdName of the TOC param
-       docstring const getGuiName(std::string const & type) const;
-
        std::vector<std::string> types_;
        std::vector<docstring> type_names_;
        int selected_type_;
index 7046dda2f261f185035450a88196f55c5565a36f..8cdd6e899407571dbbb4a286525cc02a8325ee9a 100644 (file)
@@ -249,12 +249,13 @@ void TocWidget::updateGui()
        }
 
        QString current_text = typeCO->currentText();
-       lyxerr << "current_text " << fromqstr(current_text) << endl;
+       //lyxerr << "current_text " << fromqstr(current_text) << endl;
        typeCO->blockSignals(true);
        typeCO->clear();
        int current_type = -1;
        for (size_t i = 0; i != type_names.size(); ++i) {
-               QString item = toqstr(type_names[i]);
+               QString item =
+                       toqstr(form_->getGuiName(to_utf8(type_names[i])));
                typeCO->addItem(item);
                if (item == current_text)
                        current_type = i;