Localization in 7.2

Shruti Mishra, modified 5 Years ago. New Member Posts: 22 Join Date: 4/24/15 Recent Posts
Hi,
Using Liferay 7.2.1 ga2
We had enable two locale for portal earlier en_GB and en_US. All the web content was translated in both Locale.
Now we want to keep only one Locale en_US and remove other. Can we some how delete all translations of en_GB for web contents?
Is it  possible to delete Locale translation?
thumbnail
Christoph Rabel, modified 5 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
The only way  I see to do this is to delete them using a script to update all content xml structures (and titles and descriptions of course, but there it is easier, since you can simply set titleMap/descriptionMap)
So, you would need to delete the available locales, maybe update the default-locale (use JournalArticle.setDefaultLanguage()) and remove the dynamic content entries for the languages you don't need.
So, you would change:
<!--?xml version="1.0"?-->

<root available-locales="fr_FR,en_US" default-locale="en_US">
	<dynamic-element name="content" type="text_area" index-type="text" instance-id="nofk">
		<dynamic-content language-id="fr_FR">&lt;p&gt;test2&lt;/p&gt;</dynamic-content>
		<dynamic-content language-id="en_US">&lt;p&gt;test&lt;/p&gt;</dynamic-content>
	</dynamic-element>
</root>
to
<!--?xml version="1.0"?-->

<root available-locales="en_US" default-locale="en_US">
	<dynamic-element name="content" type="text_area" index-type="text" instance-id="nofk">
		<dynamic-content language-id="en_US">&lt;p&gt;test&lt;/p&gt;</dynamic-content>
	</dynamic-element>
</root>
Please take care to do this through the JournalArticle API, don't do this e.g. directly in the database!!