bakery r122 - in trunk: . bakery/App bakery/Configuration bakery/Document examples/Configuration/ConfClient examples/Configuration/Dialog_Preferences examples/WithDoc examples/WithDocView examples/WithDocViewComposite examples/WithXmlDoc examples/WithXmlDocGlade examples/WithoutDoc



Author: murrayc
Date: Thu Dec 11 16:40:32 2008
New Revision: 122
URL: http://svn.gnome.org/viewvc/bakery?rev=122&view=rev

Log:
2008-12-11  Murray Cumming  <murrayc murrayc com>

* bakery/App/App_Gtk.cc:
* bakery/App/App_WithDoc.cc:
* bakery/App/App_WithDoc_Gtk.cc:
* bakery/App/Dialog_OfferSave.cc:
* bakery/App/GtkDialogs.cc:
* bakery/Configuration/Dialog_Preferences.cc:
* bakery/Document/Document.cc: Use _() instead of gettext(), 
including config.h and glibmm/i18n-lib.h instead of libintl.h.

* examples/Configuration/ConfClient/examplewindow.cc:
* examples/Configuration/Dialog_Preferences/examplewindow.cc:
* examples/WithDoc/appexample.cc:
* examples/WithDocView/appexample.cc:
* examples/WithDocViewComposite/appexample.cc:
* examples/WithXmlDoc/appexample.cc:
* examples/WithXmlDocGlade/appexample.cc:
* examples/WithoutDoc/appexample.cc: As above, but use glibmm/i18n.h.

Modified:
   trunk/ChangeLog
   trunk/bakery/App/App_Gtk.cc
   trunk/bakery/App/App_WithDoc.cc
   trunk/bakery/App/App_WithDoc_Gtk.cc
   trunk/bakery/App/Dialog_OfferSave.cc
   trunk/bakery/App/GtkDialogs.cc
   trunk/bakery/Configuration/Dialog_Preferences.cc
   trunk/bakery/Document/Document.cc
   trunk/examples/Configuration/ConfClient/examplewindow.cc
   trunk/examples/Configuration/Dialog_Preferences/examplewindow.cc
   trunk/examples/WithDoc/appexample.cc
   trunk/examples/WithDocView/appexample.cc
   trunk/examples/WithDocViewComposite/appexample.cc
   trunk/examples/WithXmlDoc/appexample.cc
   trunk/examples/WithXmlDocGlade/appexample.cc
   trunk/examples/WithoutDoc/appexample.cc

Modified: trunk/bakery/App/App_Gtk.cc
==============================================================================
--- trunk/bakery/App/App_Gtk.cc	(original)
+++ trunk/bakery/App/App_Gtk.cc	Thu Dec 11 16:40:32 2008
@@ -334,7 +334,7 @@
 
   //TODO: Use stock?
   m_refHelpActionGroup->add(Action::create("BakeryAction_Help_About",
-                        gettext("_About"), gettext("About the application")),
+                        _("_About"), _("About the application")),
                         sigc::mem_fun((Bakery::App&)*this, &App::on_menu_help_about));
 
   m_refUIManager->insert_action_group(m_refHelpActionGroup);

Modified: trunk/bakery/App/App_WithDoc.cc
==============================================================================
--- trunk/bakery/App/App_WithDoc.cc	(original)
+++ trunk/bakery/App/App_WithDoc.cc	Thu Dec 11 16:40:32 2008
@@ -16,12 +16,13 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include "config.h"
 #include <bakery/App/App_WithDoc.h>
 #include <bakery/App/Dialog_OfferSave.h>
 #include <gconfmm.h>
 #include <giomm.h>
-#include <libintl.h>
 #include <algorithm>
+#include <glibmm/i18n-lib.h>
 
 //#include <gtk/gtkfilesel.h>
 
@@ -93,7 +94,7 @@
 
   if(bOpenFailed)
   {
-    ui_warning(gettext("Open failed."), gettext("The document could not be opened."));
+    ui_warning(_("Open failed."), _("The document could not be opened."));
 
     return false; //failed.
   }
@@ -132,7 +133,7 @@
     }
 
     //Tell user that it's already open:
-    ui_warning(gettext("Document already open"), gettext("This document is already open."));
+    ui_warning(_("Document already open"), _("This document is already open."));
 
     return true; //success.
   }
