Creating Localized Content

Handling Currency, Measurements and Date Conversion

Currency values, measurements and dates all can require localization when translating them into different languages. In the case of dates, a format change is usually all that is required. But in for currencies and measurements, the units and values often need to change as well. Furthermore, for currency values representing prices, the prices might not be a direct conversion for different markets as pricing models might differ from one market to another.

While the Global Delivery Network (GDN) does not have built in conversion features, there are a number of different approaches to handling these needs:

  • Server-side code
  • Client-side code
  • Manual translation

These approaches are described in more detail below.

Server-side code

In this approach, code running in the source server displays the correct data in the correct format for the language being requested. The language can be identified by checking the X-Language-Locale header in the HTTP request. This approach provides you with the greatest control over the content and format. If using this approach, you will need to ensure that the resulting HTML block is tagged with 'no translation' since it will already have been 'translated' when the page is served.

Client-side code

This approach relies on doing the transformation on the client side after the page reaches the browser. There are a number of third-party libraries that can help with formatting dates and other values. It may be necessary to make additional calls to obtain the required information to display. This approach should also make sure that the relevant piece of content in the page is marked with the No Translate class so that it is not modified by translators.

Manual translation

In this approach, the localized content is entered by translators manually. In order for it to work, the translators will need to be supplied with the relevant information, such as localized price lists. The content will need to be sent for translation with the numbers intact (not transformed into placeholders). This approach can be error prone and costly, so we recommend you pursue other options first.

Was this article helpful?