GNOME Bugzilla – Bug 628883
Add localisation support
Last modified: 2010-11-04 16:46:09 UTC
Although it shouldn't be needed for this cycle (since I don't think we expose any strings to the user, as Empathy doesn't show libfolks errors iirc), it would be a very good idea to add localisation support for the future, especially if we plan to do things like bug #627403.
Created attachment 169579 [details] [review] Squashed diff of the 628883-l10n branch http://git.collabora.co.uk/?p=user/pwith/folks;a=shortlog;h=refs/heads/628883-l10n
Just pushed another commit to the branch which adds l10n support to tp-lowlevel. It can be squashed when the branch is merged/next rebased.
(Mass changing milestones; please search for this phrase to delete the bug spam.)
So according to bug #624186, we shouldn't use glib-gettext or AM_GLIB_GNU_GETTEXT, since they're old and unmaintained. We should use stock gettext instead. This commit is an example of the changes which would need to be made to the branch: http://git.gnome.org/browse/libpeas/commit/?id=955f8a0af53169a8b03d5e2053b5f9d711153fe0
Created attachment 172440 [details] [review] Squashed diff of the 628883-l10n-rebase1 branch Updated branch. I can't test it, as my build environment has bitrotted, but it should be OK. It should mark all the correct strings as translatable, but a few files are probably missing from POTFILES.in. Note that intltool doesn't seem to work perfectly with Vala, requiring translatable strings to not be wrapped over multiple lines. I haven't had time to investigate this properly, so some of the translatable strings no longer obey the 80 character limit. http://git.collabora.co.uk/?p=user/pwith/folks;a=shortlog;h=refs/heads/628883-l10n-rebase1
(In reply to comment #5) > Created an attachment (id=172440) [details] [review] > Squashed diff of the 628883-l10n-rebase1 branch > > Updated branch. I can't test it, as my build environment has bitrotted, but it > should be OK. It should mark all the correct strings as translatable, but a few > files are probably missing from POTFILES.in. Could you un-bitrot it (or figure out the following error)? I hit this: checking where the gettext function comes from... libc ./configure: line 13829: syntax error near unexpected token `0.35.0' ./configure: line 13829: `IT_PROG_INTLTOOL(0.35.0)' make: *** [config.status] Error 2 =============== this line appears in the configure script for some reason: IT_PROG_INTLTOOL(0.35.0) =============== That's the same line (and version) that Empathy uses, but I don't have this problem there. So it's probably some issue with stock gettext. Maybe we're missing some package dependency (that I don't have installed)?
Ignore comment #6 - was just some weirdness with my git dir. However, I am hitting this on all the tests (without any obvious solution): Program received signal SIGTRAP, Trace/breakpoint trap. g_logv (log_domain=<value optimized out>, log_level=<value optimized out>, format=<value optimized out>, args1=0x7fffffffd920) at gmessages.c:563 563 g_private_set (g_log_depth, GUINT_TO_POINTER (depth)); (gdb) bt
+ Trace 224168
tpf-persona-store.c:893: g_warning (_ ("Couldn't get list of favorite contacts: %s"), data->e->message); ================================================================== The obvious problem is that g_log() is getting 0x1 for the format string, but I have no idea why -- I printed out the location of the result of _() and it gives the expected string. I'm not sure what happens between g_warning() and g_log(), but obviously it shouldn't be this.
Created attachment 172856 [details] [review] Squashed diff of the 628883-l10n-rebase2 branch Now that I've fixed up my build environment, I've tested the patch, squashed in a few small fixes, and tidied up `git status` output. The problem you were getting was that the fatal log messages about the logger service being missing were no longer being filtered out by the test suite code, and were causing aborts. This is fixed with http://git.collabora.co.uk/?p=user/pwith/folks;a=commit;h=1db676b21c34ba72d376463a52ce56e974451c3a. http://git.collabora.co.uk/?p=user/pwith/folks;a=shortlog;h=refs/heads/628883-l10n-rebase2
Merged - thanks! commit 0a5864e0e7c3f776f829e0bf5819fedfda04580a Author: Philip Withnall <philip@tecnocode.co.uk> Date: Wed Oct 20 18:00:10 2010 +0100 Add new internationalisation files to CLEANFILES Helps: bgo#628883 Makefile.am | 25 ++++++++++++++++++++++++- 1 files changed, 24 insertions(+), 1 deletions(-) commit edd974508d3d92172df91d892a7be73bfada138b Author: Philip Withnall <philip@tecnocode.co.uk> Date: Wed Oct 20 17:51:41 2010 +0100 Update log handlers in the test suite Due to string changes in the rest of libfolks, the log handlers in the test suite need changing to fix the test suite. Helps: bgo#628883 tests/telepathy/individual-properties.vala | 15 ++++++--------- tests/telepathy/individual-retrieval.vala | 10 ++++------ tests/telepathy/persona-store-capabilities.vala | 5 ++--- 3 files changed, 12 insertions(+), 18 deletions(-) commit cf42813c1d2cbd4d69050dda02981475d364bad6 Author: Philip Withnall <philip.withnall@collabora.co.uk> Date: Mon Sep 6 15:43:42 2010 +0100 Mark strings for translation and improve string formatting a little This marks every potentially-user-visible string in libfolks for translation These include error messages, warnings and criticals. This also improves the formatting and wording of some of the messages, and changes others to make them more easily translatable. Closes: bgo#628883 NEWS | 1 + backends/key-file/kf-persona-store.vala | 30 +++-- backends/key-file/kf-persona.vala | 5 +- backends/telepathy/lib/tp-lowlevel.c | 28 +++- backends/telepathy/lib/tpf-persona-store.vala | 190 ++++++++++++++++++------- backends/telepathy/lib/tpf-persona.vala | 6 +- folks/backend-store.vala | 47 ++++-- folks/individual-aggregator.vala | 34 +++-- po/POTFILES.in | 11 ++ po/POTFILES.skip | 9 ++ tools/import-pidgin.vala | 57 +++++--- tools/import.vala | 36 +++-- 12 files changed, 324 insertions(+), 130 deletions(-) commit affa69029fe409b60de0fdf1bef7429c51c2907b Author: Philip Withnall <philip.withnall@collabora.co.uk> Date: Mon Sep 6 14:32:16 2010 +0100 Bug 628883 <E2><80><94> Add localisation support Add gettext/intltool build system support, but don't mark any strings for translation yet. Helps: bgo#628883 Makefile.am | 1 + autogen.sh | 2 ++ configure.ac | 12 ++++++++++++ folks/build-conf.vapi | 6 ++++++ tools/Makefile.am | 6 ++++++ tools/import.vala | 3 +++ 6 files changed, 30 insertions(+), 0 deletions(-)