Merge lp://qastaging/~ralsina/account-polld/i18n into lp://qastaging/~ubuntu-push-hackers/account-polld/trunk

Proposed by Roberto Alsina
Status: Merged
Approved by: Sergio Schvezov
Approved revision: 44
Merged at revision: 31
Proposed branch: lp://qastaging/~ralsina/account-polld/i18n
Merge into: lp://qastaging/~ubuntu-push-hackers/account-polld/trunk
Prerequisite: lp://qastaging/~sergiusens/account-polld/base_notification
Diff against target: 509 lines (+393/-4)
10 files modified
cmd/account-polld/main.go (+6/-0)
debian/control (+2/-0)
debian/copyright (+23/-1)
debian/rules (+1/-0)
gettext/LICENSE (+20/-0)
gettext/README.md (+94/-0)
gettext/gettext.go (+207/-0)
plugins/gmail/gmail.go (+2/-1)
plugins/twitter/twitter.go (+3/-2)
po/account-polld.pot (+35/-0)
To merge this branch: bzr merge lp://qastaging/~ralsina/account-polld/i18n
Reviewer Review Type Date Requested Status
Sergio Schvezov Approve
PS Jenkins bot continuous-integration Approve
David Planella (community) Approve
Review via email: mp+229093@code.qastaging.launchpad.net

This proposal supersedes a proposal from 2014-07-29.

Commit message

Translation support for account-polld

Description of the change

Translation support for account-polld

To post a comment you must log in.
Revision history for this message
Sergio Schvezov (sergiusens) wrote : Posted in a previous version of this proposal

2 minor issues noted:

