To add support for a new language, you must source data from the Unicode CLDR repository or Emojiterra, generate the necessary JSON files, and register the language in the project's core files.
1. Source Data
- Unicode CLDR: Check if the language exists in the Unicode CLDR annotations. Use entries with
type="tts" to ensure a single, unambiguous translation. For example, <annotation cp="😼" type="tts">gato haciendo una mueca</annotation> results in :gato_haciendo_una_mueca:. - Emojiterra: Use Emojiterra for data like country flags. Extract data from the "Copy and Paste" section URL for the specific language (e.g.,
https://emojiterra.com/es/teclado/).
2. Generate JSON Files
Install dependencies and run the generation scripts:
python -m pip install -r utils/requirements.txt
python utils/generate_emoji.py
python utils/generate_emoji_translations.py
To add the language to the translation script, modify the languages dictionary in utils/generate_emoji_translations.py:
languages = {
'es': extract_names(get_language_data_from_url(github_tag, 'es'), 'es', get_emojiterra_from_url('https://emojiterra.com/es/copiar/')),
}
3. Register the Language
You must manually add the new language code to:
- The
LANGUAGES variable in emoji/unicode_codes/data_dict.py. - The
languages dict in utils/gh-pages/generatePages.py.