Skip to content

Directive do not translate #808

@xeewi

Description

@xeewi

I'm submitting a ... (check one with "x")

[x] bug report => check the FAQ and search github for a similar issue or PR before submitting
[ ] support request => check the FAQ and search github for a similar issue before submitting
[ ] feature request

Current behavior

When i'm using translate directive, text don't translate, key still here

// en.json
{
  "key": "en-value"
}

// fr.json
{
  "key": "fr-value"
}

// page.html
<p translate>key</p>

// result 
key

// use translate.use('fr') in ts file
// result
key

Expected/desired behavior

// en.json
{
  "key": "en-value"
}

// fr.json
{
  "key": "fr-value"
}

// page.html
<p translate>key</p>

// result 
en-value

// use translate.use('fr') in ts file
// resultf
fr-value

Reproduction of the problem

I don't really know how to reproduce this problem, I just installed ngx-translate on my Angular project like it's say on the Getting Started

What is the motivation / use case for changing the behavior?
Just want to translate using directive, and string between tag as key (like described on the readme)

Please tell us about your environment:

  • ngx-translate version: 9.1.1

  • Angular version: 5.0.3

  • Browser: [all]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions