[ckan-dev] Solution: key/value resource translations

Isabel Ruiz isaruizmellado at gmail.com
Tue Mar 18 13:35:41 UTC 2014


Hi everyone!

I have CKAN 2.0

I have detected this on resource details page (file:
/package/resource_read.html):

If you click on "Aditional Information / Show More" link, CKAN shows
key/value pairs from resource, this is because there is a for loop into
resource_read.html file that shows them, but texts never is translated.
This is because it has not correct tags in resource_read.html file.

To solve this we have to replace in resoucr_read.html line:

          <tr class="toggle-more"><th scope="row">{{ key }}</th><td>{{
value }}</td></tr>
with:
        <tr class="toggle-more"><th scope="row">{{ _(key) }}</th><td>{{
_(value) }}</td></tr>

and write translations keys and values on translation file.

-- 
Isabel M. Ruiz Mellado
http://about.me/isabelruiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140318/5cfccbf4/attachment-0003.html>


More information about the ckan-dev mailing list