Forums de discussion

Cannot override some tranlations

David Knol, modifié il y a 7 années.

Cannot override some tranlations

Junior Member Publications: 29 Date d'inscription: 19/06/15 Publications récentes
Hi,
I would like to override some Liferay's modules tranlations. I am fallowing: https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/overriding-a-modules-language-keys

It works but not for all strings. First of all I would like to override some string in journal-lang module (com.liferay.journal.lang), but this module doesn't have servlet context name. How can I override these strings?

I'm also trying to override some core strings (from portal-impl) but some of them remains untranslated. For example "Add Field" (add-field) from defining new form view. Any possible solutions?
thumbnail
Pavel Savinov, modifié il y a 7 années.

RE: Cannot override some tranlations

Junior Member Publications: 54 Date d'inscription: 29/05/15 Publications récentes
Hey David,

In order to override journal-web strings(or any other module that uses *-lang component) you should create a component as mentioned in Knowledge Base, but using bundle.symbolic.name of the exact bundle you want to override, in case of journal it could be com.liferay.journal.web or com.liferay.journal.service, etc..
David Knol, modifié il y a 7 années.

RE: Cannot override some tranlations

Junior Member Publications: 29 Date d'inscription: 19/06/15 Publications récentes
Thank you! That's the case.

Still, I have problem with some string, which I can't override. For example:
- "Add Field" (add-field) from creating new form webpage (string in portal-impl).
- name of Notifications portlet in Liferay menu
- 'Receive notifications when someone' items (e.g. receive-a-notification-when-someone-adds-a-new-blog-entry-in-a-blog-you-are-subscribed-to) from 'blogs-web' module.

Any idea why it's not working?
David Knol, modifié il y a 7 années.

RE: Cannot override some tranlations

Junior Member Publications: 29 Date d'inscription: 19/06/15 Publications récentes
Problem with notification configuration is even bigger than I thought. All entries are stored are represented by UserNotificationDefinition object. Their description is get in jsp page via getDescription() method:

	public String getDescription(Locale locale) {
		ResourceBundle resourceBundle = ResourceBundleUtil.getBundle(
			"content.Language", locale, getClass());

		String description = ResourceBundleUtil.getString(
			resourceBundle, _description);

		if (description != null) {
			return description;
		}

		return _description;
	}


All my overriden translations of that entries from different modules are ignored and default ones are returned. How can I fix that?
David Knol, modifié il y a 7 années.

RE: Cannot override some tranlations

Junior Member Publications: 29 Date d'inscription: 19/06/15 Publications récentes
Another question. How can I override translations from 'com.liferay.plugins.admin.web' module? There's no servlet.context.name. Thanks in advance!