---
# System prepended metadata

title: Localization

---

# Localization
* Ensure no duplicate keys are created when adding new strings.
* Always add the namespace (file) while using keys.
  ```
  // Takes the translation from the defined default namespace.
  t('start_exploring');
  
  // This will lookup the key in a namespace (file) called common.json
  t('common:start_exploring'); // Correct Way
  ```
* Use placeholders with descriptive names: "Welcome {{student_name}}" is much better than "Welcome {{0}}".
* Use Singular, Plural and Interval keys where required.
  ```
  {
  "key": "item",
  "key_plural": "items",
  "keyWithCount": "{{count}} item",
  "keyWithCount_plural": "{{count}} items",
  "key1_interval": "(1){one item};(2-7){a few items};(7-inf){a lot of items};"
  }
  
  t('key', {count: 0}); // -> "items"
  t('key', {count: 1}); // -> "item"
  t('key', {count: 5}); // -> "items"
  t('key', {count: 100}); // -> "items"
  t('keyWithCount', {count: 0}); // -> "0 items"
  t('keyWithCount', {count: 1}); // -> "1 item"
  t('keyWithCount', {count: 5}); // -> "5 items"
  t('keyWithCount', {count: 100}); // -> "100 items"
  t('key1_interval', {postProcess: 'interval', count: 1}); // -> "one item"
  t('key1_interval', {postProcess: 'interval', count: 4}); // -> "a few items"
  t('key1_interval', {postProcess: 'interval', count: 100}); // -> "a lot of items"
  ```