Skip to content

Commit

Permalink
add replacement regex for property "%{appName}" (support for intentde…
Browse files Browse the repository at this point in the history
…finition localization for iOS 12)
  • Loading branch information
metasmile committed Sep 20, 2018
1 parent ed178d8 commit 5ddfdaa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions strsync/strsync_playground.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
%10c%5hc%5C%5lc
The temp is %.*f
%ss%lii
${replacement}
%*.*s | %.3d | %lC | %s%%%02d'''

cfmt='''\
Expand All @@ -49,8 +50,10 @@
(?:\.(?:\d+|\*))? # precision
(?:h|l|ll|w|I|I32|I64)? # size
[cCdiouxXeEfgGaAnpsSZ@] # type
) | # OR
%%) # literal "%%"
) # OR
| \$\{.+\} # replacement for property "%{appName}"
| %% # literal "%%"
)
'''

for line in lines.splitlines():
Expand Down
6 changes: 4 additions & 2 deletions strsync/strtrans.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
(?:\.(?:\d+|\*))? # precision
(?:h|l|ll|w|I|I32|I64)? # size
[cCdiouxXeEfgGaAnpsSZ@] # type
) | # OR
%%) # literal "%%"
) # OR
| \$\{.+\} # replacement for property "%{appName}"
| %% # literal "%%"
)
'''
__LITERNAL_FORMAT_RE__ = re.compile(__LITERAL_REGEX__, flags=re.X)

Expand Down

0 comments on commit 5ddfdaa

Please sign in to comment.