Fórum

Hook I18n JSP

thumbnail
Marco Endres, modificado 7 Anos atrás.

Hook I18n JSP

Regular Member Postagens: 112 Data de Entrada: 22/08/12 Postagens Recentes
Hello Guys

I tried to change 2 things in my hook. First i tried to add a own key in my JSP-hook and tried to translate it in the Language_de.properties, but that didn't work. I also tried to overwrite the lang.user.name.field.names from the portal-impl. For that i added the following class:

package com.clavisit.faberplace.portal;

import java.util.Enumeration;
import java.util.ResourceBundle;

import org.osgi.service.component.annotations.Component;

import com.liferay.portal.kernel.language.UTF8Control;


@Component(
	    property = { "language.id=de_DE" }, 
	    service = ResourceBundle.class
)
public class DeDEResourceBundle extends ResourceBundle {

    @Override
    protected Object handleGetObject(String key) {
        return _resourceBundle.getObject(key);
    }

    @Override
    public Enumeration<string> getKeys() {
        return _resourceBundle.getKeys();
    }

    private final ResourceBundle _resourceBundle = ResourceBundle.getBundle("content.Language", UTF8Control.INSTANCE);

}</string>


But i could still not overwrite the Keys.

My Language_de.properties under the path /registration-hook-jsp/src/main/resources/content/ looks like this:

attention=Text
lang.user.name.field.names=prefix,first-name,last-name


and in the JSP hook i use name='attention". I also tried key="attention".

The blade.jsp.portlet from the samples worked. I'm on windows.
thumbnail
Marco Endres, modificado 7 Anos atrás.

RE: Hook I18n JSP

Regular Member Postagens: 112 Data de Entrada: 22/08/12 Postagens Recentes
So i got my own key to work, but the lang.user.name.field.names still doesn't work. I made a own module.

Does somebody have a working example where a "lang.user.name.x" gets overwritten?
thumbnail
Marco Endres, modificado 7 Anos atrás.

RE: Hook I18n JSP (Resposta)

Regular Member Postagens: 112 Data de Entrada: 22/08/12 Postagens Recentes
After a restart it worked