Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add pluralization to the qualification labels #1342

Merged
merged 1 commit into from
Apr 13, 2023

Conversation

Merkur39
Copy link
Member

@Merkur39 Merkur39 commented Apr 12, 2023

BREAKING CHANGE: getBoundT: With the arrival of pluralization, the return of this function has been updated.
The second parameter, to indicate the country, is no longer of String type.

Before, we use this implementation:

const t  = getBoundT(lang)
t("translation.key", "fr" )

Now please follow the following example:

const t = getBoundT(lang)
t("translation.key", { country: "fr" })

For pluralization, just add the smart_count option

t("translation.key", { country: "fr", smart_count: 2 })

The Items.invoices translation key has been removed, its value has been added to the Items.invoice key in its plural version.
Please use this new implementation:

t("Items.invoice", { smart_count: 2 })

The following translation keys are no longer plural by default. Items.other_revenue, Items.unemployment_benefit, Items.personal_sporting_licence, Items.tax_timetable.
Please use this new implementation:

t("translation.key", { smart_count: 2 })

@Merkur39 Merkur39 force-pushed the feat/Add-pluralization-&-update-getBoundT-function branch from 3bb6141 to 8aff654 Compare April 12, 2023 11:54
Copy link
Contributor

@JF-Cozy JF-Cozy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pour les exemples de BC, perso j'aime bien indiquer ce qu'il y avait avant, et ce qu'il doit y avoir maintenant. Ca permet de retrouver plus facilement des cas à modifier dans l'app.

BREAKING CHANGE: getBoundT: With the arrival of pluralization, the return of this function has been updated
The second parameter, to indicate the country, is no longer of String type.

Before, we use this implementation:
```
const t  = getBoundT(lang)
t("translation.key", "fr" )
```

Now please follow the following example:
```
const t  = getBoundT(lang)
t("translation.key", { country: "fr" })
```

For pluralization, just add the `smart_count` option
```
t("translation.key", { country: "fr", smart_count: 2 })
```

The `Items.invoices` translation key has been removed,
its value has been added to the `Items.invoice` key in its plural version.
Please use this new implementation:
```
t("Items.invoice", { smart_count: 2 })
```

The following translation keys are no longer plural by default.
`Items.other_revenue`, `Items.unemployment_benefit`,
`Items.personal_sporting_licence`, `Items.tax_timetable`.
Please use this new implementation:
```
t("translation.key", { smart_count: 2 })
@Merkur39 Merkur39 force-pushed the feat/Add-pluralization-&-update-getBoundT-function branch from 8aff654 to 7365ae0 Compare April 12, 2023 16:08
@Merkur39
Copy link
Member Author

Merkur39 commented Apr 12, 2023

Pour les exemples de BC, perso j'aime bien indiquer ce qu'il y avait avant, et ce qu'il doit y avoir maintenant

Ajouté au commit et à la description 👍

@Merkur39 Merkur39 merged commit 6c27cc3 into master Apr 13, 2023
@Merkur39 Merkur39 deleted the feat/Add-pluralization-&-update-getBoundT-function branch April 13, 2023 11:58
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.

3 participants