Need help to put in bold hard coded text traduction please

Need help to put in bold hard coded text traduction please

wjaouhar
Excursionist
13 0 4

Hi, 

All the translator app don't consider the hard coded text when translating from a language to an other, so i created a blog like this : 

1/in the liquid template i put this : 

{{ 'blog.comment.email' | t }}

 

2/in the locales/en.default.json i put this : 

{

"blog":

{ "comment": { "email": "Your email" } }

}

 

it work well and it traduce the "your email" BUT my probleme is that i want this texte to be in BOLD, Can anyone help me with this ?

 

many thanks

 

 

Reply 1 (1)

emre_altunkaya
Shopify Partner
2 0 0

add '_html' suffix to your key in locale json file and use 'strong' or 'b' tags to make text bold you wanted.
For example:

 

"blog":

{ "comment": { "email_html": "Your <strong>email</strong>" } }

}

 


Don't forget to change your 'email' key to 'email_html' in your relevant liquid file.

Reference: https://shopify.dev/docs/themes/architecture/locales/storefront-locale-files#prevent-translations-fr...