Merge lp:~rachidbm/oneconf/trans-string-improvements into lp:oneconf

Proposed by Rachid
Status: Merged
Approved by: Didier Roche-Tolomelli
Approved revision: 189
Merged at revision: 249
Proposed branch: lp:~rachidbm/oneconf/trans-string-improvements
Merge into: lp:oneconf
Diff against target: 179 lines (+28/-28)
2 files modified
oneconf-query (+25/-25)
oneconf-service (+3/-3)
To merge this branch: bzr merge lp:~rachidbm/oneconf/trans-string-improvements
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Review via email: mp+74684@code.launchpad.net

Description of the change

As we discussed here: https://bugs.launchpad.net/ubuntu/+source/oneconf/+bug/831988

Is this the right way?
Just out of curiosity, how do you generate a POT?

Cheers,
Rachid.

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Yeah, this is exactly the right way! Thanks a lot :)

As those strings are only for people using debug and that we are passed UIFreeze now, I'll delay this merge "on hold" for next cycle (in 35 days). Otherwise, all looks good. I didn't intend to make all debug message translatable (as this is only a debugging tool), but if you feel they are important… :)

For generating the pot, I don't do it as part of the upstream release right now but only by ubuntu packaging system (on builders, when we built the package, the pot is generate using python-distutils-extra, running it from setup.py, and then the pot is imported in Launchpad automatically).

Thanks again for those fixes, will get it merged as soon as P lifecycle starts!

review: Approve
Revision history for this message
Rachid (rachidbm) wrote :

Because oneconf has a relatively high position on https://translations.launchpad.net/ubuntu/oneiric/+lang/nl?batch=30 (30th) I thought it was an important package.

Also thanks for explanation about POT.

Revision history for this message
Rachid (rachidbm) wrote :

I just found this merge proposal is still here :-)

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Oupsss, totally forgot about that one. Will merge it for Q then ;)
Sorry for that (fortunatly those tools aren't really visible to the public, like oneconf-query and oneconf-service shouldn't be use normally by the end user).

Sorry again, will do that ASAP :)

Revision history for this message
Rachid (rachidbm) wrote :

