[open-ils-commits] r8081 - trunk/build/i18n

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Nov 18 13:00:55 EST 2007


Author: dbs
Date: 2007-11-18 12:43:39 -0500 (Sun, 18 Nov 2007)
New Revision: 8081

Removed:
   trunk/build/i18n/convert2po.py
Log:
We will use the Makefile for property/DTD -> PO -> property/DTD format conversion


Deleted: trunk/build/i18n/convert2po.py
===================================================================
--- trunk/build/i18n/convert2po.py	2007-11-18 17:41:48 UTC (rev 8080)
+++ trunk/build/i18n/convert2po.py	2007-11-18 17:43:39 UTC (rev 8081)
@@ -1,50 +0,0 @@
-#!/usr/bin/env python
-# -----------------------------------------------------------------------
-# Copyright (C) 2007  Laurentian University
-# Dan Scott <dscott at laurentian.ca>
-# 
-# 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 General Public License for more details.
-# --------------------------------------------------------------------
-#
-# Generates a complete set of PO files from DTD and JavaScript property
-# files for use in translation.
-#
-# DTD files are placed in a /dtd/ subdirectory and property files are
-# placed in a /property/ subdirectory so that we can round-trip the
-# files back into DTD and property file format once they have been
-# translated.
-#
-# Prerequisite: Translate Toolkit from http://translate.sourceforge.net/
-
-import glob
-import os.path
-from translate.convert import moz2po
-
-def convert2po(dir, extension):
-    """
-    Run moz2po on property and entity files to generate PO files.
-
-    For each property or entity file:
-        moz2po.main(["-i", "(name).ext", "-o", "(name).po"])
-    """
-    files = os.path.abspath(dir)
-    for file in glob.glob(os.path.join(files , '*.' + extension)):
-        base = os.path.basename(file)
-        sep = base.find(".")
-        root = base[:sep]
-        target = os.path.join(os.path.abspath('.'), extension);
-        if os.access(target, os.F_OK) is False:
-            os.mkdir(target)
-        moz2po.main(["-i", file, "-o", os.path.join(target, root + ".po"), "--progress", "none"])
-
-if __name__=='__main__':
-    convert2po('../../Open-ILS/web/opac/locale/en-US/', 'dtd')
-    convert2po('../../Open-ILS/xul/staff_client/chrome/locale/en-US/', 'properties')



More information about the open-ils-commits mailing list