bitjson / gulp-l10n

A gulp plugin for localizing html.
https://www.npmjs.com/package/gulp-l10n
MIT License
14 stars 7 forks source link

Different translation for same string #31

Closed basile-laderchi closed 7 years ago

basile-laderchi commented 7 years ago

I have the following scenario: I have a table with the header cells displaying only the first letter of the day: "M T W T F S S", but in Greek that I am trying to translate the two "T"s should be translated differently. The same goes for the two "S"s. Is there any way I could distinguish between those two?

Maybe when generating the hash and checking back an attribute could be hashed along with the text?

bitjson commented 7 years ago

@basile-laderchi would a solution like this work for you? You could translate the full name (which is the more logical thing to translate anyways), and then only display the first letter. Also means your locale file won't be full of hard-to-understand values.

basile-laderchi commented 7 years ago

@bitjson to be completely honest the localized content is part of an inline svg. The localization works great (only thing I did is to add the "tspan" to the elements to be exported).

Unfortunately after several tests and searching on the net I found out that the ":first-letter" pseudo selector doesn't work with svg, but having jquery already loaded I re-set their content only to the first letter of their content.

bitjson commented 7 years ago

@basile-laderchi glad to hear that worked for you. Closing this issue for now, but please let me know if you think I should reopen. 🚀