I18N and Import View


I’ve used the CAF Tools Externalize Strings tool available in the Designer to achieve first version of the I18N.

It works almost ok. The major problem is when I have views that import other views. In this case the imported view is not correctly internationalized.

For instance in the text is shown:

So the MultiSearch is the imported view.

No errors are shown in the console.

So, any idea how to correct this problem?

Thanks in Advance


One quick answer is to restore g11n.MultiSearch.Entity.pesquisa_de_entidades with the value from the .properties file.

It is normal not to have any error since "g11n.MultiSearch.Entity.pesquisa_de_entidades" is replaced with the value from the .properties file.


That’s an interesting one!

I haven’t tried this, but in the included view, do you also have externalized resources? If so, can you copy (duplicate) g11n.MultiSearch.Entity.pesquisa_de_entidades into the included view’s resource file?

The duplicate was not a good idea to me since I had to make double the translations.

So my correction of the problem was to change the keys into the Application file, I also changed the imported view to get the I18N from the Application and not from the imported view, this solved the problem

New Problem

I have in property file

Now in my view I want something like this:

Basically I want to concat the result from the method activateDeactivate into the string “g11n.MedicineContextInfo.default”. However the second EL is never resolved and is simple appended to the String, which is not in the property file. As result this can not be correctly I18N.

Any idea how to solve this?


Hi Herve,

I think in this case it is better to use the ternary operator in order to render a condition based on the value of a business field:

#{MedicineContextInfoDefaultviewView.activateDeactivate eq 'activar' ? MedicineContextInfo.portletResources["g11n.MedicineContextInfo.default.activar"] : MedicineContextInfo.portletResources["g11n.MedicineContextInfo.default.desactivar"]} 

However, I recommend that you have a boolean getter for the render condition:

public class  MedicineContextInfo{
   boolean getIsActive(){



Thanks for you relpy.

I already thought about that solution but that does not cover all my problems. Additionally I have another problem. I have a table where one of the column is the name of the week (en: Monday, Tuesday…; pt: Segunda, Terça). So the best way in this case is to contact the String to be I18N
Property File

EL expression
I would like to have something like that

For instance, JBoss contains a Concat function that works in EL, does CAF contains something similar?

I’m wondering how this problem is solved in CAF since this should be a normal problem.

Thanks in Advance


I think than in your case the day of the week will be determined in the bean.

So, you should use I18N there.

public class  MedicineContextInfo{
   public String getCurrentDayOfWeek(){
    //determine current day
    // get the proper I18n message
   String  dayOfWeek =  ContextUtils.localizeMessage(ContextUtils.getFacesContext(), bundleName, key, null, false);
     return ...;



Yap, this solved the problem

Thanks for your help :wink: