Skip to content

Conversation

@DustarMao
Copy link

@DustarMao DustarMao commented Mar 17, 2025

now custom framework cannot use args in refactor templates.

with refactor template i18n.t('$1') in i18n-ally-custom-framework.yml,
when we extract text like `hello, ${'world'}`,
we will only get i18n.t("<keypath of 'hello, {0}'>"),
but we need i18n.t("<keypath of 'hello, {0}'>", ['world']),
here is no way to do this now.

but with this patch, and config below, it will works as we need

# i18n-ally-custom-framework.yml
refactorTemplates:
  - i18n.t('$1', $2)
  - i18n.t('$1')

notice: the first template with $2 only used with args not empty, so we need a template without $2 for fallback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant