"rake gettext:findpo" running forever

Updated . Posted . Visible to the public.

Under certain circumstances gettext_i18n_rails will hit a near-infinite loop. This occured in Rails 2.3.5 with Haml 3.0.18 and fast_gettext 0.5.10.

gettext_i18n_rails's Haml-Parser compiles the Haml code and delegates the parsing to ruby_parser. Unfortunately, ruby_parser appears to be confused when a string contains both escaped chars (that is, any unicode characters as ndash, umlauts etc.) and #{} blocks, which makes it extremely slow.

The easiest "solution" we came up with was to replace all occurrences of UTF-8 chars with their HTML entities (so "ü" instead of "ü" etc).

Dominik Schöler
Last edit
License
Source code in this card is licensed under the MIT License.
Posted by Dominik Schöler to makandra dev (2012-09-10 11:49)