Browse Source

Generate locales when building a Debian package, suppress error message when LANG C is used

Helmut Pozimski 11 years ago
parent
commit
9475e2976a
10 changed files with 9 additions and 5 deletions
  1. 1 0
      CHANGELOG
  2. 2 0
      MANIFEST.in
  3. 0 2
      TODO
  4. 1 0
      debian/changelog
  5. 1 1
      debian/control
  6. 2 0
      debian/rules
  7. BIN
      locale/C/LC_MESSAGES/stov.mo
  8. 0 0
      locale/en/LC_MESSAGES/stov.po
  9. 0 1
      setup.py
  10. 2 1
      stov

+ 1 - 0
CHANGELOG

@@ -3,6 +3,7 @@
 
 * Set dependency to python >= 2.6 in debian/control
 * Fixed package internal import for python 3.x
+* Locales are now build in debian/rules when creating the package
  
 0.5
 ----

+ 2 - 0
MANIFEST.in

@@ -1,2 +1,4 @@
 include LICENSE
 include CHANGELOG
+include locale/en/LC_MESSAGES/stov.po
+include locale/de/LC_MESSAGES/stov.po

+ 0 - 2
TODO

@@ -1,6 +1,4 @@
 TODOs for 0.6:
 
 *Rework and correct strings
-*Compile localization files when installing instead of supplying binaries
 *Make the debian package lintian clean
-*Fix "C" locale

+ 1 - 0
debian/changelog

@@ -2,6 +2,7 @@ stov (0.6.1wip-1) stable; urgency=low
 
   * Changed minimal python version in debian/control to 2.6
   * Fixed package internal import for python 3.x
+  * Locales are now build in debian/rules when creating the package
 
  -- Helmut Pozimski <helmut@pozimski.eu>  Sun, 14 Apr 2013 23:31:23 +0200
 

+ 1 - 1
debian/control

@@ -3,7 +3,7 @@ XS-Python-Version: >= 2.6
 Maintainer: Helmut Pozimski <helmut@pozimski.eu>
 Section: python
 Priority: optional
-Build-Depends: python (>= 2.6), debhelper (>= 7.4.3)
+Build-Depends: python (>= 2.6), debhelper (>= 7.4.3), gettext
 Standards-Version: 3.9.1
 
 Package: stov

+ 2 - 0
debian/rules

@@ -7,4 +7,6 @@
 	dh $@ --with python2
 override_dh_auto_install:
 	python setup.py install --root=debian/stov --install-layout=deb --install-lib=/usr/share/stov --install-scripts=/usr/share/stov --install-data=/usr
+	msgfmt locale/de/LC_MESSAGES/stov.po --output-file debian/stov/usr/share/locale/de/LC_MESSAGES/stov.mo
+	msgfmt locale/en/LC_MESSAGES/stov.po --output-file debian/stov/usr/share/locale/en/LC_MESSAGES/stov.mo
 override_dh_auto_build:

BIN
locale/C/LC_MESSAGES/stov.mo


+ 0 - 0
locale/C/LC_MESSAGES/stov.po → locale/en/LC_MESSAGES/stov.po


+ 0 - 1
setup.py

@@ -37,6 +37,5 @@ setup(
 	scripts=["stov"],
 	data_files=[("share/locale/de/LC_MESSAGES",
 			["locale/de/LC_MESSAGES/stov.mo"]),
-			("share/locale/C/LC_MESSAGES", ["locale/C/LC_MESSAGES/stov.mo"]),
 			("share/locale/en/LC_MESSAGES", ["locale/en/LC_MESSAGES/stov.mo"])]
 	)

+ 2 - 1
stov

@@ -56,7 +56,8 @@ try:
 	trans = gettext.translation("stov", locale_path)
 except IOError:
 	gettext.install("stov")
-	printf(_("Translation files could not be found, localization "
+	if os.environ["LANG"] != "C" and os.environ["LANGUAGE"] != "C":
+		 printf(_("Translation files could not be found, localization "
 			"won't be available"), outputlevel="default",
 			descriptor="stderr")
 else: