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

fix: fix logging in i18n #445

Merged
merged 11 commits into from
Oct 21, 2024
Merged

fix: fix logging in i18n #445

merged 11 commits into from
Oct 21, 2024

Conversation

sinelnikov-web
Copy link
Contributor

No description provided.

@sinelnikov-web sinelnikov-web marked this pull request as ready for review October 7, 2024 09:43
@@ -91,13 +94,13 @@ export function i18nFactory(
* console.log(examplePluralize); // '5 products'
* ```
*/
export function resolveTemplate(value: Translation, params?: I18nParams, opts: I18nOpts = {}): string {
export function resolveTemplate(value: Translation, params?: I18nParams, opts: I18nOpts = {}, meta?: I18nMeta): string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Как то дохрена аргументов выходит. Я уже запутался.

Copy link
Contributor

Choose a reason for hiding this comment

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

Например, почему meta нельзя сделать частью opts

Copy link
Contributor Author

@sinelnikov-web sinelnikov-web Oct 7, 2024

Choose a reason for hiding this comment

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

@kobezzza
opts - для настройки перевода. Например прокинуть правила плюрализации или настройки формата чисел.
meta - мета информация о текущем переводе. Язык, кейсеты, ключ и т.д.
meta никак не влияет на логику переводов, поэтому посчитал странным делать это частью opts.
В перспективе больше параметров появляться не должно.

Maksim Sinelnikov added 2 commits October 8, 2024 14:48
@sinelnikov-web sinelnikov-web merged commit 34288fc into master Oct 21, 2024
4 of 5 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.

3 participants