SELECTED_LANGUAGE: "de", "en", "fr", ... (any valid language identifier)
SELECTED_CURRENCY: "EUR", "USD", ... (any valid currency from CLDR data)
MESSAGE_TEXTS: { key : value, ...}
Loading required locale data
Depending on whether your clients support the Intl API + all relevant locales (prominent exceptions right now are NodeJS, Safari on Mac and Safari on iOS) the amount of data and polyfills to load differs.
The data loaded here contains information on how to format dates (+ calendar data) and numbers (+ currencies).
Loading FormatJS Data for 4 Locales
Because of an incompatible JSONP-like approach of the data delivered through FormatJS, we have integrated the data in some ES2015/JSPM compatible way in the vue-locale project. To load the data to the following:
The data loaded here contains formatting instructions for relative formats + the required plural function for figuring out the required plural wording for message formatting.
Usage
Adding Messages
You should pass the matching locale data structure with relevant messages e.g. German.
请发表评论