Bugzilla:L10N:Problems

From MozillaWiki
Jump to: navigation, search

Known Bugzilla localization bugs and problems.

Problem Template

Summary 
What's wrong
References 
bugs

Linguistic

Numeric inflection

Currently Bugzilla templates have hardcoded provisions for English: any number not equal to 1 implies plural usage.

Example 
admin/components/confirm-delete.html.tmpl:
    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.
Solution 
define and use function to switch between multiple forms. Example (Bugzilla-ru):
[% 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 %]

and then [1]

    Для компонента 
    [% numeral(comp.bug_count,
       "зарегистрирована ${comp.bug_count} ${terms.bug}",
       "зарегистрировано ${comp.bug_count} ${terms.bug_gen}",
       "зарегистрировано ${comp.bug_count} ${terms.bugs_gen}")
    FILTER html %].

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 

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 1 
Bugzilla-es default/global/user-error.html.tmpl:
  [% ELSIF error == "bugs_not_changed" %]
    [% title = BLOCK %]Los [% terms.bugs %] no han cambiado[% END %]
    Parece que no se ha realizado ningún cambio en los [% terms.bugs %] seleccionados.

This is correct until terms.bug is defined as bug or any other masculine noun. However, with petición (request) it should read ...las $terms.bugs seleccionadas.

Example 2 
'Assembled' messages:
[% ELSIF error == "object_name_not_specified" %]
  [% type = BLOCK %][% PROCESS object_name %][% END %]
  [% title = BLOCK %][% type FILTER ucfirst FILTER html %] Not 
  Specified[% END %]
  You must select/enter a [% type FILTER html %].

Here object_name may be user, component, version, milestone or status. But nothing is done to reflect object_name gender in ... Not Specified.

UTF-8

Comment wrapping

Symptom 1: Comments are wrapped on byte length, not character length. Symptom 2: Comments not wrapped at all (Japanese)

Workaround 
(to symptom 2) insert wrap="hard" to all textareas
References 

Bug linkification

It is not easy to write a regexp covering bug X and bug X comment Y and attachment Y observing noun inflection rules. While English uses only two cases (generic and possessive) there are:

  • 14 cases in Estonian
  • 12 cases in Japanese
  • 6 singular and 6 plural in Russian

To make things worse, Perl UTF-8 regexp matching is far from perfection.

References 

Non-ASCII URI recognition

Since 90s DNS and HTTP support multi-byte characters in domain names and URL strings. Bugzilla should recognize them to make hyperlinks work.

References 

Input length determined incorrectly

UTF-8 length in form fields is counted at bytes, not chars. Not fixed with bug 363153.

References 

Form fields values age garbled

Fonts in charts and dependency graphs

GD::Graph builtin fonts do not include full UTF-8 glyph set. Currently Bugzilla administrators are required to install some quality fonts and refer to them in templates. As in HTML with its {Verdana,Arial} we need to evolve to some reasonable cross-platform default...

Solution 
Bugzilla-jp example by Atsushi Shimono, using parameter for font filename.
References 

Console messages

After checksetup messages were templatized (per bug 352608) one can localize them. However, these messages are shown on console, not browser. While most environments (Linux console and xterm, Cygwin bash) support UTF-8, some others (Windows cmd.exe at least for some locales) do not.

References 

Non-localizable "Hardcoded" strings

Some of examples below are somehow translatable, but IMO normal translator does not necessarily want to fiddle with Perl/templates.

Email notifications

Template replace filter is needed to translate some parts of Bugzilla's notification emails.

Workaround 
References 

Report category values

Field names 
The -All- value is used as a constant in Bugzilla code. This text is translatable in templates, but translating it probably breaks Bugzilla.
References 

Flag types

Here a "magic word" __All__

References 

Other

Quick search

(From bug 426222) localized field values exist only in templates, fulltext database search (like quick search) does not honor localized status, resolution, etc.

Template versioning

It is not easy to tell compatibility between (changed) mainstream template and localized one.

References