Ticket #1350 (closed enhancement: fixed)
i18n of new javascript
Reported by: | zephod | Owned by: | zephod |
---|---|---|---|
Priority: | awaiting triage | Milestone: | ckan-sprint-2011-09-26 |
Component: | ckan | Keywords: | |
Cc: | Repository: | ckan | |
Theme: | none |
Change History
comment:2 Changed 3 years ago by zephod
- Status changed from new to closed
- Resolution set to fixed
Was going to reimplement an old workaround described by Friedrich, where a language.js file is served through the home controller (with appropriate settings in routing.py) and so ${_('string literals')} will be translated. See:
- https://bitbucket.org/okfn/ckan/src/2832e49d6baa/ckan/controllers/home.py#cl-48
- https://bitbucket.org/okfn/ckan/src/2832e49d6baa/ckan/templates/home/language.js
However the string-extraction mechanism seems geared towards Genshi templates and hacks are required to make it read a javascript file neatly (ie. without putting the *entire file* into a string for translation). A more elegant solution seems to be using an xi:include to pull in a genshi template which contains an html <script> tag.
- cset:d5bf4c7ba293
Issue is resolved; strings are now translated.
Note: See
TracTickets for help on using
tickets.