gnucash unstable: Multiple changes pushed

Geert Janssens gjanssens at code.gnucash.org
Wed Feb 28 10:52:40 EST 2018


Updated	 via  https://github.com/Gnucash/gnucash/commit/ad166460 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/b71c346e (commit)
	from  https://github.com/Gnucash/gnucash/commit/66abe023 (commit)



commit ad1664604f5415851de932ec44d0f5c64c5532c7
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Feb 28 16:50:15 2018 +0100

    Cleanup namespace usage for boost::locale
    
    In a previous commit I wrongly believed xgettext might not find
    our strings if we used the fully namespaced boost::locale::translate or
    aliased bl::translate instead of just translate. However that's
    wrong, so I have changed the code to always use bl::translate.

diff --git a/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp b/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp
index 535f4ef..8b7c550 100644
--- a/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp
+++ b/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp
@@ -67,7 +67,6 @@ extern "C"
 #include <boost/locale.hpp>
 
 namespace bl = boost::locale;
-using namespace boost::locale;
 
 #define MIN_COL_WIDTH 70
 #define GNC_PREFS_GROUP "dialogs.import.csv"
@@ -1947,9 +1946,10 @@ CsvImpTransAssist::assist_summary_page_prepare ()
     gen.add_messages_path(gnc_path_get_datadir());
     gen.add_messages_domain(PACKAGE);
 
-    auto text = std::string("<span size=\"medium\"><b>");
     // FIXME Rather than passing a locale generator below we probably should set std::locale::global appropriately somewhere.
-    text += (bl::format (translate ("The transactions were imported from the file '{1}'.")) % m_file_name).str(gen(""));
+    auto text = std::string("<span size=\"medium\"><b>");
+    /* Translators: {1} will be replaced with a filename */
+    text += (bl::format (bl::translate ("The transactions were imported from file '{1}'.")) % m_file_name).str(gen(""));
     text += "</b></span>";
     gtk_label_set_markup (GTK_LABEL(summary_label), text.c_str());
 }
