How to localize currency
Phrases which contain currency in them are found in many websites and mobile apps, and the localization of them varies from language to language. To solve this problem, there are a number of external libraries that you can use to convert and localize currency formats used in other languages.
External libraries for localizing currency
Here are a few examples of external libraries you can use:
- Numeral.js
- Use the built in i18n features of JavaScript: the Intl object
- Check out this article to get started: How to get started with internationalization in JavaScript
- Globalize.js
Tell Localize about your converted currency numbers
After you've implemented the localization of currency in your website or app, the next step is to tell Localize whether to ignore those numbers that it finds in your content (if you've already provided the complete translations).
Here are a few methods that you can use, depending on your situation:
- Define variables in your phrases
- Add
<var>
tags to your HTML - Use the Block CSS Classes and IDs feature
- Add a
notranslate
attribute - Add an
ignore
attribute
Updated about 3 years ago