angular-gettext icon indicating copy to clipboard operation
angular-gettext copied to clipboard

Support non-breaking space

Open cmalard opened this issue 8 years ago • 1 comments

This is not obvious how to use non-breaking space with Angular and Angular-gettext. They are required in some languages, like in french before each question, exclamation mark, semicolon, thousands separator, or to help with phone number, id, ...

  •   in html : converted by Angular into   (so Angular-gettext doesn't match)
  •   in js : OK
  •   in html : OK
  •   in js : converted by Angular into   (and it does not work in alert & confirm box but well... ok :-) )

Solutions :

  • never use non-breaking spaces (not cool)
  • move all strings containing non-breaking spaces in JS controllers (crappy)
  • use Angular attribute ng-bind-html in the html (tricky) (ex: <p ng-bind-html="'Question ?' | translate"></p>)
    (and comments doesn't work with translate-comment nor ng-bind-html-comment, they are removed from the .pot)
  • make Angular-gettext do the job (best solution ? PR to do ? ie matching &nbsp; as )

cmalard avatar May 27 '16 16:05 cmalard

I’ve been hit by this bug too, and I totally agree with you Cédric. It definitely needs to be fixed within angular-gettext.

DevDef avatar Jun 13 '16 14:06 DevDef