mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 07:52:35 +03:00
Properly support escaped strings
See: https://developer.android.com/guide/topics/resources/string-resource.html
This commit is contained in:
parent
2231e72812
commit
d0b5e60369
1 changed files with 8 additions and 1 deletions
|
@ -859,6 +859,13 @@ class vcs_bzr(vcs):
|
|||
p.output.splitlines()]
|
||||
|
||||
|
||||
def unescape_string(string):
|
||||
if string[0] == '"' and string[-1] == '"':
|
||||
return string[1:-1]
|
||||
|
||||
return string.replace("\\'", "'")
|
||||
|
||||
|
||||
def retrieve_string(app_dir, string, xmlfiles=None):
|
||||
|
||||
if xmlfiles is None:
|
||||
|
@ -872,7 +879,7 @@ def retrieve_string(app_dir, string, xmlfiles=None):
|
|||
xmlfiles += [os.path.join(r, x) for x in f if x.endswith('.xml')]
|
||||
|
||||
if not string.startswith('@string/'):
|
||||
return string.replace("\\'", "'")
|
||||
return unescape_string(string)
|
||||
|
||||
name = string[len('@string/'):]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue