Skip to content

Commit

Permalink
[#2774] I18n re-enable mangling of some formats
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Aug 6, 2012
1 parent 899df81 commit 3fbfe7d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ckan/lib/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1549,12 +1549,14 @@ def mangle_po(self):
pot_path = os.path.join(self.i18n_path, 'ckan.pot')
po = polib.pofile(pot_path)
# we don't want to mangle the following items in strings
# %(...)s %s %0.3f etc
# %(...)s %s %0.3f [1:...] {...} etc

# sprintf bit after %
spf_reg_ex = "\+?(0|'.)?-?\d*(.\d*)?[\%bcdeufosxX"

extract_reg_ex = '(\%\([^\)]*\)' + spf_reg_ex + \
'|\[\d*\:[^\]]*\]' + \
'|\{[^\}]*\}' + \
'|\%(\d)*\$' + spf_reg_ex + ')'

for entry in po:
Expand Down

0 comments on commit 3fbfe7d

Please sign in to comment.