Merge lp:~kissiel/checkbox/forced-lang into lp:checkbox

Proposed by Maciej Kisielewski
Status: Merged
Approved by: Chris Wayne
Approved revision: 4370
Merged at revision: 4375
Proposed branch: lp:~kissiel/checkbox/forced-lang
Merge into: lp:checkbox
Diff against target: 48 lines (+10/-4)
1 file modified
checkbox-touch/build-me (+10/-4)
To merge this branch: bzr merge lp:~kissiel/checkbox/forced-lang
Reviewer Review Type Date Requested Status
Po-Hsu Lin Approve
Review via email: mp+295479@code.launchpad.net

Description of the change

This MR brings an option to build click package with a forced language option.

This will make ignore your language settings on your Ubuntu Device.

To test it run ./build-me --forced-lang=pl_PL or any language you'd like.

To post a comment you must log in.
Revision history for this message
Paul Larson (pwlars) wrote :

It builds ok for me, is there a good way to test it locally or would I need to run it on a real device?

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Verified this on a Turbo, with locale set to English:

After the following command:
    make build-translations
    ./build-me --forced-lang=pl --install

The Checkbox interface has been changed to Polish as expected.

review: Approve
Revision history for this message
Chris Wayne (cwayne) wrote :

LGTM, and since Sam was able to verify it, approving.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox-touch/build-me'
2--- checkbox-touch/build-me 2016-05-19 04:13:40 +0000
3+++ checkbox-touch/build-me 2016-05-23 14:02:48 +0000
4@@ -143,6 +143,9 @@
5 parser.add_argument("--port",
6 action='store', type=int,
7 help="Port to use when using ssh. Requires --ssh")
8+ parser.add_argument("--forced-lang", action='store', type=str,
9+ help=("Force checkbox to run in a given language. "
10+ "I.e. pl_PL, zh_CN"))
11 args = parser.parse_args()
12 if args.port and not args.ssh:
13 parser.error("--port without --ssh doesn't make sense!")
14@@ -199,7 +202,7 @@
15 f.write(json.dumps(new_manifest, sort_keys=True, indent=4))
16 build_i18n()
17
18- generate_desktop_file()
19+ generate_desktop_file(lang=args.forced_lang)
20
21 if not os.path.exists('../build-cbt'):
22 os.makedirs('../build-cbt')
23@@ -305,19 +308,22 @@
24 rsync_tree(lib_path, 'lib', preserve_symlinks=1)
25
26
27-def generate_desktop_file():
28+def generate_desktop_file(lang=None):
29+ exec_line = "qmlscene --settings=settings.json {import_options} $@ checkbox-touch.qml"
30+ if lang:
31+ exec_line = 'bash -c "LANGUAGE={} {}"'.format(lang, exec_line)
32 template = textwrap.dedent("""
33 # This file has been generated by build-me script
34 [Desktop Entry]
35 Name=Checkbox
36 Comment=System testing utility for Ubuntu
37- Exec=qmlscene --settings=settings.json {import_options} $@ checkbox-touch.qml
38+ Exec={}
39 Icon=checkbox-touch.svg
40 Terminal=false
41 Type=Application
42 X-Ubuntu-Touch=true
43 X-Ubuntu-Supported-Orientations=portrait
44- """)
45+ """.format(exec_line)).lstrip()
46 import_opts = ['-I lib/py/plainbox/data/plainbox-qml-modules']
47 for provider in os.listdir('providers'):
48 provider_data_dir = os.path.join('providers', provider, 'data')

Subscribers

People subscribed via source and target branches