最近開始想研究Liferay Portal,但在看portal.properties這個檔案內容時,不是很了解locale.prepend.friendly.url.style這個參數值=2和3的意義,能否有高手解惑一下,原文如下:
Set this to 0 if the locale is not automatically prepended to a URL. This means that each URL could potentially point to many different languages. For example, the URL http://localhost:8080/web/guest/home could then be viewed by users in many different languages.
Set this to 1 if the locale is automatically prepended to a URL when the requested locale is not the default locale. This means that each URL points to just one language. For example, the URL http://localhost:8080/web/guest/home would point to the default language. The URL http://localhost:8080/zh/web/guest/home and http://localhost:8080/zh_CN/web/guest/home would both point to the Chinese language.
In cases where the prepended locale is "zh" and not the complete locale "zh_CN", then the full locale returned will be based on the order in which the locales appear in the property "locales". If "zh_CN" appears before "zh_TW", then "zh" will be a short hand for "zh_TW".
The default language is set in system.properties with the properties "user.country" and "user.language".
Set this to 2 if the locale is automatically prepended to every URL. This means that each URL points to just one language.
Set this to 3 if the locale is automatically prepended to a URL when the requested locale is not the default user locale. In the case of guest users, the behavior is the same as having a value of 1.
Note that each language requires an entry in the property "locales" and a servlet mapping in web.xml for the I18n Servlet.
這個設定是指系統會如何在網址加入語系字串的樣式設定,如下列的/zh
http://localhost:8080**/zh**/web/guest/home
Set this to 2 if the locale is automatically prepended to every URL. This means that each URL points to just one language.
設定2-語系字串會加到網址
Set this to 3 if the locale is automatically prepended to a URL when the requested locale is not the default user locale.
設定3-當現在要求的語系與使用者不同時,會加到網址。預設還會顯示語系提醒。
系統中有幾個地方可以設定預設語系: