Hi all,
While I mostly work in English, I occasionally do support libraries in other languages like French, Arabic, and Chinese. And more recently Ive been looking at the Languages dropdown in the OPAC advanced search. In the templates, I notice that we often translate HTML, but what if we translated strings for a Template::Toolkit data structure instead? Consider the following: [% BLOCK en %]Anglais[% END %] [% BLOCK fr %]Français[% END %] [% langs.en = INCLUDE en %] [% langs.fr = INCLUDE fr %] I suppose its not very beautiful, but the translation process should be simple and in the end we have a re-usable hash map rather than static HTML. As I commented on Bug 12017 (https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12017), we could have a database table of language codes with native language names, and then iterate through that and use the hash map of translations to provide the translations. Since were not producing HTML, we could flexibly reuse this language data in various different contexts. Whether its the Languages dropdown in the OPAC advanced search, the language selector, or whatever. We could probably use this concept in other places as well where we need translations but we dont want to be bound to HTML. What do people think? Im not wedded to the idea, but its something that crossed my mind this morning, when I looked at the large switch statements at https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html <https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=120 17&attachment=40285> &bug=12017&attachment=40285. (To that end, I would also suggest a theme-independent Template::Toolkit include directory, but thats another story ) David Cook Software Engineer Prosentient Systems Suite 7.03 6a Glen St Milsons Point NSW 2061 Australia Office: 02 9212 0899 Online: 02 8005 0595
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : https://www.koha-community.org/ git : https://git.koha-community.org/ bugs : https://bugs.koha-community.org/