- missing debian/copyright for gettext/*
- gofmt or goimports has not been run agains this (spaces instead of tabs).

Revision history for this message
David Planella (dpm) wrote : Posted in a previous version of this proposal

A couple of notes:

locale/account-polld.pot

- Traditionally the folder containing translations is named po/, not locale/. That said, there is nothing wrong with naming it locale, and it will work too. It's just a matter of consistency with other projects, so your call.

=== added directory 'locale/es_ES.utf8'
=== added file 'locale/es_ES.utf8/account-polld.po'

- This needs fixing though. Translations should be in a flat layout under the same folder as the .pot file, and they should be named using 2-letter ISO 639-1 codes, with some exceptions using 3-letter codes and others using the _CC suffix, where CC is the country code. That is, the file should be named locale/es.po
- In any case, I wouldn't add a .po file in this merge proposal and let Launchpad take care of it instead: we'll just enable automatic translation exports and all .po files will be committed with the right name and location.

review: Needs Fixing
Revision history for this message
Roberto Alsina (ralsina) wrote : Posted in a previous version of this proposal

sounds good, changing ASAP

On Tue, Jul 29, 2014 at 5:11 PM, David Planella <email address hidden>
wrote:

> Review: Needs Fixing
>
> A couple of notes:
>
> locale/account-polld.pot
>
> - Traditionally the folder containing translations is named po/, not
> locale/. That said, there is nothing wrong with naming it locale, and it
> will work too. It's just a matter of consistency with other projects, so
> your call.
>
> === added directory 'locale/es_ES.utf8'
> === added file 'locale/es_ES.utf8/account-polld.po'
>
> - This needs fixing though. Translations should be in a flat layout under
> the same folder as the .pot file, and they should be named using 2-letter
> ISO 639-1 codes, with some exceptions using 3-letter codes and others using
> the _CC suffix, where CC is the country code. That is, the file should be
> named locale/es.po
> - In any case, I wouldn't add a .po file in this merge proposal and let
> Launchpad take care of it instead: we'll just enable automatic translation
> exports and all .po files will be committed with the right name and
> location.
>
>
> --
> https://code.launchpad.net/~ralsina/account-polld/i18n/+merge/228747
> You are the owner of lp:~ralsina/account-polld/i18n.
>

Revision history for this message
David Planella (dpm) wrote : Posted in a previous version of this proposal

As with the rest of our upstream projects, I'd recommend enabling automatic translation imports and exports. I set up as much as I could in Launchpad, but I'll need someone with permissions in the project to enable automatic commits.

That is:

1. Go to:
https://translations.launchpad.net/account-polld/trunk/+translations-settings
2: On "Export translations to branch", click on "Choose a target branch" and set it to ~ubuntu-push-hackers/account-polld/trunk

For more background: https://wiki.ubuntu.com/Translations/LpProjectConfiguration (the only step missing is the one described above)

Revision history for this message
David Planella (dpm) wrote : Posted in a previous version of this proposal

In terms of building and installing the translations, there are generally preset rules in the build system, but I can't quite figure out if the project is using one at all.

In any case, I'm assuming this is installed as a .deb package.

There are 2 things that need doing:

1. Build the binary .mo files from the source .po files. This is done with msgfmt.
2. Install the .mo files at /usr/share/locale/$LANG/LC_MESSAGES/account-polld.mo, where $LANG is the language code (the same as the name of the source .po file - i.e. in es.po, $LANG would be 'es'). There is existing Debian packaging infrastructure to do this that works with language packs -> dh_translations

Revision history for this message
Roberto Alsina (ralsina) wrote : Posted in a previous version of this proposal

David, ack. Looks like I don't have the permission in launchpad either,
I'll bring it up tomorrow and then do the rest of the things you mentioned.

On Tue, Jul 29, 2014 at 5:27 PM, David Planella <email address hidden>
wrote:

> In terms of building and installing the translations, there are generally
> preset rules in the build system, but I can't quite figure out if the
> project is using one at all.
>
> In any case, I'm assuming this is installed as a .deb package.
>
> There are 2 things that need doing:
>
> 1. Build the binary .mo files from the source .po files. This is done with
> msgfmt.
> 2. Install the .mo files at
> /usr/share/locale/$LANG/LC_MESSAGES/account-polld.mo, where $LANG is the
> language code (the same as the name of the source .po file - i.e. in es.po,
> $LANG would be 'es'). There is existing Debian packaging infrastructure to
> do this that works with language packs -> dh_translations
> --
> https://code.launchpad.net/~ralsina/account-polld/i18n/+merge/228747
> You are the owner of lp:~ralsina/account-polld/i18n.
>

41. By Roberto Alsina

merged newer code from sergiusens

Revision history for this message
David Planella (dpm) wrote :

From the parts that I can tell, it looks good to me, thanks for setting up internationalization!

review: Approve
Revision history for this message
David Planella (dpm) wrote :

Ah, one other detail: if the package is going to main, there is nothing else to do, but if it's going to universe and we want the translations to be shipped in language packs, you'll need to add the following to debian/control:

X-Ubuntu-Use-Langpack: yes

42. By Roberto Alsina

add X-Ubuntu-Use-Langpack: yes

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

Functionality seems to be working fine.

This would be the only issue:

31 + [ Roberto Alsina ]
32 + * Added i18n support
33 +

The problem with this is that you are adding it to a previous changelog entry, if something new lands in between you will see a conflict (fwiw, something new is landing now). Aside from that it doesn't correspond to a 'new' version of something you are providing. Last but not least, we let the ci train do that for us by providing a nice commit message :)

review: Needs Fixing
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

Since the changelog needs a revert, I am now going to be picky on one thing :-)

19 + gettext.BindTextdomain("account-polld", "/usr/share/locale")
20 if bus, err := dbus.Connect(dbus.SessionBus); err != nil {

Can we add an empty line there to separate the 'problem' domain a bit?

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

You should also merge trunk.

Revision history for this message
David Planella (dpm) wrote :

Sorry for the late comment, but I just noticed this after having reviewed Sergio's other branch:

summary := gettext.Gettext("Multiple more mentions")

What does "Multiple more mentions" exactly mean? It seems a strange choice of a message. If it has to stay like that, I'd recommend adding a translator comment. E.g.:

// TRANSLATORS: this refers to foobar
summary := gettext.Gettext("Multiple more mentions")

Revision history for this message
Roberto Alsina (ralsina) wrote :

> Functionality seems to be working fine.
>
> This would be the only issue:
>
> 31 + [ Roberto Alsina ]
> 32 + * Added i18n support
> 33 +
>
> The problem with this is that you are adding it to a previous changelog entry,
> if something new lands in between you will see a conflict (fwiw, something new
> is landing now). Aside from that it doesn't correspond to a 'new' version of
> something you are providing. Last but not least, we let the ci train do that
> for us by providing a nice commit message :)

In another project we add them here and then .... oh, well removed it :-)

43. By Roberto Alsina

separate unrelated code, removed bogus changelog entry

Revision history for this message
Roberto Alsina (ralsina) wrote :

> Since the changelog needs a revert, I am now going to be picky on one thing
> :-)
>
> 19 + gettext.BindTextdomain("account-polld", "/usr/share/locale")
> 20 if bus, err := dbus.Connect(dbus.SessionBus); err != nil {
>
> Can we add an empty line there to separate the 'problem' domain a bit?

Done.

44. By Roberto Alsina

merged trunk

Revision history for this message
Roberto Alsina (ralsina) wrote :

> You should also merge trunk.

Done.

Revision history for this message
Roberto Alsina (ralsina) wrote :

> Sorry for the late comment, but I just noticed this after having reviewed
> Sergio's other branch:
>
> summary := gettext.Gettext("Multiple more mentions")
>
> What does "Multiple more mentions" exactly mean? It seems a strange choice of
> a message. If it has to stay like that, I'd recommend adding a translator
> comment. E.g.:
>
> // TRANSLATORS: this refers to foobar
> summary := gettext.Gettext("Multiple more mentions")

I am not 100% sure on what the context is here. Maybe Sergio?

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sergio Schvezov (sergiusens) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches