EddyVerbruggen / nativescript-localize

Internationalization plugin for NativeScript using native capabilities of each platform
MIT License
79 stars 31 forks source link

Combination of HTML and parametrized strings #43

Closed exeleon closed 6 years ago

exeleon commented 6 years ago

Hi,

I am trying to combine HTML styling with parameterized strings. Something like this:

"loc_key": "hello <b> %s </b>"

Then I use as follows: <Label text="{{ 'loc_key' | L:'Simon' }}"></Label>

But rendered text is: hello <b> Simon </b>

I also tried the following as mentioned here:

"loc_key": "hello &lt;b> %s &lt;/b>" "loc_key": "hello &lt;b> %1$s &lt;/b>"

I am using: tns-android: 4.1.3 tns-core-modules: 4.1.0 nativescript-localize: 3.0.5

Thanks in advance

lfabreges commented 6 years ago

I haven't tested it, can you render HTML tags using a NativeScript Label ? Even without the plugin with just a raw text ?

exeleon commented 5 years ago

@lfabreges Sorry for the late response. No, I can't. When I write:

<Label text="<b>hello world</b>"></Label>

The rendered result is: \hello world\