From 5792eab5fd92f468c4ca58f2bf3a156e2e90f4c8 Mon Sep 17 00:00:00 2001 From: dbs Date: Sun, 18 Nov 2007 17:43:39 +0000 Subject: [PATCH] We will use the Makefile for property/DTD -> PO -> property/DTD format conversion git-svn-id: svn://svn.open-ils.org/ILS/trunk@8081 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- build/i18n/convert2po.py | 50 ---------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 build/i18n/convert2po.py diff --git a/build/i18n/convert2po.py b/build/i18n/convert2po.py deleted file mode 100644 index f6f21724f8..0000000000 --- a/build/i18n/convert2po.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env python -# ----------------------------------------------------------------------- -# Copyright (C) 2007 Laurentian University -# Dan Scott -# -# 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') -- 2.43.2