[Sugar-devel] [PATCH] sl#3149: Localization fixes.

Sascha Silbe silbe at activitycentral.com
Mon Jan 23 12:42:46 EST 2012

Excerpts from Ajay Garg's message of 2012-01-23 14:48:16 +0100:
> ---
> Removed unncessary "gettext" notations; plus added "TRANS" labels for not
> translating format-specifier tokens.

When posting revised versions of patches, please:

1. Note the patch version in the subject prefix, in addition to the
   module name (that you also forgot to include). I.e.:
   [PATCH sugar v2] Don't mark technical strings as translatable (fixes SL#3149)

2. Make the mail a reply to the previous patch version (git send-email
   --in-reply-to=1327009004-15029-1-git-send-email-ajay at activitycentral.com)
   or -- even better -- a reply to the mail requesting changes (git send-email
   --in-reply-to=1327009004-15029-1-git-send-email-ajay at activitycentral.com).

3. Note which version changed what. This is only important if you post
   more than two versions, but it doesn't hurt getting used to it:

   v1->v2: Removed unnecessary "gettext" notations; added "TRANS" labels
           for not translating format-specifier tokens.

4. Mark your old patch as Superseded + Archived in Patchwork.

> @@ -180,7 +180,7 @@ def get_wireless_firmware():
>      if len(firmware_info) == 1:
>          return firmware_info.values()[0]
> -    return ', '.join([_('%(interface)s: %(version)s') %
> +    return ', '.join(['%(interface)s: %(version)s' %
>                        {'interface': interface, 'version': version}
>                        for interface, version in firmware_info.items()])

Chris, is there no language where we might want to switch the order of
the strings above?

> @@ -541,6 +541,7 @@ class BaseTransferPalette(Palette):
>          transferred = self._format_size(
>                  self.file_transfer.props.transferred_bytes)
>          total = self._format_size(self.file_transfer.file_size)
> +        # TRANS: do not translate the two "%s".
>          self.progress_label.props.label = _('%s of %s') % (transferred, total)

Do we really need to add that explicit, natural language hint? gettext
has a heuristic [1] to detect format strings that correctly flags this
entry (and all others handled in this patch). If that flag doesn't
trigger a similar warning in Pootle, we should rather fix Pootle than
spraying our code with warnings for each and every format string.


[1] http://www.gnu.org/software/gettext/manual/gettext.html#c_002dformat-Flag
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20120123/68761452/attachment.pgp>

More information about the Sugar-devel mailing list