Skip to content

Add Azerbaijani language - #334

Open
Elli55 wants to merge 1 commit into
carpedm20:masterfrom
Elli55:add_az
Open

Elli55 wants to merge 1 commit into
carpedm20:masterfrom
Elli55:add_az

Conversation

@Elli55

@Elli55 Elli55 commented Aug 2, 2026 •

Copy link
Copy Markdown

Adds Azerbaijani translations for emoji names, sourced from the Unicode CLDR annotations (az.xml, type="tts" entries).

I discovered this library while building a YouTube comments business-analysis algorithm with Aİ .
Adding Azerbaijani support isn't related to that project specifically. I'm adding it because I think many app developers could benefit from broader language coverage.

Updated utils/generate_emoji_translations.py to include az
Added az to LANGUAGES in emoji/unicode_codes/data_dict.py
Generated emoji/unicode_codes/emoji_az.json

All 102 tests pass (pytest).

Source:
https://github.com/unicode-org/cldr/blob/main/common/annotations/az.xml
https://emojiterra.com/keyboard/az/

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@feiiiiii5

Copy link
Copy Markdown

Thanks for adding Azerbaijani — the data itself looks clean (5225 entries, all non-empty strings, all :name: wrapped, no type problems). One thing blocks the PR, and a second is worth a follow-up.

The test suite does not pass with az added. Applying data_dict.py + emoji_az.json on top of current master (d5d59d5):

5 failed, 97 passed
FAILED tests/test_core.py::test_emojize_name_only
FAILED tests/test_core.py::test_emojize_languages
FAILED tests/test_core.py::test_demojize_name_only
FAILED tests/test_versions.py::test_emoji_versions_complete_emojize
FAILED tests/test_versions.py::test_emoji_versions_complete_demojize

master alone is 102 passed, and the tests do not import anything from utils/, so the three generator files should not affect this. The description says all 102 pass — I could not reproduce that, and the failures come from the language data rather than the environment.

26 Azerbaijani names can never be converted back to an emoji. emojize returns them as literal text:

>>> emoji.emojize(':bayraq_i̇ran:', language='az')   # the i is i + U+0307
':bayraq_i̇ran:'
>>> emoji.demojize('🇮🇷', language='az')
':bayraq_i̇ran:'        # one-way: nothing turns this back into the flag

English has 0 such names, so this is specific to az. Two distinct causes, and in both cases the character is missing from the allowlist at emoji/core.py:43:

  • U+0307 COMBINING DOT ABOVE, in 14 names — the Azerbaijani dotted i. _EMOJI_NAME_PATTERN already lists U+0306 (dot below) and U+0308 (diaeresis) but not U+0307, and \w does not match combining marks.
  • U+003B SEMICOLON, in 12 names — CLDR joins alternatives with ;, and the generator turned the space into _ but kept the semicolon: :kişi;_saqqal:. ; is not in the allowlist either.

I confirmed it by patching only that one line, with no other change:

_EMOJI_NAME_PATTERN += '\u0307'   ->  26 unmatchable names becomes 12
_EMOJI_NAME_PATTERN += ';'        ->  26 unmatchable names becomes 0

and with both characters present the suite is back to 102 passed. So the five failures are a direct consequence of the two missing characters.

Which side to fix is your call. Widening _EMOJI_NAME_PATTERN is one line and lets the existing allowlist do its job, but a semicolon inside a :shortcode: is unusual and you may prefer the generator to emit :kişi_saqqal: or drop the alternative — that fixes cause 2 without touching the pattern. U+0307 is not avoidable, since it is the correct spelling of the Azerbaijani i.

Secondary: emoji_az.json has 5225 entries where every other language file has 5244

The 19 missing are all Emoji 18.0 — U+1FADD, U+1F6D9, U+1FA8B, U+1FA8C, U+1FA8D, U+1FACC, U+1FAEB, U+1FAF9, U+1FAFA, plus the 10 skin-tone variants of U+1FAF9/U+1FAFA.

For the 9 single-codepoint ones CLDR's az.xml does have tts (mayak, vintaçan, pozan, kəpənəktutan, monarx kəpənəyi, xiyar turşusu, Sınıq üz, …), and az.xml carries the same 1975 tts entries as es.xml, so the source is not the limit. emoji_es.json covers the 10 skin-tone sequences even though es.xml has no tts for them either, so the generator composes those — which suggests the composition step did not run for az.

The effect is silent: demojize(x, language='az') returns x unchanged for those 19, with no exception, so only a key count surfaces it.

I also checked pyproject.toml — package-data globs unicode_codes/emoji_*.json, so the new file will be packaged without further changes. Happy to re-test a regenerated emoji_az.json, or to send the pattern fix as a PR if that is easier than regenerating.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants