Index: openacs-4/packages/acs-core-docs/www/i18n-convert.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/i18n-convert.adp,v diff -u -N -r1.1.2.7 -r1.1.2.8 --- openacs-4/packages/acs-core-docs/www/i18n-convert.adp 1 Dec 2015 14:38:42 -0000 1.1.2.7 +++ openacs-4/packages/acs-core-docs/www/i18n-convert.adp 4 Dec 2015 11:14:28 -0000 1.1.2.8 @@ -219,7 +219,7 @@ </if> <if \@components.view_bugs_url\@ not nil> -<a href="\@components.view_bugs_url\@" title="#bug-tracker.View_the_bug_fo_component#"> +<a href="\@components.view_bugs_url\@" title="#bug-tracker.View_the_bug_fo_component#"> </if> \@components.num_bugs\@ <if \@components.num_bugs\@ eq 1> @@ -234,9 +234,9 @@

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>
 
@@ -260,7 +260,7 @@ 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\@">
+<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>
 
  • 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 -N -r1.26.2.6 -r1.26.2.7 --- openacs-4/packages/acs-core-docs/www/i18n-convert.html 1 Dec 2015 14:38:42 -0000 1.26.2.6 +++ openacs-4/packages/acs-core-docs/www/i18n-convert.html 4 Dec 2015 11:14:28 -0000 1.26.2.7 @@ -95,41 +95,41 @@ be automatically assigned to a case when the simulation begins. -</else>

    Another example, where bugs are concatenated with a number:

    <if @components.view_bugs_url@ not nil>
    -  <a href="@components.view_bugs_url@" title="View the @pretty_names.bugs@ for this component">
    +</else>

    Another example, where bugs are concatenated with a number:

    <if @components.view_bugs_url@ not nil>
    +  <a href="@components.view_bugs_url@" title="View the @pretty_names.bugs@ for this component">
       </if>
    -  @components.num_bugs@ 
    -  <if @components.num_bugs@ eq 1>
    -    @pretty_names.bug@
    +  @components.num_bugs@ 
    +  <if @components.num_bugs@ eq 1>
    +    @pretty_names.bug@
       </if>
       <else>
    -    @pretty_names.bugs@
    +    @pretty_names.bugs@
       </else>
    -  <if @components.view_bugs_url@ not nil>
    +  <if @components.view_bugs_url@ not nil>
       </a>
       </if>
     
    -<if @components.view_bugs_url@ not nil>
    -<a href="@components.view_bugs_url@" title="#bug-tracker.View_the_bug_fo_component#">
    +<if @components.view_bugs_url@ not nil>
    +<a href="@components.view_bugs_url@" title="#bug-tracker.View_the_bug_fo_component#">
     </if>
    -@components.num_bugs@ 
    -<if @components.num_bugs@ eq 1>
    -@pretty_names.bug@
    +@components.num_bugs@ 
    +<if @components.num_bugs@ eq 1>
    +@pretty_names.bug@
     </if>
     <else>
    -@pretty_names.bugs@
    +@pretty_names.bugs@
     </else>
    -<if @components.view_bugs_url@ not nil>
    +<if @components.view_bugs_url@ not nil>
     </a>
     </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>
    +

    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>
       </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