As much as i wish to upgrade my Rails 2.3.x application Daily Fratze to the newest tag of the Rails 2.3.x branch, i cannot.
First there was the epic fail of release 2.3.6, that broke all HTML Helpers and forced the Rails XSS protection upon us. This release was immediately followed by 2.3.7 and 2.3.8. With my tests, this version was still enforcing Rails XSS and breaking helpers like “h”.
Rails 2.3.9, released last week, puts en end to this.
I just was about to upgrade, when i read this error: Textarea input silently truncated in 2.3.8!. The input of a textarea is truncated if the text entered consists of two lines or more with one of them quoted as the Rack middleware messes with the input.
I can confirm that this behavior still applies to 2.3.9.
It’s a shame, that all the talk is about Rails 3 with bugs like this in an older branch. I understand that this is a Rack problem but as it is already fixed in newer Rack versions, i cannot understand that the Rails team doesn’t bump the required Rack version respectively has no tests for problems like these.
So i’m hoping that Rails 2.3.10 sees the light of day anytime soon.
Anyway, as Rails 2.3.9 suddenly uses a new interpolation syntax for the translation files (“Hello {{name}}” becomes ” Hello %{name}”), here is a one-liner to update i18n files to the new syntax:
find . -iname "*.yml" -exec sed 's/{{\([^\{\}]*\)}}/%{\1}/g' -i {} \; |
find . -iname "*.yml" -exec sed 's/{{\([^\{\}]*\)}}/%{\1}/g' -i {} \;
If you like some less escapism use xargs
find . -iname "*.yml" | xargs sed 's/{{\([^{}]*\)}}/%{\1}/g' -i; |
find . -iname "*.yml" | xargs sed 's/{{\([^{}]*\)}}/%{\1}/g' -i;
Commands need to be executed inside your locale directory.
Filed in English posts, Rails
|