留言板

Fichier language*.properties selon l'organisation

thumbnail
antoine comble,修改在11 年前。

Fichier language*.properties selon l'organisation

Regular Member 帖子: 232 加入日期: 12-9-7 最近的帖子
Bonjour,

Est-il possible de choisir un fichier language.properties selon l'organisation sur laquelle je navigue ?
Par exemple, si je suis sur l'organisation A, ma portlet s'appelle "Animation". Par contre, si je suis sur l'organisation B, ma portlet doi s'appeler "Animer" (la langue est la même pour les 2 portlets).

Merci d'avance
thumbnail
Leo Pratlong,修改在11 年前。

RE: Fichier language*.properties selon l'organisation

Expert 帖子: 363 加入日期: 10-7-6 最近的帖子
Bonjour,
Il me semble (mais je dis peut-être une bêtise) que ce n'est pas faisable nativement.
Mais vous pourriez surcharger le portail avec un Hook ou un Ext pour obtenir ce comportement. Mais je suppose que dans le portal-ext.properties, certaines propriétés sont nécessaires lors du déploiement (car utilisées dans des ServletContextListener ou autre). Celles-ci ne pourront être chargées dynamiquement.
thumbnail
Antoine Comble,修改在11 年前。

RE: Fichier language*.properties selon l'organisation

Regular Member 帖子: 232 加入日期: 12-9-7 最近的帖子
Merci pour votre réponse.
Pourriez vous m'expliquer comment faire le hook ou le plugin pour surcharger la langue par organisation ?

J'ai cherché la clé ou le service à surcharger mais je n'ai pas trouvé...

Merci d'avance pour votre aide.
thumbnail
Antoine Comble,修改在11 年前。

RE: Fichier language*.properties selon l'organisation (答复)

Regular Member 帖子: 232 加入日期: 12-9-7 最近的帖子
Using PrimeFaces, i've found a class named LanguageManagedBean which is executed before the liferay default language chain.
So, i've just overrided the method get(Object key) in which i get the current community doing themeDisplay.getLayout().getGroup() and search the Language_organizationId_locale.properties and that's all !

It works fine !