paperbox r138 - in trunk: . src



Author: markoa
Date: Sat Apr 26 23:00:57 2008
New Revision: 138
URL: http://svn.gnome.org/viewvc/paperbox?rev=138&view=rev

Log:
Avoid markup in messages to be translated

Added:
   trunk/src/i18n-utils.cc
   trunk/src/i18n-utils.hh
Modified:
   trunk/ChangeLog
   trunk/src/Makefile.am
   trunk/src/category-view.cc
   trunk/src/main-window.cc

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Sat Apr 26 23:00:57 2008
@@ -33,6 +33,8 @@
 	document-tile-view.hh \
 	file-utils.cc \
 	file-utils.hh \
+	i18n-utils.cc \
+	i18n-utils.hh \
 	main.cc \
 	main-window.cc \
 	main-window.hh \

Modified: trunk/src/category-view.cc
==============================================================================
--- trunk/src/category-view.cc	(original)
+++ trunk/src/category-view.cc	Sat Apr 26 23:00:57 2008
@@ -22,6 +22,7 @@
 
 #include <glib/gi18n.h>
 #include "category-view.hh"
+#include "i18n-utils.hh"
 
 namespace paperbox {
 
@@ -30,7 +31,7 @@
         parent(_parent)
     {
         // pack the widgets
-        label_title.set_markup(_("<b>Categories</b>"));
+        label_title.set_markup(boldify(_("Categories")));
         parent->pack_start(label_title, false, false);
 
         scroll.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);

Added: trunk/src/i18n-utils.cc
==============================================================================
--- (empty file)
+++ trunk/src/i18n-utils.cc	Sat Apr 26 23:00:57 2008
@@ -0,0 +1,34 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+
+/*
+ *  PaperBox - i18n-utils.cc
+ *
+ *  Copyright (C) 2008 Marko Anastasov
+ *
+ *  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.
+ *
+ *  This program 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.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "i18n-utils.hh"
+
+namespace paperbox {
+
+    Glib::ustring
+    boldify(const Glib::ustring& text)
+    {
+        Glib::ustring res("<b>" + text + "</b>");
+        return res;
+    }
+
+} // namespace paperbox

Added: trunk/src/i18n-utils.hh
==============================================================================
--- (empty file)
+++ trunk/src/i18n-utils.hh	Sat Apr 26 23:00:57 2008
@@ -0,0 +1,34 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+
+/*
+ *  PaperBox - i18n-utils.hh
+ *
+ *  Copyright (C) 2008 Marko Anastasov
+ *
+ *  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.
+ *
+ *  This program 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.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef __PAPER_BOX_I18N_UTILS__
+#define __PAPER_BOX_I18N_UTILS__
+
+#include <glibmm/ustring.h>
+
+namespace paperbox {
+
+    Glib::ustring boldify(const Glib::ustring& text);
+
+}
+
+#endif // __PAPER_BOX_I18N_UTILS__

Modified: trunk/src/main-window.cc
==============================================================================
--- trunk/src/main-window.cc	(original)
+++ trunk/src/main-window.cc	Sat Apr 26 23:00:57 2008
@@ -33,6 +33,7 @@
 #include "file-utils.hh"
 #include "document-tag-cloud-model.hh"
 #include "document-tile.hh"
+#include "i18n-utils.hh"
 #include "main-window.hh"
 #include "paths.hh"
 
@@ -145,7 +146,7 @@
         get_widgets_from_ui_file();
         setup_tiles();
 
-        label_tags_.set_markup(_("<b>Tags</b>"));
+        label_tags_.set_markup(boldify(_("Tags")));
         tag_cloud_vbox_->pack_start(label_tags_, false, false);
 
         model_.reset(new DocumentTagCloudModel(10, 18));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]