Liferay is used all around the world. In order to accommodate for different languages, regional specificities and cultural matters, we need to provide full localization capabilities for our product. One of which is address localization.
Currently in portal, the address is formatted only for the US. We should add support to handle different address formats for different countries so that address input fields and display correctly reflect an address in a specific country.
For example, Japan address inputted in Japanese should be displayed according to Japanese formatting rules, and Japan address inputted in Roman characters should be displayed according to the Romanization formatting rule.
- Provide developers with an API to format an address with specified formatting rules. The hook/module that implements this API will be responsible for determining how the address will be displayed.
- The hook/module may examine the character set that the address is written in to determine if the address should be displayed using the Japanese formatting rule or the Romanized formatting rules.
- The hook/module may use the current user's locale to determine the format of the address
- In addition to the address itself, some info that the developers may need to correctly display the address:
- The site's locale
- The locale of the user viewing the address
- Allow mulitple localization hook/modules to be deployed at the same time. For example, if one wants to support addresses in both Japan and China, one can deploy the Japan address hook and China address hook without the need to merge the logic of the two
- Provide a utility that detects the language of an address input
- Ideally, the user who is entering the address should not need to provide additional details about how to display the address.