[ckan-dev] Tip for CKAN translators: reminder about formatters

Adrià Mercader adria.mercader at okfn.org
Mon Oct 6 11:39:37 UTC 2014


Hi all,

This email is intended for people helping translating CKAN via
Transifex [1]. If you are not, please ignore (but you should be
helping if you can!)

First of all thank you for your help in translating CKAN, you are
doing an amazing job and helping CKAN reach people from around the
world.

This email is just to remind everybody about string formatters, how
they work and how they should be handled.

String formatters are parts of the text to be translated that are
meant to be read by the CKAN code itself, not a human in the browser.
There are four types of them:

* Could not read parameters: %r
* There are %(count)s datasets tagged with [1:%(tagname)s]:
* You are already following {0}
* User {username} does not exist

%r, %(count)s, {0} and {username} are strings formatters. Only the
last one is currently supported in CKAN but there are several parts of
old code where you can find the other three types.

The basic rule about strings formatters is that *you must not modify
them in any way*. They must not be translated and should be left as
they are on the original string. You can of course move them around to
accommodate them to your language, but without changing them.

Some examples:

* Missing s after %(count): http://i.imgur.com/YsmHC8P.png
* MIssing %r: http://i.imgur.com/ncYVnsO.png
* Missing {0}: http://i.imgur.com/tgfAmHe.png

I have fixed some of the easy ones across different languages, but
sadly our friends in the Vietnamese (vi) and Nepali (ne) will have to
fix the current translation.

* Nepali errors:
https://gist.github.com/amercader/e8eb9c535708d7d7ce6c#file-nepali-translation-errors
* Vietnamese errors:
https://gist.github.com/amercader/e8eb9c535708d7d7ce6c#file-vietnamese-translation-errors

Apologies to the rest of the teams, Transifex does not make easy to
send announcements to specific teams.

If you have any doubt, please contact me via Transifex or at
adria.mercader at okfn.org

Many thanks!

Adrià

[1] https://www.transifex.com/projects/p/ckan/



More information about the ckan-dev mailing list