[Libreoffice-commits] core.git: cui/source

Heiko Tietze (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 31 21:10:02 UTC 2020


 cui/source/dialogs/about.cxx |   17 ++++++++++++-----
 cui/source/inc/about.hxx     |    2 +-
 2 files changed, 13 insertions(+), 6 deletions(-)

New commits:
commit 3abc852f2f582b3abdd082b274ceeea67b21a0ab
Author:     Heiko Tietze <tietze.heiko at gmail.com>
AuthorDate: Thu Jul 30 11:20:53 2020 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Fri Jul 31 23:09:17 2020 +0200

    Resolves tdf#132066 - Localization of special text in about window
    
    Copy all version infos in English
    Follow-up to 56b2214c3aa40c2e2522eba5584063fb34e003ba
    
    Change-Id: Id093305261ec957137c56f61048c660e80e5c795
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99773
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index efeef5a9c002..3d9df9849fc3 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -27,6 +27,7 @@
 #include <vcl/svapp.hxx>     //Application::
 #include <vcl/virdev.hxx>    //VirtualDevice
 #include <vcl/weld.hxx>
+#include <unotools/resmgr.hxx> //Translate
 
 #include <config_buildid.h> //EXTRA_BUILDID
 #include <dialmgr.hxx>      //CuiResId
@@ -169,7 +170,7 @@ OUString AboutDialog::GetBuildString() {
   return sBuildId;
 }
 
-OUString AboutDialog::GetLocaleString() {
+OUString AboutDialog::GetLocaleString(const bool bLocalized) {
 
   OUString sLocaleStr;
 
@@ -190,7 +191,12 @@ OUString AboutDialog::GetLocaleString() {
 
   OUString aUILocaleStr =
       Application::GetSettings().GetUILanguageTag().getBcp47();
-  OUString sUILocaleStr(CuiResId(RID_SVXSTR_ABOUT_UILOCALE));
+  OUString sUILocaleStr;
+  if (bLocalized)
+     sUILocaleStr = CuiResId(RID_SVXSTR_ABOUT_UILOCALE);
+  else
+     sUILocaleStr = Translate::get(RID_SVXSTR_ABOUT_UILOCALE, Translate::Create("cui", LanguageTag("en-US")));
+
   if (sUILocaleStr.indexOf("$LOCALE") == -1) {
     SAL_WARN("cui.dialogs", "translated uilocale string in translations "
                             "doesn't contain $LOCALE placeholder");
@@ -250,7 +256,8 @@ OUString AboutDialog::GetCopyrightString() {
   return aCopyrightString;
 }
 
-//special labels to comply with previous version info
+// special labels to comply with previous version info
+// untranslated English for QA
 IMPL_LINK_NOARG(AboutDialog, HandleClick, weld::Button &, void) {
   css::uno::Reference<css::datatransfer::clipboard::XClipboard> xClipboard =
       css::datatransfer::clipboard::SystemClipboard::create(
@@ -259,8 +266,8 @@ IMPL_LINK_NOARG(AboutDialog, HandleClick, weld::Button &, void) {
   OUString sInfo = "Version: " + m_pVersionLabel->get_label() + "\n" // version
                    "Build ID: " + GetBuildString() + "\n" + // build id
                    Application::GetHWOSConfInfo(0,false) + "\n" // env+UI
-                   "Locale: " + m_pLocaleLabel->get_label() + "\n" + // locale
-                   m_pMiscLabel->get_label(); // misc
+                   "Locale: " + GetLocaleString(false) + "\n" + // locale
+                   GetMiscString(); // misc
 
   vcl::unohelper::TextDataObject::CopyStringTo(sInfo, xClipboard);
 }
diff --git a/cui/source/inc/about.hxx b/cui/source/inc/about.hxx
index 2262da38de96..df689fdb12ef 100644
--- a/cui/source/inc/about.hxx
+++ b/cui/source/inc/about.hxx
@@ -44,7 +44,7 @@ private:
 
     static OUString GetVersionString();
     static OUString GetBuildString();
-    static OUString GetLocaleString();
+    static OUString GetLocaleString(bool bLocalized = true);
     static OUString GetMiscString();
 
     static OUString GetCopyrightString();


More information about the Libreoffice-commits mailing list