Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Liferay Translating messages to multiple languages

    • 0
    • 1
    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 355
    Comment on it

    Liferay support many languages as you need. All language specific text and storing are done by pulling out in language.properties files. Whenever a page loads, detect the language by liferay and pull up the corresponding language file then display the text in the correct language.

    Adventage :

    Easily support as many languages.
    Have a central location for multiple languages
    Translate text effectively.
    

    Setting a default Language and default Country

    Put below properties in your system.properties file.

     user.country=TR
     user.language=tr
    

    For different languages, set unique URL

    Language Unique URL
    Chinese     http://www.liferay.com/zh_CN/web/guest/home

    German     http://www.liferay.com/de/web/guest/home



    The mapping web.xml:

    <servlet-mapping> 
    <servlet-name>I18nServlet</servlet-name> 
    <url-pattern>/de/*</url-pattern> 
    </servlet-mapping> 
    <servlet-mapping> 
    <servlet-name>I18nServlet</servlet-name> 
    <url-pattern>/zh_CN/*</url-pattern> 
    </servlet-mapping> 
    <servlet-mapping> 
    <servlet-name>I18nServlet</servlet-name> 
    <url-pattern>/zh_TW/*</url-pattern> 
    </servlet-mapping> 
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: