This project is read-only.

Localization of Taxomomies

Topics: Localization
Jan 19, 2015 at 6:33 PM
I managed to complete all localization tasks in Orchard 1.x so far. With the exception of Taxonomies. I just can't find any way to localize them.

If I attach Localization part to Taxomony content type, I can create a localized version for a given Taxonomy. In this localized version I can add new terms (not good by itself, but just to try). After that I can add Taxonomy Field to my Product content type. This doesn't work because new terms from localized Taxonomy are not localized and since I have Content Culture Selector enabled, it can't detect these terms as localized.

If I attach Localization part to Taxonomy Term, I can localize terms, but can't select them in Admin when configuring my Product content.

Can anybody explain how to localize taxonomies?
Jan 21, 2015 at 9:44 AM
Are you using an alternate view for displaying your product (e.g. Views\Content-Product.Detail.cshtml)? In which case you can wrap the Taxonomy's Name property in T wherever the Taxonomy appears:
Disadvantage is, of course, that you will have to supply the translations in a .po and not through the CMS. Nice thing about the .po is, however, that it will fall back to the source language if a translation is not available.

Throughout Orchard - and dare I say throughout the internet - localization of hierarchical content (content items & taxonomy fields, but also blogs & blogposts) is difficult to get right. I find myself forever "compromising" between the usability of the CMS and the usability of the site's front-end - stopping just short of creating dedicated sites for each language.

I have quite a standard setup for localized sites in that I include alternates for most fields in the theme (e.g. Views\EditorTemplates\Views\Enumeration.Edit.cshtml) so that I can wrap the labels and (e.g. select list -) values in T(). (Note to self to submit a pull request to get this included in Orchard.Fields!)

The CultureSelector implementation that I use has some logic to fall back to the container's language if localization is not provided at the item level. So, for example, blogpost does not have the localization part attached, but a blog does. So if a visitor changes the language whilst on a blogpost, it will display the blog (-listing) for their selected language instead.

Gone way off topic now, but hopefully some pointers to assist you in solving your problem.
Jan 23, 2015 at 12:23 AM
At this moment taxonomies are not localizable.
I also tried everything like adding localization part to taxonomy term contenttype, to taxonomy ... it just doesn´t work, not in dasboard neither in frontend.
The Taxonomies Module needs some serious changes in code, in order to be localizable. I´ve started some analysis on this matter, but didn´t have enough time, and ended up creating categories in mvc controllers (it was the fastest way to solve my client´s problem).