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

Cannot use namespaces when using the $t(key) markup in the t custom attribute #265

Open
pmanu93 opened this issue Apr 19, 2018 · 3 comments
Assignees

Comments

@pmanu93
Copy link

pmanu93 commented Apr 19, 2018

I'm submitting a bug report

  • Library Version:
    2.1.2

Please tell us about your environment:

  • Operating System:
    Linux Mint 17.3 Rosa

  • Node Version:
    v8.10.0

  • NPM Version:
    5.8.0
  • Browser:
    all

  • Language:
    all

Current behavior:
When using the attribute with combined translations, I can't use namespace because it breaks the translation.
Example:

 <h4 t="$t(global.open) $t(app:activities)"></h4>

renders as

activities)

but

 <h4 t="$t(global.open) $t(global.open)"></h4>

renders as

Abrir Abrir

If I use t="app:activities" it works fine, so the problem must be related to the $t(key) markup

Expected/desired behavior:

  • What is the expected behavior?
    The template with
 <h4 t="$t(global.open) $t(app:activities)"></h4>

should render as

 Abrir atividades
@zewa666
Copy link
Member

zewa666 commented Apr 19, 2018

I'm not sure we can really do a lot about that. Nevertheless this example seems like to be anyway better solved with two BindingBehaviors

<h4>${'global.open' & t) ${'app:activities' & t}</h4>

@zewa666 zewa666 self-assigned this Apr 19, 2018
@pmanu93
Copy link
Author

pmanu93 commented Apr 19, 2018

That's what I ended up doing ... however I thought I should inform you, because in the i18next documentation it shows that this should be possible :)

@zewa666
Copy link
Member

zewa666 commented Apr 19, 2018

I will look into this more closely

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

No branches or pull requests

2 participants