Bugzilla:L10N:Problems: Difference between revisions

→‎Linguistic: inflection problems
(Initial revision)
 
(→‎Linguistic: inflection problems)
Line 7: Line 7:


== Linguistic ==
== Linguistic ==
=== Numeric inflection ===
Currently Bugzilla templates have hardcoded provisions for English: any number not equal to 1 implies plural usage.  Example (''[http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla%2Fwebtools%2Fbugzilla%2Ftemplate%2Fen%2Fdefault%2Fadmin%2Fcomponents%2Fconfirm-delete.html.tmpl&rev=&cvsroot=%2Fcvsroot#108 admin/components/confirm-delete.html.tmpl]''):
<pre>
    Sorry, there
    [% IF comp.bug_count > 1 %]
      are [% comp.bug_count %] [%+ terms.bugs %]
    [% ELSE %]
      is [% comp.bug_count %] [%+ terms.bug %]
    [% END %]
    outstanding for this component.
</pre>
; Solution : define and use function to switch between multiple forms.  Example ([http://bugzilla-ru.svn.sourceforge.net/viewvc/bugzilla-ru/bugzilla-ru/template/ru/default/global/variables.none.tmpl?revision=108&view=markup#l_78 Bugzilla-ru]):
<pre>
[% MACRO numeral(n, name1, name2, name5) BLOCK %]
  [% n1 = n % 10 %]
  [% n10 = n % 100 - n1 %]
  [% IF n10 == 10 || n1 == 0 || n1 > 4 %]
    [% name5 %]
  [% ELSIF n1 == 1 %]
    [% name1 %]
  [% ELSE %]
    [% name2 %]
  [% END %]
[% END %]
</pre>
and then [http://bugzilla-ru.svn.sourceforge.net/viewvc/bugzilla-ru/bugzilla-ru/template/ru/default/admin/components/confirm-delete.html.tmpl?view=markup#l_110]
<pre>
    Для компонента
    [% numeral(comp.bug_count,
      "зарегистрирована ${comp.bug_count} ${terms.bug}",
      "зарегистрировано ${comp.bug_count} ${terms.bug_gen}",
      "зарегистрировано ${comp.bug_count} ${terms.bugs_gen}")
    FILTER html %].
</pre>
It is important to note how other words are affected: while in English ''outstanding'' did not change, its Russian translation must be declined properly.
; References :
* {{bug|412161}}
* {{bug|394516}} Same problem in Mozilla
* [http://perldoc.perl.org/Locale/Maketext/TPJ13.html Article about software localization]
* [http://developer.mozilla.org/en/docs/Localization_and_Plurals Mozilla localization and plurals]
* [http://translate.sourceforge.net/wiki/l10n/pluralforms Summary of known plural forms rules]
=== Grammatical gender ===
Many languages observe grammatical gender which may affect verb inflection.  In template translation one cannot rely on ''terms.bug'' having certain gender.  Example (''[http://bugzilla-es.cvs.sourceforge.net/bugzilla-es/es_ES/2.18/default/bug/create/created.html.tmpl?view=markup#l_24 bug/create/created.html.tmpl]''):
<pre>
[% PROCESS global/header.html.tmpl
  title = "El $terms.Bug $id ha sido enviado"
%]
</pre>
This is correct when ''terms.bug'' is defined as '''bug''' or any other masculine noun.  However, with '''petición''' (request) it should read ''La $terms.Bug''.


== UTF-8 ==
== UTF-8 ==
118

edits