@@ -185,7 +186,7 @@
 
     if(bOpenFailed)
     {
-      ui_warning(gettext("Open failed."), gettext("The document could not be opened."));
+      ui_warning(_("Open failed."), _("The document could not be opened."));
 
       if(bUsingNewInstance)
       {
@@ -278,7 +279,7 @@
 
       if(!bTest)
       {
-        ui_warning(gettext("Save failed."), gettext("There was an error while saving the file. Your changes have not been saved."));
+        ui_warning(_("Save failed."), _("There was an error while saving the file. Your changes have not been saved."));
       }
       else
       {
@@ -329,7 +330,7 @@
       else
       {
         //The save failed. Tell the user and don't do anything else:
-        ui_warning(gettext("Save failed."), gettext("There was an error while saving the file. Your changes have not been saved."));
+        ui_warning(_("Save failed."), _("There was an error while saving the file. Your changes have not been saved."));
 
         cancel_close_or_exit();
       }

Modified: trunk/bakery/App/App_WithDoc_Gtk.cc
==============================================================================
--- trunk/bakery/App/App_WithDoc_Gtk.cc	(original)
+++ trunk/bakery/App/App_WithDoc_Gtk.cc	Thu Dec 11 16:40:32 2008
@@ -148,7 +148,7 @@
   m_refFileActionGroup = Gtk::ActionGroup::create("BakeryFileActions");
 
   m_refFileActionGroup->add(Gtk::Action::create("BakeryAction_Menu_File", _("_File")));
-  m_refFileActionGroup->add(Gtk::Action::create("BakeryAction_Menu_File_RecentFiles", gettext("_Recent Files")));
+  m_refFileActionGroup->add(Gtk::Action::create("BakeryAction_Menu_File_RecentFiles", _("_Recent Files")));
 
   //File actions
   m_refFileActionGroup->add(Gtk::Action::create("BakeryAction_File_New", Gtk::Stock::NEW),
@@ -224,7 +224,7 @@
 
     //Indicate read-only files:
     if(pDoc->get_read_only())
-      strTitle += gettext(" (read-only)");
+      strTitle += _(" (read-only)");
 
     set_title(strTitle);
   }

Modified: trunk/bakery/App/Dialog_OfferSave.cc
==============================================================================
--- trunk/bakery/App/Dialog_OfferSave.cc	(original)
+++ trunk/bakery/App/Dialog_OfferSave.cc	Thu Dec 11 16:40:32 2008
@@ -1,16 +1,35 @@
+/*
+ * Copyright 2000 Murray Cumming
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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 Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "config.h"
 #include <bakery/App/Dialog_OfferSave.h>
 #include <bakery/App/App_Gtk.h>
 #include <gtkmm/box.h>
 #include <gtkmm/stock.h>
-#include <libintl.h>
+#include <glibmm/i18n-lib.h>
 
 namespace
 {
   Glib::ustring get_confirmation_message(const Glib::ustring& file_uri)
   {
-    Glib::ustring message = gettext("This document has unsaved changes. Would you like to save the document?");
+    Glib::ustring message = _("This document has unsaved changes. Would you like to save the document?");
     if(!file_uri.empty())
-      message += gettext("\n\nDocument:\n") + Glib::filename_display_basename(file_uri); //TODO: Can we use filename_display_basename() with a URI?
+      message += _("\n\nDocument:\n") + Glib::filename_display_basename(file_uri); //TODO: Can we use filename_display_basename() with a URI?
     return message;
   }
 }
@@ -23,7 +42,7 @@
 #ifdef BAKERY_MAEMO_ENABLED
 : Hildon::Note(Hildon::NOTE_TYPE_CONFIRMATION_BUTTON, get_confirmation_message(file_uri))
 #else
-: Gtk::MessageDialog( App_Gtk::util_bold_message(gettext("Close without Saving")), true /* use markup */, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_NONE)
+: Gtk::MessageDialog( App_Gtk::util_bold_message(_("Close without Saving")), true /* use markup */, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_NONE)
 #endif
 {
   set_title(""); //The HIG says that alert dialogs should not have titles. The default comes from the message type.
@@ -32,7 +51,7 @@
   set_secondary_text(get_confirmation_message(file_uri));
 #endif
 
-  add_button(gettext("Discard"), BUTTON_Discard);
+  add_button(_("Discard"), BUTTON_Discard);
   Gtk::Button* cancel_button = add_button(Gtk::Stock::CANCEL, BUTTON_Cancel);
   add_button(Gtk::Stock::SAVE, BUTTON_Save);
 

Modified: trunk/bakery/App/GtkDialogs.cc
==============================================================================
--- trunk/bakery/App/GtkDialogs.cc	(original)
+++ trunk/bakery/App/GtkDialogs.cc	Thu Dec 11 16:40:32 2008
@@ -30,7 +30,7 @@
 #include <gtkmm/messagedialog.h>
 #include <gtkmm/filechooserdialog.h>
 #include <giomm.h>
-#include <libintl.h>
+#include <glibmm/i18n-lib.h>
 
 
 namespace Bakery
@@ -62,7 +62,7 @@
 #ifdef BAKERY_MAEMO_ENABLED
   Hildon::FileChooserDialog fileChooser_Open(Gtk::FILE_CHOOSER_ACTION_OPEN);
 #else
-  Gtk::FileChooserDialog fileChooser_Open(gettext("Open Document"), Gtk::FILE_CHOOSER_ACTION_OPEN);
+  Gtk::FileChooserDialog fileChooser_Open(_("Open Document"), Gtk::FILE_CHOOSER_ACTION_OPEN);
   fileChooser_Open.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
   fileChooser_Open.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK);
   fileChooser_Open.set_default_response(Gtk::RESPONSE_OK);
@@ -122,7 +122,7 @@
 #ifdef BAKERY_MAEMO_ENABLED
   Hildon::FileChooserDialog fileChooser_Save(Gtk::FILE_CHOOSER_ACTION_SAVE);
 #else
-  Gtk::FileChooserDialog fileChooser_Save(gettext("Save Document"), Gtk::FILE_CHOOSER_ACTION_SAVE);
+  Gtk::FileChooserDialog fileChooser_Save(_("Save Document"), Gtk::FILE_CHOOSER_ACTION_SAVE);
   fileChooser_Save.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
   fileChooser_Save.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK);
   fileChooser_Save.set_default_response(Gtk::RESPONSE_OK);
@@ -185,7 +185,7 @@
         if(!uri_is_writable(gio_file))
         {
            //Warn the user:
-           ui_warning(app, gettext("Read-only File."), gettext("You may not overwrite the existing file, because you do not have sufficient access rights."));
+           ui_warning(app, _("Read-only File."), _("You may not overwrite the existing file, because you do not have sufficient access rights."));
            try_again = true; //Try again.
            continue;
         }
@@ -199,7 +199,7 @@
         if(!uri_is_writable(gio_file_parent))
         {
           //Warn the user:
-           ui_warning(app, gettext("Read-only Directory."), gettext("You may not create a file in this directory, because you do not have sufficient access rights."));
+           ui_warning(app, _("Read-only Directory."), _("You may not create a file in this directory, because you do not have sufficient access rights."));
            try_again = true; //Try again.
            continue;
         }

Modified: trunk/bakery/Configuration/Dialog_Preferences.cc
==============================================================================
--- trunk/bakery/Configuration/Dialog_Preferences.cc	(original)
+++ trunk/bakery/Configuration/Dialog_Preferences.cc	Thu Dec 11 16:40:32 2008
@@ -16,16 +16,17 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include "config.h"
 #include "bakery/Configuration/Dialog_Preferences.h"
 #include <gtkmm/stock.h>
-#include <libintl.h>
+#include <glibmm/i18n-lib.h>
 
 namespace Bakery
 {
 
 
 Dialog_Preferences::Dialog_Preferences(Gtk::Window& parent, const Glib::ustring& configuration_directory, const Glib::ustring& glade_filename, const Glib::ustring& widget_name, bool instant)
-  : Gtk::Dialog(gettext("Preferences"), parent),
+  : Gtk::Dialog(_("Preferences"), parent),
     m_Button_Close(Gtk::Stock::CLOSE),
     m_Button_Help(Gtk::Stock::HELP),
     m_instant(instant)

Modified: trunk/bakery/Document/Document.cc
==============================================================================
--- trunk/bakery/Document/Document.cc	(original)
+++ trunk/bakery/Document/Document.cc	Thu Dec 11 16:40:32 2008
@@ -16,10 +16,11 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include "config.h"
 #include "bakery/Document/Document.h"
 #include <giomm.h>
 //#include <fstream>
-#include <libintl.h>
+#include <glibmm/i18n-lib.h>
 
 namespace Bakery
 {
@@ -356,7 +357,7 @@
   //Show untitled explicitly:
   //Also happens for file_uris with path but no name. e.g. /sub/sub/, which shouldn't happen.
   if(strResult.empty())
-    strResult = gettext("Untitled");
+    strResult = _("Untitled");
 
   return strResult;
 }

Modified: trunk/examples/Configuration/ConfClient/examplewindow.cc
==============================================================================
--- trunk/examples/Configuration/ConfClient/examplewindow.cc	(original)
+++ trunk/examples/Configuration/ConfClient/examplewindow.cc	Thu Dec 11 16:40:32 2008
@@ -17,14 +17,15 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <libintl.h>
 
+#include "config.h"
 #include "examplewindow.h"
+#include <glibmm/i18n.h>
 
 ExampleWindow::ExampleWindow()
-: m_Frame_Instant(gettext("Instant-apply")), m_Frame_NotInstant(gettext("Load/Save")),
+: m_Frame_Instant(_("Instant-apply")), m_Frame_NotInstant(_("Load/Save")),
   m_Table_Instant(1, 2), m_Table_NotInstant(2, 3),
-  m_Label_Instant(gettext("foo")), m_Label_NotInstant(gettext("bar")),
+  m_Label_Instant(_("foo")), m_Label_NotInstant(_("bar")),
   m_Button_Load("Load"), m_Button_Save(Gtk::Stock::SAVE),
   m_ConfClient("/apps/gnome/bakery_examples/confclient")
 {

Modified: trunk/examples/Configuration/Dialog_Preferences/examplewindow.cc
==============================================================================
--- trunk/examples/Configuration/Dialog_Preferences/examplewindow.cc	(original)
+++ trunk/examples/Configuration/Dialog_Preferences/examplewindow.cc	Thu Dec 11 16:40:32 2008
@@ -16,15 +16,16 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
-#include <libintl.h>
-
+#include "config.h"
 #include "examplewindow.h"
 #include "exampledialog.h"
 #include <iostream>
+#include <glibmm/i18n.h>
+
 
 ExampleWindow::ExampleWindow()
-: m_Button_Preferences_Delayed(gettext("Preferences (apply on close)")),
-  m_Button_Preferences_Instant(gettext("Preferences (instant apply)"))
+: m_Button_Preferences_Delayed(_("Preferences (apply on close)")),
+  m_Button_Preferences_Instant(_("Preferences (instant apply)"))
 {  
   // Sets the border width of the window.
   set_border_width(10);

Modified: trunk/examples/WithDoc/appexample.cc
==============================================================================
--- trunk/examples/WithDoc/appexample.cc	(original)
+++ trunk/examples/WithDoc/appexample.cc	Thu Dec 11 16:40:32 2008
@@ -19,8 +19,9 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <libintl.h>
+#include "config.h"
 #include "appexample.h"
+#include <glibmm/i18n.h>
 
 AppExample::AppExample()
   : Bakery::App_WithDoc_Gtk("WithDoc"),
@@ -43,7 +44,7 @@
 {
   type_vecStrings vecAuthors;
   vecAuthors.push_back("Murray Cumming <murrayc usa net>");
-  set_about_information("0.1", vecAuthors, "(C) 2000 Murray Cumming", gettext("A Bakery example."));
+  set_about_information("0.1", vecAuthors, "(C) 2000 Murray Cumming", _("A Bakery example."));
 
   //Call base method:
   Bakery::App_WithDoc_Gtk::init();

Modified: trunk/examples/WithDocView/appexample.cc
==============================================================================
--- trunk/examples/WithDocView/appexample.cc	(original)
+++ trunk/examples/WithDocView/appexample.cc	Thu Dec 11 16:40:32 2008
@@ -19,9 +19,9 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <libintl.h>
-
+#include "config.h"
 #include "appexample.h"
+#include <glibmm/i18n.h>
 
 AppExample::AppExample()
   : Bakery::App_WithDoc_Gtk("WithDocView")
@@ -36,7 +36,7 @@
 {
   type_vecStrings vecAuthors;
   vecAuthors.push_back("Murray Cumming <murrayc usa net>");
-  set_about_information("0.1", vecAuthors, "(C) 2000 Murray Cumming", gettext("A Bakery example."));
+  set_about_information("0.1", vecAuthors, "(C) 2000 Murray Cumming", _("A Bakery example."));
 
   //Call base method:
   Bakery::App_WithDoc_Gtk::init();

Modified: trunk/examples/WithDocViewComposite/appexample.cc
==============================================================================
--- trunk/examples/WithDocViewComposite/appexample.cc	(original)
+++ trunk/examples/WithDocViewComposite/appexample.cc	Thu Dec 11 16:40:32 2008
@@ -19,9 +19,9 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  
-#include <libintl.h>
-
+#include "config.h"
 #include "appexample.h"
+#include <glibmm/i18n.h>"
 
 AppExample::AppExample()
   : Bakery::App_WithDoc_Gtk("WithDocView")
@@ -36,7 +36,7 @@
 {
   type_vecStrings vecAuthors;
   vecAuthors.push_back("Murray Cumming <murrayc usa net>");
-  set_about_information("0.1", vecAuthors, "(C) 2000 Murray Cumming", gettext("A Bakery example."));
+  set_about_information("0.1", vecAuthors, "(C) 2000 Murray Cumming", _("A Bakery example."));
 
   //Call base method:
   Bakery::App_WithDoc_Gtk::init();

Modified: trunk/examples/WithXmlDoc/appexample.cc
==============================================================================
--- trunk/examples/WithXmlDoc/appexample.cc	(original)
+++ trunk/examples/WithXmlDoc/appexample.cc	Thu Dec 11 16:40:32 2008
@@ -19,9 +19,9 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <libintl.h>
-
+#include "config.h"
 #include "appexample.h"
+#include <glibmm/i18n.h>
 
 AppExample::AppExample()
   : Bakery::App_WithDoc_Gtk("Bakery_Example_XML")
@@ -36,7 +36,7 @@
 {
   type_vecStrings vecAuthors;
   vecAuthors.push_back("Murray Cumming <murrayc usa net>");
-  set_about_information("1.0.0", vecAuthors, "(C) 2000 Murray Cumming", gettext("A Bakery XML example."));
+  set_about_information("1.0.0", vecAuthors, "(C) 2000 Murray Cumming", _("A Bakery XML example."));
 
   //Call base method:
   Bakery::App_WithDoc_Gtk::init();

Modified: trunk/examples/WithXmlDocGlade/appexample.cc
==============================================================================
--- trunk/examples/WithXmlDocGlade/appexample.cc	(original)
+++ trunk/examples/WithXmlDocGlade/appexample.cc	Thu Dec 11 16:40:32 2008
@@ -20,9 +20,9 @@
  */
 
 #include <bakeryconfig.h>
-#include <libintl.h>
-
+#include "config.h"
 #include "appexample.h"
+#include <glibmm/i18n.h>
 
 AppExample::AppExample(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade)
 : Bakery::App_WithDoc_Gtk(cobject, "Bakery_Example_Glade"),
@@ -46,7 +46,7 @@
 {
   type_vecStrings vecAuthors;
   vecAuthors.push_back("Murray Cumming <murrayc usa net>");
-  set_about_information("1.0.0", vecAuthors, "(C) 2000 Murray Cumming", gettext("A Bakery XML example, also using libglademm."));
+  set_about_information("1.0.0", vecAuthors, "(C) 2000 Murray Cumming", _("A Bakery XML example, also using libglademm."));
 
   //Call base method:
   Bakery::App_WithDoc_Gtk::init();

Modified: trunk/examples/WithoutDoc/appexample.cc
==============================================================================
--- trunk/examples/WithoutDoc/appexample.cc	(original)
+++ trunk/examples/WithoutDoc/appexample.cc	Thu Dec 11 16:40:32 2008
@@ -19,9 +19,9 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <libintl.h>
-
+#include "config.h"
 #include "appexample.h"
+#include <glibmm/i18n.h>
 
 AppExample::AppExample()
   : Bakery::App_Gtk("WithoutDoc"),
@@ -40,7 +40,7 @@
 {
   type_vecStrings vecAuthors;
   vecAuthors.push_back("Murray Cumming <murrayc usa net>");
-  set_about_information("0.1", vecAuthors, gettext("(C) 2000 Murray Cumming"), gettext("A Bakery example"));
+  set_about_information("0.1", vecAuthors, _("(C) 2000 Murray Cumming"), _("A Bakery example"));
 
   //Call base method:
   Bakery::App_Gtk::init();



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