feat(04-02): select CLDR and Laravel plural forms with PHP parameters

- Use go-i18n only to pick a category label, then substitute :name/:Name/:NAME
- Treat YAML maps as plurals when all keys are locale CLDR categories
- Parse pipe strings with {n} and [a,b]/[a,*] conditions at catalog load

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jakub Zych
2026-09-18 13:51:15 +02:00
parent f824e55c81
commit 6d8786a2af
7 changed files with 500 additions and 11 deletions

View File

@@ -1,3 +1,8 @@
greeting: Hello
labels:
pluginName: Hello plugin
albums:
one: ":count album"
other: ":count albums"
items: "{0} No items|{1} One item|[2,*] :count items"
helloName: "hi :name :Name :NAME"

View File

@@ -1,3 +1,10 @@
greeting: Cześć
labels:
pluginName: Wtyczka Hello
albums:
one: ":count album"
few: ":count albumy"
many: ":count albumów"
other: ":count albumu"
posts: ":count wpis|:count wpisy|:count wpisów|:count wpisu"
helloName: "cześć :name :Name :NAME"