diff options
author | 2021-11-16 10:00:43 +0000 | |
---|---|---|
committer | 2021-11-16 10:00:43 +0000 | |
commit | b95bd17191b37fec93e89c6c50b3e3be818aa67b (patch) | |
tree | 77b5078d18442d6a935718870e0b0a65cae4c633 /gen_strings.py | |
parent | a60e6f8b97711f3e813b3c189cd406a6adbf4a47 (diff) |
Update gen_strings.py based on the updated format for using plural
strings.
Test: Manual atest
Bug: 199229956
Change-Id: I1bdb1edeebe71096b62f7496fcf8b9efca7934ff
Diffstat (limited to 'gen_strings.py')
-rwxr-xr-x | gen_strings.py | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/gen_strings.py b/gen_strings.py index a3d98be50..23b3315df 100755 --- a/gen_strings.py +++ b/gen_strings.py @@ -38,42 +38,42 @@ for verb in verbs: if verb == "trash": print Template(''' <!-- Dialog title asking if user will allow $verb permission to the $data item displayed below this string. [CHAR LIMIT=128] --> -<plurals name="permission_${verb}_${data}"> - <item quantity="one">Allow <xliff:g id="app_name" example="Gmail">^1</xliff:g> to move this $datalabel to trash?</item> - <item quantity="other">Allow <xliff:g id="app_name" example="Gmail">^1</xliff:g> to move <xliff:g id="count" example="42">^2</xliff:g> ${datalabel}s to trash?</item> -</plurals> +<string name="permission_${verb}_${data}"> {count, plural, + =1 {Allow <xliff:g id="app_name" example="Gmail">^1</xliff:g> to move this $datalabel to trash?} + other {Allow <xliff:g id="app_name" example="Gmail">^1</xliff:g> to move <xliff:g id="count" example="42">^2</xliff:g> ${datalabel}s to trash?} +}</string> ''').substitute(vars()).strip("\n") print Template(''' <!-- Progress dialog message after user allows $verb permission to the $data item [CHAR LIMIT=128] --> -<plurals name="permission_progress_${verb}_${data}"> - <item quantity="one">Moving $datalabel to trash…</item> - <item quantity="other">Moving <xliff:g id="count" example="42">^1</xliff:g> ${datalabel}s to trash…</item> -</plurals> +<string name="permission_progress_${verb}_${data}"> {count, plural, + =1 {Moving $datalabel to trash…} + other {Moving <xliff:g id="count" example="42">^1</xliff:g> ${datalabel}s to trash…} +}</string> ''').substitute(vars()).strip("\n") elif verb == "untrash": print Template(''' <!-- Dialog title asking if user will allow $verb permission to the $data item displayed below this string. [CHAR LIMIT=128] --> -<plurals name="permission_${verb}_${data}"> - <item quantity="one">Allow <xliff:g id="app_name" example="Gmail">^1</xliff:g> to move this $datalabel out of trash?</item> - <item quantity="other">Allow <xliff:g id="app_name" example="Gmail">^1</xliff:g> to move <xliff:g id="count" example="42">^2</xliff:g> ${datalabel}s out of trash?</item> -</plurals> +<string name="permission_${verb}_${data}"> {count, plural, + =1 {Allow <xliff:g id="app_name" example="Gmail">^1</xliff:g> to move this $datalabel out of trash?} + other {Allow <xliff:g id="app_name" example="Gmail">^1</xliff:g> to move <xliff:g id="count" example="42">^2</xliff:g> ${datalabel}s out of trash?} +}</string> ''').substitute(vars()).strip("\n") print Template(''' <!-- Progress dialog message after user allows $verb permission to the $data item [CHAR LIMIT=128] --> -<plurals name="permission_progress_${verb}_${data}"> - <item quantity="one">Moving $datalabel out of trash…</item> - <item quantity="other">Moving <xliff:g id="count" example="42">^1</xliff:g> ${datalabel}s out of trash…</item> -</plurals> +<string name="permission_progress_${verb}_${data}"> {count, plural, + =1 {Moving $datalabel out of trash…} + other {Moving <xliff:g id="count" example="42">^1</xliff:g> ${datalabel}s out of trash…} +}</string> ''').substitute(vars()).strip("\n") else: print Template(''' <!-- Dialog title asking if user will allow $verb permission to the $data item displayed below this string. [CHAR LIMIT=128] --> -<plurals name="permission_${verb}_${data}"> - <item quantity="one">Allow <xliff:g id="app_name" example="Gmail">^1</xliff:g> to $verblabel this $datalabel?</item> - <item quantity="other">Allow <xliff:g id="app_name" example="Gmail">^1</xliff:g> to $verblabel <xliff:g id="count" example="42">^2</xliff:g> ${datalabel}s?</item> -</plurals> +<string name="permission_${verb}_${data}"> {count, plural, + =1 {Allow <xliff:g id="app_name" example="Gmail">^1</xliff:g> to $verblabel this $datalabel?} + other {Allow <xliff:g id="app_name" example="Gmail">^1</xliff:g> to $verblabel <xliff:g id="count" example="42">^2</xliff:g> ${datalabel}s?} +}</string> ''').substitute(vars()).strip("\n") if verb == "write": actionLabel = "Modifying" @@ -81,10 +81,10 @@ for verb in verbs: actionLabel = "Deleting" print Template(''' <!-- Progress dialog message after user allows $verb permission to the $data item [CHAR LIMIT=128] --> -<plurals name="permission_progress_${verb}_${data}"> - <item quantity="one">$actionLabel $datalabel…</item> - <item quantity="other">$actionLabel <xliff:g id="count" example="42">^1</xliff:g> ${datalabel}s…</item> -</plurals> +<string name="permission_progress_${verb}_${data}"> {count, plural, + =1 {$actionLabel $datalabel…} + other {$actionLabel <xliff:g id="count" example="42">^1</xliff:g> ${datalabel}s…} +}</string> ''').substitute(vars()).strip("\n") print ''' |