Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Internationalisation question #46

Closed
heinlja opened this issue Oct 13, 2014 · 1 comment
Closed

Internationalisation question #46

heinlja opened this issue Oct 13, 2014 · 1 comment

Comments

@heinlja
Copy link

heinlja commented Oct 13, 2014

Labels displayed in files like ckanext/dgu/theme/templates/package/edit_form.html: is there some sort of internationalisation mechanism in place for them?

@davidread
Copy link
Contributor

The approach you want to avoid is forking everything and directly changing the strings in the code and templates... That makes it a nightmare for future updates and others sharing your work.

I believe you should be able to adapt the general CKAN methods for extracting all the strings from the DGU templates and code (including ckan and all extensions).

Essentially you use babel to create a new .pot file (you'll create some configuration to tell it where the ckanext-dgu templates and code is, plus the other extensions). Then you use Transifex or other just babel and a text editor to create your language translation in a .po file (you can probably reuse many of the existing translations for the core CKAN if it is translated for your language). And then you compile the .po into a .mo which you can tell CKAN to use by default.

There is more about it here: http://docs.ckan.org/en/latest/contributing/i18n.html#manual-setup and you'll probably want to look into the Babel docs.

You'll probably find strings in the UI that are not translated and do not get extracted, because they come from the ckanext-dgu python code and have not had the wrapper applied to the string: _('some english text') In this case you'll have to change the code. There may also be some strings in javascript which will need a bit of special treatment too so that they are extracted.

We'd be very keen if you were able to contribute back your changes via a pull request, to make it easier for others to translate into other languages.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants