[Koha-bugs] [Bug 12017] Move language description out of database

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sun Mar 30 07:04:56 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12017

--- Comment #1 from Bernardo Gonzalez Kriegel <bgkriegel at gmail.com> ---
Created attachment 26691
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=26691&action=edit
Bug 12017 - Move language description out of database

This patch moves language descriptions from database
into template files, to ease the translation process.

As pointed out on comment #5 of Bug 9056 [1], present
implementation needs many queries to database, and
more important, it's very difficult to scale so that
every language could properly name any other language.

So, at the cost of loose some native descriptions,
that can be added or replace english ones, I propose
to use only the rfc4646 subtag (it's in the name of
translation files or translated directories) to find
the proper name for language/region/script using
blocks of template files

It's more work for translators

To test:
1) Do some fake translations, for example all langs
for l in $(cd misc/translator/po; ls *-pref.po | sed 's/-pref.po//'); do
mkdir koha-tmpl/intranet-tmpl/prog/$l;
mkdir koha-tmpl/opac-tmpl/bootstrap/$l;
mkdir koha-tmpl/opac-tmpl/prog/$l;
mkdir koha-tmpl/opac-tmpl/ccsr/$l;
done

2) Go to Administration > System preferences > I18N/L10N
Preety mess!

3) Enable some random languages, some in groups (fr|en)
on staff/opac. Enable OPAC changelanguage

4) Reload page, look at the bottom for language changer
Also open a OPAC view, look for language changer
Do NOT change languages

5) Apply the patch

6) Reload STAFF page, some cosmetic changes on lang display
and language changer

7) Reload OPAC page, similar view of language changer

8) Change OPAC theme (prog|ccsr) and check again
On prog and ccsr the result is not preety, but works

9) Now to business: Translations. Update language files for
one of the active languages, say de-DE
(cd misc/translator; perl translate update de-DE;
perl translate update de-DE; perl translate install de-DE)

10) Change language to German (DE), reload STAFF page,
some of the strings are already translated!!!

11) Check that there are many references to 'language.inc'
files on PO files
egrep "language.inc" misc/translator/po/de-DE-*po

12) Sign!

Note: I'm imposing a sort order on results, by subtag,
that could slow things a little (almos nothing if there
are few languages). Could be removed.

Note2: I put every string between it's own <span></span>
In that way each string is taken individually to translate
instead of a solitary line filled with '%s'

Note3: Of course if this pass it needs a lot of followups
to eventually remove language tables, but that needs
more analysis, there are more funcions on C4/Languages.pm
that use the tables. But it's a first step.

Also more followups are needed to update or complete
languages/regions/scripts

[1] http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9056#c5

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list