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 hardcode something else than text inside a tag #42

Closed
iloris opened this issue Sep 28, 2012 · 1 comment
Closed

Cannot hardcode something else than text inside a tag #42

iloris opened this issue Sep 28, 2012 · 1 comment

Comments

@iloris
Copy link
Contributor

iloris commented Sep 28, 2012

With the following json:

{
  "app": {
    "name": "i18next"
  },
  "nav": {
    "brand": "Company name",
    "language": "Language",
    "english": "English",
    "french": "French",
    "spanish": "Spanish",
    "german": "German"
  }
}

How do you get the following:

<a href="#" class="dropdown-toggle" data-toggle="dropdown" data-i18n="nav.language">Language <b class="caret"></b></a>

(How do I add <b class="caret"></b> to the a text, or can I harcode it?)

I cannot think of an easy way.

@iloris
Copy link
Contributor Author

iloris commented Sep 28, 2012

Found the solution in the example page:
http://i18next.com/pages/sample.html
See section: 'setting inner html'

Add the html to desired resource:

{
  "app": {
    "name": "i18next"
  },
  "nav": {
    "brand": "Company name",
    "language": "Language <b class='caret'></b>",
    "english": "English",
    "french": "French",
    "spanish": "Spanish",
    "german": "German"
  }
}

And use this code:

<a href="#" class="dropdown-toggle" data-toggle="dropdown" data-i18n="[html]nav.language"></a>

@iloris iloris closed this as completed Sep 28, 2012
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

1 participant