Created
August 12, 2011 02:51
-
-
Save saiten/1141339 to your computer and use it in GitHub Desktop.
%1$d,%2$dみたいな置換文字列に対応させる
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** localecompiler.py.orig 2011-08-12 11:43:31.000000000 +0900 | |
--- localecompiler.py 2011-08-12 11:44:00.000000000 +0900 | |
*************** | |
*** 72,77 **** | |
--- 72,79 ---- | |
pass | |
value = self.getText(node.childNodes) | |
# TODO: translate any more symbols? | |
+ value = re.sub(r'%(\d+)\$d', r'%\1$.0f', value) | |
+ value = re.sub(r'%(\d+)\$s', r'%\1$@', value) | |
value = value.replace("%s",'%@') | |
f.write(u'"%s" = "%s";\n' % (name,value)) | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment