[ckan-discuss] Looking for bilingual implementations of CKAN

Ian Ward ian at excess.org
Sat Dec 22 20:37:43 GMT 2012


On Sat, Dec 22, 2012 at 8:52 AM, Sean Hammond <sean.hammond at okfn.org> wrote:
>> >> For Tags my plan is to make them all "English text - French text" and
>> >> then show the correct text for the user with some template magic.
>> >
>> > The multilingual extension handles tags
>>
>> You mean it looks them up in the term_translation_table before
>> displaying them, right?
>>
>> I was hoping to keep the translations together with the originals
>> instead of in a separate table that might be harder to keep up to
>> date.
>
> Well you could have tags and tags_fr fields on datasets and then with
> some fancy javascript work, you could probably put together an interface
> where users can add and remove a variable number of arbitrary tags when
> adding or updating a dataset, and can enter the translation of each tag
> next to the tag itself, then when they submit the form it ends up stored
> as tags and tags_fr in the dataset. But this would be non-trivial
> development work, both in terms of the code and the user-interface
> design.

I also considered this.  Keeping the English and French tags for each
dataset in sync would be a tricky problem too.  I will need a few tag
vocabularies and IIUC this would mean having twice the vocabularies.

> The other problem with storing both tags and translations of the tags
> together in the dataset itself, is that different datasets will have the
> same tags and you'll have to re-enter the translation of the tag each time
> you re-use it on a new dataset, and different datasets might end up with
> different translations of the same tags.

I haven't made it that far yet, can't you make tag fields that only
allow selection from existing tags?

> With fields like title, description, etc. you don't have this problem
> because you don't expect two datasets to have exactly the same title for
> example, so it's fine to store the original and the translation in two
> different fields in the dataset itself.
>
> But for tags, it probably makes a lot more sense to use the multilingual
> extension.
>
> One problem with this is adding the translations for the tags, currently
> the multilingual extension only lets you do this over the API.  Of
> course you could add a web interface for listing all the tags in the
> system and adding/editing their translations, could be implemented as a
> CKAN extension probably, and could probably even be integrated into the
> dataset create/update form, but this would also be non-trivial
> development work.

I also worry about managing the French versions with this sort of
interface.  What do I do when an English tag is deleted, do I delete
the translation too?  What if a tag is changed, should the translation
be kept or discarded?  I have a requirement that everything published
be in both official languages.

Wedging both English and French into the same tag, while inelegant,
would let me make an interface that matches the title/title_fr part of
the dataset editing: both versions are entered and updated at the same
time on the same page.

Ian



More information about the ckan-discuss mailing list