php-gettext / Gettext

PHP library to collect and manipulate gettext (.po, .mo, .php, .json, etc)
MIT License
687 stars 134 forks source link

add fix to skip ' with trailing slash #154

Closed AleksSem closed 7 years ago

AleksSem commented 7 years ago

add fix to skip ' with trailing slash in translation for example {i18n.__('You don\'t have any bookmark.')}

mlocati commented 7 years ago

What if we have an even number of \ before '?

AleksSem commented 7 years ago

I don`t check that issue with multiple \ but without that fix ill get

You don'thaveanybookmark.')}

{i18n.__('Youcanadda .....................

instead

You don't have any bookmark.

in my translations

AleksSem commented 7 years ago

Yes you definitely right, your solution i better.

AleksSem commented 7 years ago

Should work now Checked on on cases :

{i18n.__('You don\'t have any bookmark.')}
{i18n.__('You don\\\'t have any bookmark.')}
{i18n.__('You don\\\\\\\\\'t have any bookmark.')}
{i18n.__('You don\\\\\\\\\"t have any bookmark.')}
oscarotero commented 7 years ago

Thanks 👍