/usr/share/svn-workbench/make_po_file.py is in svn-workbench 1.8.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | #!/usr/bin/python
import sys
import os
import wb_version
import datetime
args = {'WB_LOCALE': sys.argv[1]}
if os.path.exists( 'I18N/pysvn_workbench_%(WB_LOCALE)s.po' % args ):
print 'Info: Update %(WB_LOCALE)s from I18N/pysvn_workbench.current.pot' % args
rc = os.system( 'msginit '
'--input=I18N/pysvn_workbench.current.pot '
'--locale=${WB_LOCALE} '
'--no-wrap '
'--no-translator '
'--output-file=I18N/pysvn_workbench_%(WB_LOCALE)s.tmp.po' % args )
if rc != 0:
sys.exit( rc )
rc = os.system( 'msgmerge '
'I18N/pysvn_workbench_%(WB_LOCALE)s.po '
'I18N/pysvn_workbench_%(WB_LOCALE)s.tmp.po '
'--quiet '
'--no-wrap '
'--output-file=I18N/pysvn_workbench_%(WB_LOCALE)s.current.po' % args )
if rc != 0:
sys.exit( rc )
else:
print 'Info: Create %(WB_LOCALE)s from I18N/pysvn_workbench.current.pot' % args
rc = os.system( 'msginit '
'--input=I18N/pysvn_workbench.current.pot '
'--locale=%(WB_LOCALE)s.UTF-8 '
'--no-wrap '
'--no-translator '
'--output-file=I18N/pysvn_workbench_%(WB_LOCALE)s.current.po' % args )
if rc != 0:
sys.exit( rc )
print 'Info: Version brand %(WB_LOCALE)s from I18N/pysvn_workbench.current.pot' % args
po_filename = 'I18N/pysvn_workbench_%(WB_LOCALE)s.current.po' % args
all_po_lines = open( po_filename, 'r' ).readlines()
for index, line in enumerate( all_po_lines ):
if line.startswith( '"Project-Id-Version:' ):
all_po_lines[ index ] = ('"Project-Id-Version: WorkBench %d.%d.%d.%d\\n"\n' %
(wb_version.major
,wb_version.minor
,wb_version.patch
,wb_version.build))
elif line.startswith( '"PO-Revision-Date:' ):
all_po_lines[ index ] = '"PO-Revision-Date: %s\\n"\n' % (datetime.datetime.now().isoformat(' '),)
elif line.startswith( '"Content-Type: text/plain; charset=' ):
all_po_lines[ index ] = '"Content-Type: text/plain; charset=UTF-8\\n"\n'
open( po_filename, 'w' ).write( ''.join( all_po_lines ) )
sys.exit( 0 )
|