Skip to content

Added support for setting string resources in generated strings.xml #266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 9, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,9 @@ def make_package(args):
ap.add_argument('--meta-data', dest='meta_data', action='append',
help='Custom key=value to add in application metadata')

ap.add_argument('--resource', dest='resource', action='append',
help='Custom key=value to add in strings.xml resource file')

args = ap.parse_args()

if not args.dir and not args.private and not args.launcher:
Expand All @@ -470,6 +473,9 @@ def make_package(args):
if args.meta_data is None:
args.meta_data = []

if args.resource is None:
args.resource = []

if args.compile_pyo:
if PYTHON is None:
ap.error('To use --compile-pyo, you need Python 2.7.1 installed '
Expand Down
4 changes: 4 additions & 0 deletions src/templates/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@
<string name="public_version">{{ public_version }}</string>
{% endif %}
<string name="urlScheme">{{ url_scheme }}</string>
{% for m in args.resource %}
<string name="{{ m.split('=', 1)[0] }}">{{ m.split('=', 1)[-1] }}</string>
{% endfor %}

</resources>