i18n:problem_children
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
i18n:problem_children [2008/01/24 08:41] – Calendar i18n as well dbs | i18n:problem_children [2022/02/10 13:34] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======Internationalization challenges====== | ||
+ | =====Unfriendly Forms==== | ||
+ | / | ||
+ | <tr id=' | ||
+ | <td align=' | ||
+ | From | ||
+ | <b name=' | ||
+ | < | ||
+ | <b name=' | ||
+ | </td> | ||
+ | </ | ||
+ | |||
+ | =====MARC editor tooltips===== | ||
+ | There is a giant file of tooltips for the MARC editor that has been generated from the Library of Congress electronic MARC21 documentation. Where translated versions of the MARC21 standard are available, we will have to create scripts to parse and build the equivalent tooltip translations. Depending on the license of the translated work, the tooltip translations may not be able to be distributed as part of Evergreen and may have to be built by each Evergreen site instead (unless an Evergreen vendor negotiates a redistribution license with the copyright owner): | ||
+ | |||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | |||
+ | |||
+ | =====Hard-coded locales in application code===== | ||
+ | |||
+ | Need to check for and correct code like the following in '' | ||
+ | <code perl> | ||
+ | if ($format eq ' | ||
+ | print " | ||
+ | if ($type eq ' | ||
+ | print " | ||
+ | if ($type eq ' | ||
+ | return 302; | ||
+ | |||
+ | } | ||
+ | </ | ||
+ | Something like the following may work: | ||
+ | <code bash> | ||
+ | find Open-ILS/ | ||
+ | </ | ||
+ | |||
+ | //[ We need to teach Apache to pass the locale to mod_perl handlers (maybe it can already? %ENV is fine) and move supercat under / | ||
+ | |||
+ | =====Calendar widgets===== | ||
+ | Currently we're hardcoding locales for calendar widgets in pages like '' | ||
+ | <code html> | ||
+ | <script type=" | ||
+ | <script type=" | ||
+ | <script type=" | ||
+ | </ | ||
+ | '' | ||
+ | <code bash> | ||
+ | cd / | ||
+ | ln -sf calendar-en.js calendar-en-US.js | ||
+ | </ | ||
+ | <code html> | ||
+ | <script type=" | ||
+ | <script type=" | ||
+ | <script type=" | ||
+ | </ | ||
+ | Alternately, | ||
+ | <code html> | ||
+ | <?xml version=' | ||
+ | |||
+ | < | ||
+ | " | ||
+ | " | ||
+ | < | ||
+ | ]> | ||
+ | |||
+ | <html xmlns=' | ||
+ | < | ||
+ | < | ||
+ | <style type=' | ||
+ | @import url('/ | ||
+ | @import url('/ | ||
+ | </ | ||
+ | <script type=' | ||
+ | djConfig=' | ||
+ | <script type=' | ||
+ | dojo.require(' | ||
+ | dojo.require(' | ||
+ | </ | ||
+ | </ | ||
+ | <body class=' | ||
+ | <input type=' | ||
+ | dojoType=' | ||
+ | required=' | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | =====Logic relying on parsing English text===== | ||
+ | From '' | ||
+ | <code javascript> | ||
+ | ' | ||
+ | JSAN.use(' | ||
+ | try { | ||
+ | if (node.value == ' | ||
+ | var pattern = node.value.match(/ | ||
+ | if (pattern) { | ||
+ | var today = new Date(); | ||
+ | var todayPlus = new Date(); todayPlus.setTime( today.getTime() + 24*60*60*1000*pattern[1] ); | ||
+ | node.value = util.date.formatted_date(todayPlus," | ||
+ | } | ||
+ | if (! util.date.check(' | ||
+ | if (util.date.check_past(' | ||
+ | if ( util.date.formatted_date(new Date(),' | ||
+ | return true; | ||
+ | } catch(E) { | ||
+ | throw(E); | ||
+ | } | ||
+ | }, | ||
+ | </ | ||
+ | The problem here is that we're running a regex against an English string. A couple of approaches to solving this problem: | ||
+ | * One regex per locale (brittle, perhaps, and requires regex knowledge that the average translator probably won't have) | ||
+ | * Create a parallel hidden node that contains the English string and parse that instead, while the localized version is displayed (a bit tricky, but doesn' | ||
+ | * Set the value as an attribute of the node and parse that instead (possibly using a simple math notation like '' | ||
+ | |||
+ | ===== Hardcoded strings in Perl modules ===== | ||
+ | |||
+ | [[http:// | ||
+ | sub bookbag_feed { | ||
+ | ... | ||
+ | if ($type eq ' | ||
+ | print " | ||
+ | join('&', | ||
+ | " | ||
+ | return 302; | ||
+ | } | ||
+ | ... | ||
+ | $feed-> | ||
+ | ... | ||
+ | $feed-> | ||
+ | OPAC => | ||
+ | '/ | ||
+ | join('&', | ||
+ | ' | ||
+ | ); | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | =====Org Unit shortnames===== | ||
+ | Some code invokes the '' | ||
+ | ' | ||
+ | if (my.circ) { | ||
+ | return data.hash.aou[ my.circ.circ_lib() ].shortname(); | ||
+ | } else { | ||
+ | if (my.acp.circulations()) { | ||
+ | return data.hash.aou[ my.acp.circulations()[0].circ_lib() ].shortname(); | ||
+ | } else { | ||
+ | return ""; | ||
+ | } | ||
+ | }</ |