We ran across an interesting issue with translated strings in #3066193: Markup lost after an string translation.

See that issue for more details, but the summary is: some languages have multiple translations for a particular word. For example, in Catalan, the function t('Add') returns Afegeix, but depending on the context "Add" could also be translated as Afegiu.

This becomes an issue in

_bootstrap_colorize_text()

and _bootstrap_iconize_text(), because it attempts to identify text using a string matching approach. However, it performs the matching on translated strings, rather than untranslated strings.

In the issue above, a contributor translated t('Add area') (which is used for an action link that automatically gets styled by Bootstrap) into Afegiu una àrea. As you can see, Afegeix would not be found in that string, so it does not receive the styles for text that begins with t('Add').

I'm not sure if this should be considered a "bug" or a "feature request", so I started it as a bug. Feel free to change.

I'm also not sure if this is even possible to solve, or if it's just an inherent limitation of the way the string matching is being performed. Would it even be possible to perform the matching on a pre-translated string? Need to look closer...

Comments

m.stenta created an issue. See original summary.

m.stenta’s picture