]> git.lyx.org Git - features.git/commitdiff
Localize format prettyName in some more places (#11954)
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 29 Aug 2020 09:50:43 +0000 (11:50 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Fri, 11 Sep 2020 07:11:00 +0000 (09:11 +0200)
(cherry picked from commit 6f476b960edf2d774f0a4ba7d39b391034f093c7)

src/Buffer.cpp
src/Format.cpp
src/frontends/qt4/GuiView.cpp
src/frontends/qt4/Menus.cpp
status.23x

index 4006a95c91137f79d9a8da79e358214bf7595768..0e0990834068a3cc619093d21136edec7718c467 100644 (file)
@@ -4480,7 +4480,7 @@ Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir
                                // file (not for previewing).
                                Alert::error(_("Couldn't export file"), bformat(
                                        _("No information for exporting the format %1$s."),
-                                       theFormats().prettyName(format)));
+                                       translateIfPossible(theFormats().prettyName(format))));
                        }
                        return ExportNoPathToFormat;
                }
@@ -4664,13 +4664,13 @@ Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir
                } else {
                        message(bformat(_("Document exported as %1$s "
                                "to file `%2$s'"),
-                               theFormats().prettyName(format),
+                               translateIfPossible(theFormats().prettyName(format)),
                                makeDisplayPath(result_file)));
                }
        } else {
                // This must be a dummy converter like fax (bug 1888)
                message(bformat(_("Document exported as %1$s"),
-                       theFormats().prettyName(format)));
+                       translateIfPossible(theFormats().prettyName(format))));
        }
 
        return success ? ExportSuccess : ExportConverterError;
index 51dd0541d4ea179422023b1f18aa42618915a08d..da9345716561850912ff4e3d35e52c959e310de2 100644 (file)
@@ -680,7 +680,7 @@ bool Formats::view(Buffer const & buffer, FileName const & filename,
 // by the caller (this should be "utility" code)
                Alert::error(_("Cannot view file"),
                        bformat(_("No information for viewing %1$s"),
-                               prettyName(format_name)));
+                               translateIfPossible(prettyName(format_name))));
                return false;
        }
        // viewer is 'auto'
@@ -784,7 +784,7 @@ bool Formats::edit(Buffer const & buffer, FileName const & filename,
 // be done by the caller (this should be "utility" code)
                Alert::error(_("Cannot edit file"),
                        bformat(_("No information for editing %1$s"),
-                               prettyName(format_name)));
+                               translateIfPossible(prettyName(format_name))));
                return false;
        }
 
index c4d7e03a0b1594eed285949e6a6e3e3de1a53963..b7102207cafd8324da3e36b86515d92a059c2643 100644 (file)
@@ -682,7 +682,7 @@ QVector<GuiWorkArea*> GuiView::GuiViewPrivate::guiWorkAreas()
 static void handleExportStatus(GuiView * view, Buffer::ExportStatus status,
        string const & format)
 {
-       docstring const fmt = theFormats().prettyName(format);
+       docstring const fmt = translateIfPossible(theFormats().prettyName(format));
        docstring msg;
        switch (status) {
        case Buffer::ExportSuccess:
@@ -2386,7 +2386,7 @@ static bool import(GuiView * lv, FileName const & filename,
                if (loader_format.empty()) {
                        frontend::Alert::error(_("Couldn't import file"),
                                         bformat(_("No information for importing the format %1$s."),
-                                        theFormats().prettyName(format)));
+                                        translateIfPossible(theFormats().prettyName(format))));
                        return false;
                }
        } else
@@ -2433,13 +2433,13 @@ void GuiView::importDocument(string const & argument)
                }
 
                docstring const text = bformat(_("Select %1$s file to import"),
-                       theFormats().prettyName(format));
+                       translateIfPossible(theFormats().prettyName(format)));
 
                FileDialog dlg(toqstr(text));
                dlg.setButton1(qt_("Documents|#o#O"), toqstr(lyxrc.document_path));
                dlg.setButton2(qt_("Examples|#E#e"), toqstr(lyxrc.example_path));
 
-               docstring filter = theFormats().prettyName(format);
+               docstring filter = translateIfPossible(theFormats().prettyName(format));
                filter += " (*.{";
                // FIXME UNICODE
                filter += from_utf8(theFormats().extensions(format));
index 0872152e3495ecb1d3e088e7308721691710184a..5f9eb9068d8d580bec800287294b2258259d12c8 100644 (file)
@@ -2247,7 +2247,8 @@ void Menus::Impl::expand(MenuDefinition const & frommenu,
                                break;
                        string const format = buf->params().getDefaultOutputFormat();
                        Format const * f = theFormats().getFormat(format);
-                       docstring const name = f ? f->prettyname() : from_utf8(format);
+                       docstring const name = f ? translateIfPossible(f->prettyname())
+                                                : from_utf8(format);
                        docstring const label = bformat(_("Export [%1$s]|E"), name);
                        MenuItem item(MenuItem::Command, toqstr(label),
                                      FuncRequest(LFUN_BUFFER_EXPORT));
index 57906bef36e6f93e2430b23ee10322c34f9b7e82..295286c2fb3b6cae865f4fee446341133963e2ca 100644 (file)
@@ -109,6 +109,8 @@ What's new
 
 - Fix behavior of Edit button in Include dialog.
 
+- Localize some previously unlocalized strings (bug 11954 ).
+
 
 * INTERNALS