Merge lp:~unity-team/unity-lens-applications/i18n into lp:unity-lens-applications
- i18n
- Merge into trunk
Proposed by
Mikkel Kamstrup Erlandsen
Status: | Merged |
---|---|
Merged at revision: | 74 |
Proposed branch: | lp:~unity-team/unity-lens-applications/i18n |
Merge into: | lp:unity-lens-applications |
Diff against target: |
355 lines (+107/-54) 7 files modified
Makefile.am (+2/-2) configure.ac (+51/-14) po/POTFILES.in (+5/-0) po/POTFILES.skip (+4/-0) src/Makefile.am (+7/-3) src/daemon.vala (+36/-33) src/main.vala (+2/-2) |
To merge this branch: | bzr merge lp:~unity-team/unity-lens-applications/i18n |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Neil J. Patel (community) | Needs Fixing | ||
Review via email: mp+33381@code.launchpad.net |
Commit message
Description of the change
Adds i18n support and marks all user visible strings for translation. Distcheck is passing.
To post a comment you must log in.
- 76. By Mikkel Kamstrup Erlandsen
-
Add AM_GLIB_GNU_GETTEXT
Prettify autoconf message
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote : | # |
I added the AM_GLIB_GNU_GETTEXT macro, but not the first ALL_LINGUAS one - as discussed on IRC
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Makefile.am' |
2 | --- Makefile.am 2010-07-22 16:33:41 +0000 |
3 | +++ Makefile.am 2010-08-23 14:42:46 +0000 |
4 | @@ -1,4 +1,4 @@ |
5 | -SUBDIRS = src data |
6 | +SUBDIRS = src data po |
7 | |
8 | # |
9 | # Install the applications.place file |
10 | @@ -7,7 +7,7 @@ |
11 | applications_place_DATA = applications.place |
12 | |
13 | |
14 | -DISTCHECK_CONFIGURE_FLAGS = |
15 | +DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall |
16 | |
17 | # ChangeLog file created at distcheck time |
18 | dist-hook: |
19 | |
20 | === modified file 'configure.ac' |
21 | --- configure.ac 2010-08-19 14:40:28 +0000 |
22 | +++ configure.ac 2010-08-23 14:42:46 +0000 |
23 | @@ -3,14 +3,18 @@ |
24 | |
25 | AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) |
26 | |
27 | -dnl Silent build rules |
28 | +############################################# |
29 | +# Silent build rules |
30 | +############################################# |
31 | m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) |
32 | |
33 | AC_PREREQ(2.59) |
34 | |
35 | AC_CONFIG_HEADERS([config.h]) |
36 | |
37 | -dnl Init the other things we depend on |
38 | +############################################# |
39 | +# Init the other things we depend on |
40 | +############################################# |
41 | AM_MAINTAINER_MODE |
42 | AM_PROG_VALAC([0.8.0]) |
43 | AS_IF([test -z "$VALAC"], [AC_MSG_ERROR(["No valac compiler found."])]) |
44 | @@ -21,11 +25,26 @@ |
45 | LT_INIT |
46 | AC_CONFIG_MACRO_DIR([m4]) |
47 | |
48 | +############################################# |
49 | +# Gettext |
50 | +############################################# |
51 | +GETTEXT_PACKAGE="$PACKAGE" |
52 | +AC_SUBST(GETTEXT_PACKAGE) |
53 | +AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS']) |
54 | +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [gettext domain]) |
55 | +AM_GNU_GETTEXT([external]) |
56 | +AM_GNU_GETTEXT_VERSION([0.17]) |
57 | +IT_PROG_INTLTOOL([0.35.0]) |
58 | + |
59 | AC_DEFINE_UNQUOTED(LOCALE_DIR, "${PREFIX}/${DATADIRNAME}/locale",[Locale directory]) |
60 | AC_DEFINE_UNQUOTED(DATADIR, "${PREFIX}/${DATADIRNAME}",[Data directory]) |
61 | AC_DEFINE_UNQUOTED(PREFIXDIR, "${PREFIX}",[Prefix directory]) |
62 | |
63 | -dnl Check for module and library dependancies |
64 | +AM_GLIB_GNU_GETTEXT |
65 | + |
66 | +############################################# |
67 | +# Check for module and library dependancies |
68 | +############################################# |
69 | GLIB_REQUIRED=2.22 |
70 | PKG_CHECK_MODULES(PLACE_DAEMON, |
71 | glib-2.0 >= $GLIB_REQUIRED |
72 | @@ -41,31 +60,47 @@ |
73 | AC_SUBST(PLACE_DAEMON_CFLAGS) |
74 | AC_SUBST(PLACE_DAEMON_LIBS) |
75 | |
76 | -dnl Expand variables needed for config.vala |
77 | +############################################# |
78 | +# local install for distcheck and stand-alone running |
79 | +############################################# |
80 | +with_localinstall="no" |
81 | +AC_ARG_ENABLE(localinstall, |
82 | + AS_HELP_STRING([--enable-localinstall], |
83 | + [Install all of the files locally instead of in system directories (for distcheck)]), |
84 | + with_localinstall=$enableval, |
85 | + with_localinstall=no) |
86 | + |
87 | +AM_CONDITIONAL([HAVE_LOCALINSTALL], [test "x$with_localinstall" = "xyes"]) |
88 | + |
89 | +############################################# |
90 | +# Expand variables needed for config.vala |
91 | +############################################# |
92 | AS_AC_EXPAND(PREFIX, $prefix) |
93 | AC_SUBST(PREFIX) |
94 | |
95 | AS_AC_EXPAND(DATADIR, $datarootdir) |
96 | AC_SUBST(DATADIR) |
97 | |
98 | -dnl look for dbus service dir |
99 | -DBUSSERVICEDIR=`$PKG_CONFIG --variable=session_bus_services_dir dbus-1` |
100 | -AC_ARG_WITH([dbus-services], |
101 | - AC_HELP_STRING([--with-dbus-services=DBUS_SERVICES], |
102 | - [specify a directory to store dbus service files.]), |
103 | - [ |
104 | - DBUSSERVICEDIR=$withval |
105 | - ] |
106 | -) |
107 | +############################################# |
108 | +# look for dbus service dir |
109 | +############################################# |
110 | +if test "x$with_localinstall" = "xyes"; then |
111 | + DBUSSERVICEDIR="${datadir}/dbus-1/services/" |
112 | +else |
113 | + DBUSSERVICEDIR=`$PKG_CONFIG --variable=session_bus_services_dir dbus-1` |
114 | +fi |
115 | AC_SUBST(DBUSSERVICEDIR) |
116 | |
117 | -dnl Create the Makefiles |
118 | +############################################# |
119 | +# Create the Makefiles |
120 | +############################################# |
121 | AC_CONFIG_FILES([ |
122 | Makefile |
123 | applications.place |
124 | data/Makefile |
125 | src/Makefile |
126 | src/config.vala |
127 | + po/Makefile.in |
128 | ]) |
129 | AC_OUTPUT |
130 | |
131 | @@ -76,6 +111,8 @@ |
132 | ------------------------------------ |
133 | |
134 | Prefix : ${prefix} |
135 | + |
136 | + Local install : ${with_localinstall} |
137 | |
138 | Extra CFlags : ${CPPFLAGS} $MAINTAINER_CFLAGS |
139 | Extra ValaFlags: ${CPPFLAGS} $MAINTAINER_VALAFLAGS |
140 | |
141 | === added directory 'po' |
142 | === added file 'po/LINGUAS' |
143 | === added file 'po/POTFILES.in' |
144 | --- po/POTFILES.in 1970-01-01 00:00:00 +0000 |
145 | +++ po/POTFILES.in 2010-08-23 14:42:46 +0000 |
146 | @@ -0,0 +1,5 @@ |
147 | +[encoding: UTF-8] |
148 | +src/daemon.vala |
149 | +src/utils.vala |
150 | +src/main.vala |
151 | + |
152 | |
153 | === added file 'po/POTFILES.skip' |
154 | --- po/POTFILES.skip 1970-01-01 00:00:00 +0000 |
155 | +++ po/POTFILES.skip 2010-08-23 14:42:46 +0000 |
156 | @@ -0,0 +1,4 @@ |
157 | +src/main.c |
158 | +src/daemon.c |
159 | +src/utils.c |
160 | + |
161 | |
162 | === modified file 'src/Makefile.am' |
163 | --- src/Makefile.am 2010-07-23 11:24:07 +0000 |
164 | +++ src/Makefile.am 2010-08-23 14:42:46 +0000 |
165 | @@ -53,19 +53,23 @@ |
166 | utils.vala \ |
167 | $(NULL) |
168 | |
169 | -unity-package-search.o : unity-package-search.cc |
170 | - g++ $(unity_package_search_libs) `pkg-config --cflags --libs glib-2.0` -c unity-package-search.cc unity-package-search.h |
171 | +unity-package-search.o : $(srcdir)/unity-package-search.cc $(srcdir)/unity-package-search.h |
172 | + g++ $(unity_package_search_libs) `pkg-config --cflags --libs glib-2.0` -c $(srcdir)/unity-package-search.cc |
173 | |
174 | unity_applications_daemon_SOURCES = \ |
175 | $(unity_applications_daemon_VALASOURCES:.vala=.c) \ |
176 | unity-package-search.h \ |
177 | $(NULL) |
178 | |
179 | -BUILT_SOURCES += unity_applications_daemon.vala.stamp |
180 | +BUILT_SOURCES += \ |
181 | + unity_applications_daemon.vala.stamp \ |
182 | + $(NULL) |
183 | + |
184 | EXTRA_DIST += \ |
185 | unity_applications_daemon.vala.stamp \ |
186 | $(unity_applications_daemon_VALASOURCES) \ |
187 | unity-package-search.cc \ |
188 | + unity-package-search.h \ |
189 | $(NULL) |
190 | |
191 | # Major hack alert: https://bugzilla.gnome.org/show_bug.cgi?id=621292 |
192 | |
193 | === modified file 'src/daemon.vala' |
194 | --- src/daemon.vala 2010-08-23 09:52:14 +0000 |
195 | +++ src/daemon.vala 2010-08-23 14:42:46 +0000 |
196 | @@ -220,19 +220,19 @@ |
197 | sections.clear (); |
198 | } |
199 | |
200 | - sections.append (SectionsColumn.DISPLAY_NAME, "All Applications", |
201 | - SectionsColumn.ICON_HINT, "", -1); |
202 | - sections.append (SectionsColumn.DISPLAY_NAME, "Accessories", |
203 | - SectionsColumn.ICON_HINT, "", -1); |
204 | - sections.append (SectionsColumn.DISPLAY_NAME, "Games", |
205 | - SectionsColumn.ICON_HINT, "", -1); |
206 | - sections.append (SectionsColumn.DISPLAY_NAME, "Internet", |
207 | - SectionsColumn.ICON_HINT, "", -1); |
208 | - sections.append (SectionsColumn.DISPLAY_NAME, "Media", |
209 | - SectionsColumn.ICON_HINT, "", -1); |
210 | - sections.append (SectionsColumn.DISPLAY_NAME, "Office", |
211 | - SectionsColumn.ICON_HINT, "", -1); |
212 | - sections.append (SectionsColumn.DISPLAY_NAME, "System", |
213 | + sections.append (SectionsColumn.DISPLAY_NAME, _("All Applications"), |
214 | + SectionsColumn.ICON_HINT, "", -1); |
215 | + sections.append (SectionsColumn.DISPLAY_NAME, _("Accessories"), |
216 | + SectionsColumn.ICON_HINT, "", -1); |
217 | + sections.append (SectionsColumn.DISPLAY_NAME, _("Games"), |
218 | + SectionsColumn.ICON_HINT, "", -1); |
219 | + sections.append (SectionsColumn.DISPLAY_NAME, _("Internet"), |
220 | + SectionsColumn.ICON_HINT, "", -1); |
221 | + sections.append (SectionsColumn.DISPLAY_NAME, _("Media"), |
222 | + SectionsColumn.ICON_HINT, "", -1); |
223 | + sections.append (SectionsColumn.DISPLAY_NAME, _("Office"), |
224 | + SectionsColumn.ICON_HINT, "", -1); |
225 | + sections.append (SectionsColumn.DISPLAY_NAME, _("System"), |
226 | SectionsColumn.ICON_HINT, "", -1); |
227 | } |
228 | |
229 | @@ -248,19 +248,19 @@ |
230 | |
231 | // FIXME: Bigger tiles for most used group |
232 | groups.append (GroupsColumn.RENDERER, "UnityDefaultRenderer", |
233 | - GroupsColumn.DISPLAY_NAME, "Most Used", |
234 | - GroupsColumn.ICON_HINT, "", -1); |
235 | - groups.append (GroupsColumn.RENDERER, "UnityDefaultRenderer", |
236 | - GroupsColumn.DISPLAY_NAME, "Installed", |
237 | - GroupsColumn.ICON_HINT, "", -1); |
238 | - groups.append (GroupsColumn.RENDERER, "UnityDefaultRenderer", |
239 | - GroupsColumn.DISPLAY_NAME, "Available", |
240 | + GroupsColumn.DISPLAY_NAME, _("Most Used"), |
241 | + GroupsColumn.ICON_HINT, "", -1); |
242 | + groups.append (GroupsColumn.RENDERER, "UnityDefaultRenderer", |
243 | + GroupsColumn.DISPLAY_NAME, _("Installed"), |
244 | + GroupsColumn.ICON_HINT, "", -1); |
245 | + groups.append (GroupsColumn.RENDERER, "UnityDefaultRenderer", |
246 | + GroupsColumn.DISPLAY_NAME, _("Available"), |
247 | GroupsColumn.ICON_HINT, "", -1); |
248 | groups.append (GroupsColumn.RENDERER, "UnityEmptySearchRenderer", |
249 | - GroupsColumn.DISPLAY_NAME, "No search results", |
250 | + GroupsColumn.DISPLAY_NAME, "No search results", // No i18n, should never be rendered |
251 | GroupsColumn.ICON_HINT, "", -1); |
252 | groups.append (GroupsColumn.RENDERER, "UnityEmptySectionRenderer", |
253 | - GroupsColumn.DISPLAY_NAME, "Empty section", |
254 | + GroupsColumn.DISPLAY_NAME, "Empty section", // No i18n, should never be rendered |
255 | GroupsColumn.ICON_HINT, "", -1); |
256 | |
257 | /* Always expand the Installed group */ |
258 | @@ -270,6 +270,7 @@ |
259 | |
260 | private void populate_section_queries () |
261 | { |
262 | + /* XDG category names. Not for translation */ |
263 | section_queries.add (""); //ALL_APPLICATIONS |
264 | section_queries.add ("category:Utility"); //ACCESSORIES |
265 | section_queries.add ("category:Game"); //GAMES |
266 | @@ -281,6 +282,7 @@ |
267 | |
268 | private void populate_section_categories () |
269 | { |
270 | + /* XDG category names. Not for translation */ |
271 | //ALL_APPLICATIONS |
272 | Set<string> cat = new TreeSet<string>(); |
273 | cat.add ("AudioVideo"); |
274 | @@ -769,7 +771,7 @@ |
275 | ResultsColumn.ICON_HINT, "", |
276 | ResultsColumn.GROUP_ID, Group.EMPTY_SEARCH, |
277 | ResultsColumn.MIMETYPE, "", |
278 | - ResultsColumn.DISPLAY_NAME, "You search did not match any applications", |
279 | + ResultsColumn.DISPLAY_NAME, _("You search did not match any applications"), |
280 | ResultsColumn.COMMENT, "", |
281 | -1); |
282 | |
283 | @@ -779,7 +781,7 @@ |
284 | ResultsColumn.ICON_HINT, "", |
285 | ResultsColumn.GROUP_ID, Group.EMPTY_SEARCH, |
286 | ResultsColumn.MIMETYPE, "", |
287 | - ResultsColumn.DISPLAY_NAME, "Search the web", |
288 | + ResultsColumn.DISPLAY_NAME, _("Search the web"), |
289 | ResultsColumn.COMMENT, "", |
290 | -1); |
291 | } |
292 | @@ -795,28 +797,29 @@ |
293 | switch (section) |
294 | { |
295 | case Section.ALL_APPLICATIONS: |
296 | - section_name = "applications"; |
297 | + section_name = _("applications"); |
298 | break; |
299 | case Section.ACCESSORIES: |
300 | - section_name = "accessories"; |
301 | + section_name = _("accessories"); |
302 | break; |
303 | case Section.GAMES: |
304 | - section_name = "games"; |
305 | + section_name = _("games"); |
306 | break; |
307 | case Section.INTERNET: |
308 | - section_name = "internet applications"; |
309 | + section_name = _("internet applications"); |
310 | break; |
311 | case Section.MEDIA: |
312 | - section_name = "media applications"; |
313 | + section_name = _("media applications"); |
314 | break; |
315 | case Section.OFFICE: |
316 | - section_name = "office applications"; |
317 | + section_name = _("office applications"); |
318 | break; |
319 | case Section.SYSTEM: |
320 | - section_name = "system applications"; |
321 | + section_name = _("system applications"); |
322 | break; |
323 | default: |
324 | - section_name = "applications"; |
325 | + section_name = _("applications"); |
326 | + warning ("Unknown section: %u", section); |
327 | break; |
328 | } |
329 | |
330 | @@ -824,7 +827,7 @@ |
331 | ResultsColumn.ICON_HINT, "", |
332 | ResultsColumn.GROUP_ID, Group.EMPTY_SECTION, |
333 | ResultsColumn.MIMETYPE, "", |
334 | - ResultsColumn.DISPLAY_NAME, @"There are no $section_name installed on this computer", |
335 | + ResultsColumn.DISPLAY_NAME, _(@"There are no $section_name installed on this computer"), /* TRANSLATORS: section_name is plural */ |
336 | ResultsColumn.COMMENT, "", |
337 | -1); |
338 | } |
339 | |
340 | === modified file 'src/main.vala' |
341 | --- src/main.vala 2010-08-23 09:43:38 +0000 |
342 | +++ src/main.vala 2010-08-23 14:42:46 +0000 |
343 | @@ -46,11 +46,11 @@ |
344 | } |
345 | else |
346 | { |
347 | - print ("Another Applications Place daemon appears to be running.\nBailing out."); |
348 | + print (_("Another Applications Place daemon appears to be running.\nBailing out.")); |
349 | return 1; |
350 | } |
351 | } catch (DBus.Error error) { |
352 | - GLib.error ("Error connecting to session bus: %s.\nBailing out.", error.message); |
353 | + print (_("Error connecting to session bus: %s.\nBailing out."), error.message); |
354 | return 2; |
355 | } |
356 |
Looks good, though I think we're both missing:
ALL_LINGUAS="`cat "$srcdir/ po/LINGUAS" | grep -v '^#'`"
and
AM_GLIB_GNU_GETTEXT
in configure.ac, the former will actually load all the translations and the latter will do some glib gettext magic