Convert LinguaPlone sublanguage to language for all content?

I would like to convert all my content from the sub-language en-ca back to en. What is the API for this?

+5
source share
1 answer

Just call setLanguageyour content. A quick n-dirty script to execute this would be something like:

cat = context.portal_catalog
for brain in cat.unrestrictedSearchResults(Language='en-ca'):
    content = brain.getObject()
    content.setLanguage('en')
    content.reindexObject(idxs=['Language'])

You will need to re-index your content after changing the language parameter, but the parameter idxsfor the call reindexObjectensures that only the language index is updated, which will speed up the process.

+6
source

All Articles