[dots/remove-assistant: 28/38] i18n
- From: Fernando Herrera de las Heras <fherrera src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dots/remove-assistant: 28/38] i18n
- Date: Thu, 15 Jul 2010 21:09:20 +0000 (UTC)
commit 4080096c9d77fd14cd839e0ac5cbda2b83eec424
Author: Fernando Herrera <fherrera onirica com>
Date: Wed Jul 14 21:19:14 2010 +0200
i18n
Makefile.am | 2 +-
configure.ac | 11 ++++++-----
dots/app_window.py | 17 ++++++++++++++---
dots/host_settings.py.in | 6 +++++-
4 files changed, 26 insertions(+), 10 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index a9501b8..d60badb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1 +1 @@
-SUBDIRS = bin dots data
+SUBDIRS = bin dots data po
diff --git a/configure.ac b/configure.ac
index 7d9e13d..67b3498 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,13 +28,13 @@ You need antiword for MS Word document support.
AC_SUBST(ANTIWORD)
dnl == i18n ==
-#GETTEXT_PACKAGE=dots
-#AC_SUBST(GETTEXT_PACKAGE)
-#AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The gettext package])
-#AM_GLIB_GNU_GETTEXT
+GETTEXT_PACKAGE=dots
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The gettext package])
+AM_GLIB_GNU_GETTEXT
dnl == intltool check ==
-#IT_PROG_INTLTOOL([0.35.0])
+IT_PROG_INTLTOOL([0.35.0])
dnl == gconf check ==
AC_PATH_PROG(GCONFTOOL, gconftool-2)
@@ -48,4 +48,5 @@ bin/dots
dots/Makefile
dots/host_settings.py
data/Makefile
+po/Makefile.in
])
diff --git a/dots/app_window.py b/dots/app_window.py
index 14ebbde..30b2264 100644
--- a/dots/app_window.py
+++ b/dots/app_window.py
@@ -19,16 +19,25 @@ import gtk, glib
import os, tempfile
from config_builder import ConfigBuilder
import host_settings
+import gettext
from dots_project import DotsProject
from document_builder import document_new
import gconf
import gtkunixprint
+import gettext
+gettext.bindtextdomain(host_settings.DOMAIN,host_settings.LOCALE_DIR)
+gettext.textdomain(host_settings.DOMAIN)
+_ = gettext.gettext
+
class AppWindow(object):
def __init__(self):
self.project = None
self.document = None
self.main_xml = gtk.Builder()
+ print host_settings.DOMAIN
+ self.main_xml.set_translation_domain(host_settings.DOMAIN)
+ print host_settings.DOMAIN
self.main_xml.add_from_file (
os.path.join(host_settings.gtkbuilder_dir, 'app_window.xml'))
self.window = self.main_xml.get_object('window1')
@@ -37,6 +46,7 @@ class AppWindow(object):
self.client = gconf.client_get_default ()
self.client.add_dir ("/apps/dots", gconf.CLIENT_PRELOAD_NONE)
self.conf_xml = gtk.Builder()
+ self.conf_xml.set_translation_domain(host_settings.DOMAIN)
self.conf_xml.add_from_file (
os.path.join(host_settings.gtkbuilder_dir, 'config.xml'))
@@ -161,12 +171,13 @@ class AppWindow(object):
chooser = gtk.FileChooserDialog(title=None,action=gtk.FILE_CHOOSER_ACTION_OPEN,
buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK))
filter = gtk.FileFilter()
- filter.set_name("All files")
+ filter.set_name(_("All files"))
filter.add_pattern("*")
chooser.add_filter(filter)
filter = gtk.FileFilter()
- filter.set_name("Documents")
+ filter.set_name(_("Documents"))
+ print _("Documents")
filter.add_mime_type("application/pdf")
filter.add_mime_type("application/vnd.oasis.opendocument.text")
filter.add_mime_type("application/xhtml+xml")
@@ -274,7 +285,7 @@ class AppWindow(object):
if self.project is not None:
container.remove (self.project)
- self.project = DotsProject(document, "Unsaved Document")
+ self.project = DotsProject(document, _("Unsaved Document"))
container.add(self.project)
self.project.show_all()
self.project.connect("line-changed", self._onLineChanged)
diff --git a/dots/host_settings.py.in b/dots/host_settings.py.in
index 9c081f8..7663d11 100644
--- a/dots/host_settings.py.in
+++ b/dots/host_settings.py.in
@@ -25,5 +25,9 @@ xml2brl = "@XML2BRL@"
tablesdir = "@TABLES_DIR@"
-gtkbuilder_dir = os.path.join(sys.prefix, 'share', 'dots')
+gtkbuilder_dir = os.path.join("@prefix@", 'share', 'dots')
+
+LOCALE_DIR = os.path.join("@prefix@", '@DATADIRNAME@', 'locale')
+DOMAIN = '@GETTEXT_PACKAGE@'
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]