Index: openacs-4/packages/acs-core-docs/www/i18n-convert.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/i18n-convert.html,v diff -u -r1.25.2.1 -r1.25.2.2 --- openacs-4/packages/acs-core-docs/www/i18n-convert.html 21 Aug 2013 10:19:22 -0000 1.25.2.1 +++ openacs-4/packages/acs-core-docs/www/i18n-convert.html 17 Oct 2013 08:58:08 -0000 1.25.2.2 @@ -124,12 +124,12 @@ </if>

It would probably be better to do this as something like:

<if @components.view_bugs_url@ not nil>
   <if @components.num_bugs@ eq 1>
-    <a href="@components.view_bugs_url@" title="#bug-tracker.View_the_bug_fo_component#">#bug-tracker.one_bug#</a>
+    <a href="@components.view_bugs_url@" title="#bug-tracker.View_the_bug_fo_component#">#bug-tracker.one_bug#</a>
   </if><else>
-    <a href="@components.view_bugs_url@" title="#bug-tracker.View_the_bug_fo_component#">#bug-tracker.N_bugs#</a>
+    <a href="@components.view_bugs_url@" title="#bug-tracker.View_the_bug_fo_component#">#bug-tracker.N_bugs#</a>
   </else>
 </if>
  • Don't combine keys in display text. Converting a phrase from one language to another is usually more complicated than simply replacing each word with an equivalent. When several keys are concatenated, the resulting word order will not be correct for every language. Different languages may use expressions or idioms that don't match the phrase key-for-key. Create complete, distinct keys instead of building text from several keys. For example:

    Original code:

    multirow append links "New [bug_tracker::conn Bug]" 

    Problematic conversion:

    multirow append links "[_ bug-tracker.New] [bug_tracker::conn Bug]"

    Better conversion:

    set bug_label [bug_tracker::conn Bug]
    -multirow append links "[_ bug-tracker.New_Bug]" "${url_prefix}bug-add"

    ... and include the variable in the key: "New %bug_label%". This gives translators more control over the phrase.

    In this example of bad i18n, full name is created by concatenating first and last name (admittedly this is pervasive in the toolkit):

    <a href="@past_version.maintainer_url@" title="#bug-tracker.Email# @past_version.maintainer_email@">
    +multirow append links "[_ bug-tracker.New_Bug]" "${url_prefix}bug-add"

    ... and include the variable in the key: "New %bug_label%". This gives translators more control over the phrase.

    In this example of bad i18n, full name is created by concatenating first and last name (admittedly this is pervasive in the toolkit):

    <a href="@past_version.maintainer_url@" title="#bug-tracker.Email# @past_version.maintainer_email@">
     @past_version.maintainer_first_names@ @past_version.maintainer_last_name@</a>
  • Avoid unnecessary duplicate keys. When phrases are exactly the same in several places, use a single key.

    For common words such as Yes and No, you can use a library of keys at acs-kernel. For example, instead of using