BoltTranslate / labels

Bolt Labels extension - Translatable labels for Bolt
https://bolt.cm/
18 stars 12 forks source link

Mark function doesn't work when capitalize filter is applied #49

Open lenvanessen opened 6 years ago

lenvanessen commented 6 years ago

Left using capitalize, right not using capitalize schermafbeelding 2017-08-29 om 15 01 30

SvanteRichter commented 6 years ago

Yeah, most string filters output strings, not twig objects. The hacky way to do this would be {{ l('reed our creed')|striptags|capitalize }}, but then you loose the mark tags.

I don't think this will be "fixed" since this is really twig core code, and it's "working as designed"

xiaohutai commented 6 years ago

It usually makes more sense to do text-transform: uppercase; via CSS.

SvanteRichter commented 6 years ago

@xiaohutai That'll transform the whole string, right? So not the same as |capitalize, right?

Usually capitalizing a whole string is a stylistic choice, but capitalizing the first letter is an indication of the meaning, right?

xiaohutai commented 6 years ago

@SahAssar You're right! I misinterpreted it.

There's a text-transform: capitalize in CSS, but this one is different than the one in Twig: https://twig.symfony.com/doc/2.x/filters/capitalize.html