Okay thanks.

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Merging and pushing, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'oneconf-query'
2--- oneconf-query 2011-08-29 17:16:26 +0000
3+++ oneconf-query 2011-09-08 20:43:25 +0000
4@@ -39,25 +39,25 @@
5
6 def print_packages(installed_pkg):
7
8- print "Installed package:"
9+ print _("Installed package:")
10 for pkg_name in installed_pkg:
11 print pkg_name
12
13
14 def print_packages_diff(packages_to_install, packages_to_remove):
15
16- print "Additional packages: (package to install)"
17+ print _("Additional packages: (package to install)")
18 for pkg_name in packages_to_install:
19 print " %s" % pkg_name
20- print "Missing packages: (package to remove)"
21+ print _("Missing packages: (package to remove)")
22 for pkg_name in packages_to_remove:
23 print " %s" % pkg_name
24
25 def print_hosts(hosts, only_current=False):
26 if len(hosts) == 1 or only_current:
27- print "Listing this host stored in OneConf:"
28+ print _("Listing this host stored in OneConf:")
29 else:
30- print "Hosts stored for OneConf:"
31+ print _("Hosts stored for OneConf:")
32
33 for hostid in hosts:
34 current, name, share_inventory = hosts[hostid]
35@@ -68,11 +68,11 @@
36 print "ID: %s %s\n name: %s\n share inventory: %s" % (hostid, additional_text, name, share_inventory)
37
38 def err_scope():
39- print _("you can't define --all-packages, --manual-packages or --hosts together.")
40+ print _("You can't define --all-packages, --manual-packages or --hosts together.")
41 sys.exit(1)
42
43 def err_action():
44- print _("you can't define --list, --diff, --update, --async-update, --share-inventory, --stop, --get-last-sync together.")
45+ print _("You can't define --list, --diff, --update, --async-update, --share-inventory, --stop, --get-last-sync together.")
46 sys.exit(1)
47
48 def option_not_compatible(options, action):
49@@ -102,20 +102,20 @@
50 parser.add_option("--stop", action="store_true", dest="action_stopservice",
51 help=_("Stop oneconf service"))
52 parser.add_option("--debug", action="store_true", dest="debug",
53- help=_("enable debug mode (use --direct)"))
54+ help=_("Enable debug mode (use --direct)"))
55 parser.add_option("--direct", action="store_true", dest="directaccess",
56- help=_("don't use dbus for the request"))
57+ help=_("Don't use dbus for the request"))
58 scope_group = OptionGroup(parser, "Scope of actions:", "This define the " \
59 "scope to consider for list and diff command.")
60 scope_group.add_option("--all-packages", action="store_true",
61 dest="scope_all_packages",
62- help=_("get all installed packages from storage"))
63+ help=_("Get all installed packages from storage"))
64 scope_group.add_option("--manual-packages", action="store_true",
65 dest="scope_manual_packages",
66- help=_("get only manual installed packages from storage"))
67+ help=_("Get only manual installed packages from storage"))
68 scope_group.add_option("--hosts", action="store_true",
69 dest="scope_hosts",
70- help=_("all available hosts from storage (only with list)"))
71+ help=_("All available hosts from storage (only with list)"))
72 scope_group.add_option("--host", action="store_true",
73 dest="scope_host",
74 help=_("This host (only with list)"))
75@@ -124,19 +124,19 @@
76 "list actions. List hosts to get registered strings.")
77 # default is '' for dbus compatible format
78 scope_hosts.add_option("--hostname", action="store", dest="hostname",
79- help=_("specify target host"), default='')
80+ help=_("Specify target hostname"), default='')
81 scope_hosts.add_option("--hostid", action="store", dest="hostid",
82- help=_("specify target host"), default='')
83+ help=_("Specify target hostid"), default='')
84 scope_manage_host = OptionGroup(parser, "host management:",
85 "Those options can't be used with anything else and are "
86 "present to manage host parameters.")
87 scope_manage_host.add_option("--share-inventory", action="store_true",
88 dest="share_inventory",
89- help=_("share this inventory on the web"),
90+ help=_("Share this inventory on the web"),
91 default=None)
92 scope_manage_host.add_option("--hide-inventory", action="store_false",
93 dest="share_inventory",
94- help=_("hide this inventory on the web"),
95+ help=_("Hide this inventory on the web"),
96 default=None)
97 parser.add_option_group(scope_group)
98 parser.add_option_group(scope_hosts)
99@@ -213,26 +213,26 @@
100 action = ACTION_LIST
101
102 if options.hostid and options.hostname:
103- print _("hostid and hostname can't be provided together")
104+ print _("hostid and hostname can't be provided together.")
105 sys.exit(1)
106
107 if action == ACTION_UPDATE:
108 if options.hostid or options.hostname:
109- print _("You can't use hostid or hostname when updating")
110+ print _("You can't use hostid or hostname when updating.")
111 sys.exit(1)
112 if scope != SCOPE_NONE:
113 print _("You can't define --package, --host or --hosts " \
114- "when updating")
115+ "when updating.")
116 sys.exit(1)
117 oneconf.update()
118
119 elif action == ACTION_ASYNC_UPDATE:
120 if options.hostid or options.hostname:
121- print _("You can't use hostid or hostname when updating")
122+ print _("You can't use hostid or hostname when updating.")
123 sys.exit(1)
124 if scope != SCOPE_NONE:
125 print _("You can't define --package, --host or --hosts " \
126- "when updating")
127+ "when updating.")
128 sys.exit(1)
129 oneconf.async_update()
130
131@@ -253,7 +253,7 @@
132 elif action == ACTION_DIFF:
133 if not options.hostid and not options.hostname:
134 print _("You have to provide either hostid or hostname for " \
135- "getting a diff")
136+ "getting a diff.")
137 sys.exit(1)
138 if scope == SCOPE_NONE:
139 scope = SCOPE_ALL_PACKAGES
140@@ -271,16 +271,16 @@
141 elif action == ACTION_SHARE_INVENTORY:
142 if scope != SCOPE_NONE:
143 print _("You can't define --package, --host or --hosts " \
144- "when changing show inventory status")
145+ "when changing show inventory status.")
146 oneconf.set_share_inventory(options.share_inventory, options.hostid, options.hostname)
147
148 elif action == ACTION_GET_LAST_SYNC:
149 if options.hostid or options.hostname:
150- print _("You can't use hostid or hostname when changing show inventory status")
151+ print _("You can't use hostid or hostname when changing show inventory status.")
152 sys.exit(1)
153 if scope != SCOPE_NONE:
154 print _("You can't define --package, --host or --hosts " \
155- "when changing show inventory status")
156+ "when changing show inventory status.")
157 print oneconf.get_last_sync_date()
158
159 elif action == ACTION_STOP_SERVICE:
160
161=== modified file 'oneconf-service'
162--- oneconf-service 2011-08-30 06:05:06 +0000
163+++ oneconf-service 2011-09-08 20:43:25 +0000
164@@ -72,12 +72,12 @@
165 return True
166
167 if __name__ == '__main__':
168- usage = _("usage: %prog [options]")
169+ usage = _("Usage: %prog [options]")
170 parser = OptionParser(version= "%prog " + VERSION, usage=usage)
171 parser.add_option("--debug", action="store_true", dest="debug",
172- help=_("enable debug mode"))
173+ help=_("Enable debug mode."))
174 parser.add_option("--mock", action="store_true", dest="mock",
175- help=_("use the mock infrastructure"))
176+ help=_("Use the mock infrastructure."))
177 (options, args) = parser.parse_args()
178 # set verbosity
179 if options.debug:

Subscribers

People subscribed via source and target branches