I would like to convert all my content from the sub-language en-ca back to en. What is the API for this?
Asked
Active
Viewed 165 times
1 Answers
5
Simply call setLanguage
on your content item. A quick-n-dirty script to accomplish this would be something along the lines of:
cat = context.portal_catalog
for brain in cat.unrestrictedSearchResults(Language='en-ca'):
content = brain.getObject()
content.setLanguage('en')
content.reindexObject(idxs=['Language'])
You'll need to reindex your content after changing the language setting, but the idxs
parameter to the reindexObject
call ensures that only the Language index get's updated, making the process faster.

Martijn Pieters
- 1,048,767
- 296
- 4,058
- 3,343
-
Thanks. I had missed the rather obvious reindexObject. – JBlack Apr 01 '11 at 15:55