Foren

Cannot override some tranlations

David Knol, geändert vor 7 Jahren.

Cannot override some tranlations

Junior Member Beiträge: 29 Beitrittsdatum: 19.06.15 Neueste Beiträge
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, geändert vor 7 Jahren.

RE: Cannot override some tranlations

Junior Member Beiträge: 54 Beitrittsdatum: 29.05.15 Neueste Beiträge
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, geändert vor 7 Jahren.

RE: Cannot override some tranlations

Junior Member Beiträge: 29 Beitrittsdatum: 19.06.15 Neueste Beiträge
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, geändert vor 7 Jahren.

RE: Cannot override some tranlations

Junior Member Beiträge: 29 Beitrittsdatum: 19.06.15 Neueste Beiträge
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, geändert vor 7 Jahren.

RE: Cannot override some tranlations

Junior Member Beiträge: 29 Beitrittsdatum: 19.06.15 Neueste Beiträge
Another question. How can I override translations from 'com.liferay.plugins.admin.web' module? There's no servlet.context.name. Thanks in advance!