Giter VIP home page Giter VIP logo

Comments (9)

adrai avatar adrai commented on June 16, 2024 1

There's no plan for that. Feel free to contribute with a PR if you like to.

from jquery-i18next.

jamuhl avatar jamuhl commented on June 16, 2024

https://github.com/i18next/jquery-i18next#set-innerhtml-attributes does already what you ask for

from jquery-i18next.

AlexandrTsvetkov avatar AlexandrTsvetkov commented on June 16, 2024

@jamuhl Thanks for answer.
What do you think about adding additional information to docs with examples how to use it?

from jquery-i18next.

jamuhl avatar jamuhl commented on June 16, 2024

feel free to provide a PR improving the docs...(technically it's nothing else then setting innerHtml on an html element)

from jquery-i18next.

AlexandrTsvetkov avatar AlexandrTsvetkov commented on June 16, 2024

@jamuhl Yes, sure. Wanted to ask one more thing. Maybe I am doing something wrong, but as an output I got this html code

<p data-i18n="[html]userMessagesUnread">
Hello &lt;1&gt;Name<!--1-->, you have {{count}} unread message.
</p>

Which looks like in the browser:
image

Could you please advise me? Thanks!

from jquery-i18next.

adrai avatar adrai commented on June 16, 2024

Here you have an example:

<p data-i18n="[html]userMessagesUnread" data-i18n-options='{ "name": "John", "count": 3 }'>

from jquery-i18next.

AlexandrTsvetkov avatar AlexandrTsvetkov commented on June 16, 2024

@adrai Thanks for providing link.
Unfortunately, in this example we use concrete tag <strong> directly in translation
What I wanted to achieve in to put in translation <1> tag as a placeholder and later define it in html code as I mentioned in the first post. Same as <Trans> component does from react library

"userMessagesUnread": "Hello <1>{{name}}</1>, you have {{count}} unread message."

<p data-i18n="userMessagesUnread">
  Hello <strong>{{name}}</strong>, you have {{count}} unread message
</p>

from jquery-i18next.

adrai avatar adrai commented on June 16, 2024

No, there is no Trans component for jquery-i18next

from jquery-i18next.

AlexandrTsvetkov avatar AlexandrTsvetkov commented on June 16, 2024

@adrai Exactly, that's why this issue is the feature proposal :)

from jquery-i18next.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.