Romanchuk / angular-i18next

angular v10+ integration with i18next v19.4+
MIT License
131 stars 33 forks source link

Nesting example #118

Closed sergeykosik closed 8 months ago

sergeykosik commented 9 months ago

@Romanchuk Please provide the nesting example following i18next docs, e.g. how to use the i18next pipe to achieve the following:

{
    "girlsAndBoys": "They have $t(girls, {\"count\": {{girls}} }) and $t(boys, {\"count\": {{boys}} })",
    "boys": "{{count}} boy",
    "boys_other": "{{count}} boys",
    "girls": "{{count}} girl",
    "girls_other": "{{count}} girls",
}
i18next.t('girlsAndBoys', {girls: 3, boys: 2});

Using the i18next pipe didn't work for me:

{{ 'girlsAndBoys' | i18next: {girls: 3, boys: 2} }}
Romanchuk commented 8 months ago

@sergeykosik This issue is not relates to angular-i18next, it relates to i18next itself. angular-i18next keeps same settings and same api as it is in i18next. angular-i18next has some functionallity that helps integrate i18next to angular project, but base docs are i18next original docs. So you need to look answers there.

Look carefully if your setup is valid for current i18next version, because there were breaking changes in options (skipOnVariables flag) and also in JSON format since v21:

https://www.i18next.com/misc/migration-guide#v20.x.x-to-v21.0.0