voidlabs / mosaico

Mosaico - Responsive Email Template Editor
https://mosaico.io
GNU General Public License v3.0
1.69k stars 500 forks source link

Localization strings #580

Closed GuillaumeSorel closed 4 years ago

GuillaumeSorel commented 4 years ago

is there a way to have all strings in this file https://github.com/voidlabs/mosaico/blob/master/res/lang/mosaico-fr.json (here for France) in order to be able to translate all strings like Preheader / link as in the screenshot... without modifying any template like some users did?

I would be very happy to contribute for the French localization :-) image

bago commented 4 years ago

See #308 and #399

GuillaumeSorel commented 4 years ago

What you mean is that I edit the versafix template for instance and translate the text directly in the source, isn't? And then replace this template in each civicrm site we have?

preheaderText {label: PreHeader Text; extend:text; help: This text will be shown on some email clients as a preview of the email contents;}`
      leftImage { label: Left Image; extend: image }
      leftLongText { label: Left Text; extend: text }
      leftButtonLink { label: Left Button; extend: buttonLink }
      middleImage { label: Central Image; extend: image }
      middleLongText { label: Central Text; extend: text }
      middleButtonLink { label: Central Button; extend: buttonLink }
      rightImage { label: Right Image; extend: image }
      rightLongText { label: Right Text; extend: text }
      rightButtonLink { label: Right Button; extend: buttonLink }
      webversionText{ label: Web Link Text; extend: text;}
      unsubscribeText{ label: Unsubscribe Link; extend: text;}
bago commented 4 years ago

Please read the 2 tickets.

The default behaviour is that you have to translate the template because if you think at it, you could have hardcoded texts or images in your master template and those test cannot be translated by mosaico itself. So, our idea is that the template itself is language-specific and the "correct" way is to create a template for each language. That's why you don't see template strings in the language packs. But, if you stick to versafix and you don't want to make copies for each language, then you can use the "plugin hack" to force mosaico pass template strings into the translator.

GuillaumeSorel commented 4 years ago

ok thanks Bago, I hadn't understand your approach. Now I can see clearer. regards Guillaume