diff --git a/libgnucash/core-utils/gnc-filepath-utils.cpp b/libgnucash/core-utils/gnc-filepath-utils.cpp
index d55b535..e259798 100644
--- a/libgnucash/core-utils/gnc-filepath-utils.cpp
+++ b/libgnucash/core-utils/gnc-filepath-utils.cpp
@@ -78,7 +78,6 @@ extern "C" {
 namespace bfs = boost::filesystem;
 namespace bst = boost::system;
 namespace bl = boost::locale;
-using namespace boost::locale;
 
 /**
  * Scrubs a filename by changing "strange" chars (e.g. those that are not
@@ -678,35 +677,35 @@ static std::string migrate_gnc_datahome()
 
     /* Step 3: inform the user of additional changes */
     if (full_copy || !succeeded.empty() || !conf_exist_vec.empty() || !failed.empty())
-        migration_msg << translate ("Notice") << std::endl << std::endl;
+        migration_msg << bl::translate ("Notice") << std::endl << std::endl;
 
     if (full_copy)
     {
         migration_msg
-        << translate ("Your gnucash metadata has been migrated.") << std::endl << std::endl
+        << bl::translate ("Your gnucash metadata has been migrated .") << std::endl << std::endl
         /* Translators: this refers to a directory name. */
-        << translate ("Old location:") << " " << old_dir.string() << std::endl
+        << bl::translate ("Old location:") << " " << old_dir.string() << std::endl
         /* Translators: this refers to a directory name. */
-        << translate ("New location:") << " " << gnc_userdata_home.string() << std::endl << std::endl
+        << bl::translate ("New location:") << " " << gnc_userdata_home.string() << std::endl << std::endl
         // Translators {1} will be replaced with the package name (typically Gnucash) at runtime
-        << bl::format (translate ("If you no longer intend to run {1} 2.6.x or older on this system you can safely remove the old directory."))
+        << bl::format (bl::translate ("If you no longer intend to run {1} 2.6.x or older on this system you can safely remove the old directory."))
         % PACKAGE_NAME;
     }
 
     if (full_copy &&
         (!succeeded.empty() || !conf_exist_vec.empty() || !failed.empty()))
         migration_msg << std::endl << std::endl
-                        << translate ("In addition:");
+                        << bl::translate ("In addition:");
 
     if (!succeeded.empty())
     {
         migration_msg << std::endl << std::endl;
         if (full_copy)
-            migration_msg << bl::format (translate ("The following file has been copied to {1} instead:",
-                                                    "The following files have been copied to {1} instead:",
-                                                    succeeded.size())) % gnc_userconfig_home.string().c_str();
+            migration_msg << bl::format (bl::translate ("The following file has been copied to {1} instead:",
+                                                        "The following files have been copied to {1} instead:",
+                                                        succeeded.size())) % gnc_userconfig_home.string().c_str();
         else
-            migration_msg << bl::format (translate ("The following file in {1} has been renamed:"))
+            migration_msg << bl::format (bl::translate ("The following file in {1} has been renamed:"))
                                          % gnc_userconfig_home.string().c_str();
 
         migration_msg << std::endl;
@@ -716,9 +715,9 @@ static std::string migrate_gnc_datahome()
     if (!conf_exist_vec.empty())
     {
         migration_msg << std::endl << std::endl
-                      << translate ("The following file has become obsolete and will be ignored:",
-                                    "The following files have become obsolete and will be ignored:",
-                                    conf_exist_vec.size())
+                      << bl::translate ("The following file has become obsolete and will be ignored:",
+                                        "The following files have become obsolete and will be ignored:",
+                                        conf_exist_vec.size())
                       << std::endl;
         for (auto obs_file : conf_exist_vec)
             migration_msg << "- " << obs_file << std::endl;
@@ -726,9 +725,9 @@ static std::string migrate_gnc_datahome()
     if (!failed.empty())
     {
         migration_msg << std::endl << std::endl
-                      << bl::format (translate ("The following file could not be moved to {1}:",
-                                                "The following files could not be moved to {1}:",
-                                                failed.size())) % gnc_userconfig_home.string().c_str()
+                      << bl::format (bl::translate ("The following file could not be moved to {1}:",
+                                                    "The following files could not be moved to {1}:",
+                                                    failed.size())) % gnc_userconfig_home.string().c_str()
                       << std::endl;
         for (auto failed_file : failed)
             migration_msg << "- " << failed_file << std::endl;

commit b71c346ef5f9afbee6d034dade75c7ca0cd0bcae
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Wed Feb 28 16:48:49 2018 +0100

    Fix typo: should read 'older version of gettext' rather than 'older version of gnucash'

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 81b6c13..670fe8f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -258,7 +258,7 @@ if (ALLOW_OLD_GETTEXT)
 else (ALLOW_OLD_GETTEXT)
     find_package (Gettext 0.19.6)
     if (NOT GETTEXT_FOUND)
-        message (FATAL_ERROR "Note the build can be configured with an older version of gnucash by setting ALLOW_OLD_GETTEXT=ON but then some files will not be translated:
+        message (FATAL_ERROR "Note the build can be configured with an older version of gettext by setting ALLOW_OLD_GETTEXT=ON but then some files will not be translated:
         - gnucash.desktop (requires at least gettext 0.19)
         - gnucash.appdata.xml (requires at least gettext 0.19.6)")
     endif (NOT GETTEXT_FOUND)



Summary of changes:
 CMakeLists.txt                                     |  2 +-
 .../csv-imp/assistant-csv-trans-import.cpp         |  6 ++--
 libgnucash/core-utils/gnc-filepath-utils.cpp       | 33 +++++++++++-----------
 3 files changed, 20 insertions(+), 21 deletions(-)



More information about the gnucash-changes mailing list