Skip to content

Commit

Permalink
DOC tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremygray committed Jul 15, 2014
1 parent 7cf1542 commit 137a5d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/source/developers/localization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Adjust PsychoPy's code

There are a few things to keep in mind when working on the app's code to make it compatible with translations. If you are only making a translation, you can skip this section.

- In PsychoPy's code, the language to be used should always be English with American spellings (e.g., "hello", "color").
- In PsychoPy's code, the language to be used should always be English with American spellings (e.g., "color").

- Within the app, the return value from ``_()`` (i.e., a translated string) should be used only for display purposes: in menus, tooltips, etc. A translated value should never be used as part of the logic or internal functioning of PsychoPy. It is purely a "skin" for text.

Expand All @@ -26,9 +26,9 @@ There are a few things to keep in mind when working on the app's code to make it

- ``_()`` should not be given a null string to translate; if you use a variable, check that it is not '' to avoid invoking ``_('')``.

- Strings that contain a single formatting placeholder (e.g., %d, %s, %.4f) require a little more thought: ``_("hello, %s") % name``.
- Strings that contain formatting placeholders (e.g., %d, %s, %.4f) require a little more thought. Single placeholders are easy enough: ``_("hello, %s") % name``.

- Strings with multiple formatting placeholders require named arguments, because positional arguments are not always sufficient to disambiguate things depending on the phrase and the language to be translated into: ``_("hello, %(first)s %(last)") % {'first': firstname, 'last': lastname}``
- Strings with multiple formatting placeholders require named arguments, because positional arguments are not always sufficient to disambiguate things depending on the phrase and the language to be translated into: ``_("hello, %(first)s %(last)s") % {'first': firstname, 'last': lastname}``

Make a template (.pot file)
----------------------------
Expand Down

0 comments on commit 137a5d4

Please sign in to comment.