Bugzilla:L10N:Problems

From MozillaWiki
Revision as of 14:17, 29 January 2008 by SnowyOwl (talk | contribs) (→‎"Hardcoded" strings: split to separate cases)
Jump to navigation Jump to 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 (bug/create/created.html.tmpl):

[% PROCESS global/header.html.tmpl
  title = "El $terms.Bug $id ha sido enviado"
%]

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

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

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.

Solution
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

Other

Template versioning

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

References