Foros de discusión

Language Module-Tutorial not working

Julian Pfeil, modificado hace 7 años.

Language Module-Tutorial not working

Junior Member Mensajes: 72 Fecha de incorporación: 1/03/16 Mensajes recientes
Liferay 7 GA 3

What is described here and here does not work (look here for what i've tried so far - still waiting for an answer which explains how to serve multiple languages from ONE language module as described in the tutorial).
thumbnail
James Hinkey, modificado hace 7 años.

RE: Language Module-Tutorial not working

Junior Member Mensajes: 62 Fecha de incorporación: 15/02/11 Mensajes recientes
Hi Julian,

Thank you for bringing this issue to our attention. We're investigating it and will resolve it shortly.

It's tracked to this issue: https://issues.liferay.com/browse/LRDOCS-3235

Thank you for your patience and sorry for any inconvenience.

Jim
Julian Pfeil, modificado hace 7 años.

RE: Language Module-Tutorial not working

Junior Member Mensajes: 72 Fecha de incorporación: 1/03/16 Mensajes recientes
James Hinkey:
Hi Julian,

Thank you for bringing this issue to our attention. We're investigating it and will resolve it shortly.

It's tracked to this issue: https://issues.liferay.com/browse/LRDOCS-3235

Thank you for your patience and sorry for any inconvenience.

Jim


Hey Jim,

thank you for the fast response.

This post's issue is, that the tutorial is missing the (kinda crucial) information, that one has to create a resource bundle component in order to make the language properties accessible (at least that's what Abhishek Suthar's answer suggests - and after trying though it works somewhat).
I don't know wether the tutorials are written by "Liferay-People" or all of the community, but the more and more i work with the tutorials, i sadly get the impression that people are highly motivated to write tutorials (which is very nice) but they seem not try those tutorial steps themselves and thus don't realize that information required to reproduce the tutorial steps are missing. This makes it really hard to get things right and makes people wait around in the forum before they can be productive (at least in my case - i know that some of my questions are really silly, but by asking them i hopefully help others, that come across those issues, too).

Kind Regards,
Julian
thumbnail
James Hinkey, modificado hace 7 años.

RE: Language Module-Tutorial not working

Junior Member Mensajes: 62 Fecha de incorporación: 15/02/11 Mensajes recientes
Hi Julian,

Thank you for your constructive feedback. We're stepping up our efforts to make sure tutorials are correct and that their steps are comprehensive. This tutorial slipped through the cracks and wasn't updated per the new steps for sharing language keys. Once we've completed reviewing the changes, we'll publish them to the tutorial.

Here's content from the drafted changes:

Using a Language Module
OSGi requirement and provision contracts allow you to use language modules in other modules. Requirements are capabilities a module needs from another module. Provisions are services a module offers.

Your web modules require the language module's resource bundle services. To use the language module's resource bundle along with Liferay Portal core's, each web module must inform Liferay Portal that it's aggregating them.

Integrate the language module:

1. In the web module's bnd.bnd file, add a Require-Capability header that filters on the language module's resource bundle. For example, if the module's bundle symbolic name is com.liferay.my.editor.lang, you'd specify this header:

Require-Capability: liferay.resource.bundle;filter:="(bundle.symbolic.name=com.liferay.my.editor.lang)"

2. Add a Provide-Capability header that declares you're aggregating the language module's resource bundle with Liferay Portal core's resource bundle:

Provide-Capability: liferay.resource.bundle;resource.bundle.aggregate:String="(bundle.symbolic.name=com.liferay.my.editor.lang)";resource.bundle.base.name="content.Language"

Now your web module is using localized language keys from the language module and Liferay Portal core.
Zarko Ajdukovic, modificado hace 6 años.

RE: Language Module-Tutorial not working

New Member Mensajes: 11 Fecha de incorporación: 27/03/18 Mensajes recientes
Hi James,
I would just be very grateful if you could let me know if the tutorial is already updated, because I am trying to make it work exactly like it was stated in it, but without success.
Could you please, let me know if this issue may be related to this problem, as it is still open.
I am running the Liferay Community Edition Portal 7.0.4 GA5 (Wilberforce / Build 7004 / October 23, 2017)

Thank you very much,
Zarko
thumbnail
James Hinkey, modificado hace 6 años.

RE: Language Module-Tutorial not working

Junior Member Mensajes: 62 Fecha de incorporación: 15/02/11 Mensajes recientes
Hi Zarko,

Thank you for bringing up the issue you're facing. There is much easier way to use language modules in your current module.

The shared-language-keys liferay-blade-sample demonstrates using the -liferay-aggregate-resource-bundles manifest header to aggregate language keys from multiple modules for the current module to use.

The sample reference article is here: https://dev.liferay.com/develop/reference/-/knowledge_base/7-0/shared-language-keys

I've created https://issues.liferay.com/browse/LRDOCS-5085 for updating the current documentation.

Thank you for reporting the issue.
Jim
Zarko Ajdukovic, modificado hace 6 años.

RE: Language Module-Tutorial not working

New Member Mensajes: 11 Fecha de incorporación: 27/03/18 Mensajes recientes
Hi James,

Thank you for your quick answer.
Thanks to the documentation link that you provided me with, I have managed to get it working.
Now I have another question related to this one.
Now that I have my language module working for all liferay modules,
what would be the best and the easiest way to share this module with the spring-portlets that are in the same workspace as well.

Thanks,
Zarko
thumbnail
James Hinkey, modificado hace 6 años.

RE: Language Module-Tutorial not working

Junior Member Mensajes: 62 Fecha de incorporación: 15/02/11 Mensajes recientes
Hi Zarko,

I *think* specifying the same header in your Spring portlet's liferay-plugin-package.properties file does the same thing. I'm confirming that with the subject matter expert.

Jim
thumbnail
David H Nebinger, modificado hace 6 años.

RE: Language Module-Tutorial not working

Liferay Legend Mensajes: 14916 Fecha de incorporación: 2/09/06 Mensajes recientes
Yep, James is right.

You can add the BND-ish directives to liferay-plugin-package.properties and, during the WAR->WAB conversion, will be added to your OSGi bundle manifest.
Zarko Ajdukovic, modificado hace 6 años.

RE: Language Module-Tutorial not working

New Member Mensajes: 11 Fecha de incorporación: 27/03/18 Mensajes recientes
Hi Jim, Hi James,

thank you very much for your aswer - it works!
You guys are the best, thank you.

Zarko
thumbnail
James Hinkey, modificado hace 6 años.

RE: Language Module-Tutorial not working

Junior Member Mensajes: 62 Fecha de incorporación: 15/02/11 Mensajes recientes
You're welcome Zarko. So glad you found success!

Jim