Skip to content

✨ feat: clean account names, add Ukrainian, Czech, Serbian and Croatian - #1

Merged
msikorski26 merged 3 commits into
masterfrom
feat/more-languages
Nov 29, 2026
Merged

msikorski26 merged 3 commits into
masterfrom
feat/more-languages

Conversation

@msikorski26

Copy link
Copy Markdown
Member

What

  • Account names: sign-in names such as Kasia9632, KasiaDy12653 or ania.k are cleaned before inflecting, so they give Kasiu / aniu and the right gender. When nothing usable is left (123), the result is "".
  • Shared core: createLanguage() (JS) and BaseLanguage (PHP) handle cleaning, words, initials, casing and exceptions. Polish moved onto it with identical results on all 3,649 names.
  • New languages: uk, cs, sr (Cyrillic and Latin), hr, in JS and PHP, with formal titles and Tolgee support.
  • Docs: README says which install command is for which stack; languages table and accuracy notes.

Breaking

vocative('123') now returns "" instead of 123, so this should go out as 0.2.0.

Tests

  • JS: 795 passed
  • PHP: 786 passed
  • New languages are checked against about 50 common names each (tests/fixtures/<code>.json), not a full dictionary yet.

- names such as Kasia9632, KasiaDy12653 or ania.k keep only the leading name
- digits, symbols and a camelCase tail are dropped; nothing usable gives ""
- createLanguage() in JS and BaseLanguage in PHP handle cleaning, words,
  initials, casing and exceptions, so a language only supplies its rules
- Polish moved onto the core with identical results on all 3,649 names
- uk, cs, sr and hr entry points in JS and Vocative::uk/cs/sr/hr() in PHP
- Serbian reads and answers in Cyrillic or Latin; Serbian and Croatian
  share one rule set
- formal titles per language (Пане/Пані, Pane/Paní, Gospodine/Gospođo)
- Vocative::for() falls back from regional codes such as sr_Latn
- shared fixtures of common names keep both ports identical
- say which install command is for which stack (npm or Composer)
- languages table, examples and accuracy notes for uk, cs, sr and hr
- contributing guide adds a language through createLanguage/BaseLanguage
@msikorski26
msikorski26 merged commit c7c2817 into master Nov 29, 2026
6 checks passed
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.

1 participant