Funny things and common gotchas to know and avoid - Get on Rails with Globalize! Part 7 of 8

posted: June 7th, 2007 · by: Sven

in: Programming, Globalization · tagged as: , , , , , , , ·  4 comments »

This article is part of the series “Get on Rails with Globalize!” and like the two last installments it’s a catch-all list: this time we’re going to point out some unexpected behaviours, problems and other funny things. Nothing world-shattering, just some things that you’ll probably want to be informed about so you don’t run into any problems.

  • I’m seeing lot’s of strange characters!
  • Weird Currency parsing results
  • Globalize WrongLanguageError on attribute read
  • Globalizes screws my RJS (or: my IE6)!

I’ll edit and complete this list as needed. If you’ve found any other common gotchas concerning Globalize, please drop me a note!

Read the rest of this entry

Getting MySQL compare Unicode Greek Extended characters correctly

posted: February 8th, 2007 · by: Sven

in: Programming, Globalization · tagged as: , , , , , ·  2 comments »

Lately I ran into an interesting issue with MySQL’s string comparsion that I haven’t seen before.

I’ve been setting up a simple vocabulary and grammar learning program for my spouse who’s started learning ancient greek a while ago. After she’s entered some testdata containing several funny looking ancient greek characters we saw that MySQL 4.1 seems to treat the following characters as equal when compared as VARCHAR:

Char. Unicode
Codepos.
UTF-8 Name
eta U+03B7 206 183 eta
eta with oxia U+1F75 225 189 181 eta w/ oxia
eta with persispomeni and ypogegrammenti U+1FC4 225 191 135 eta w/ persispomeni and ypogegrammenti

These characters are stored and retrieved correctly (which was a nice thing to watch, by the way). But when it comes to compare them to each other they are wrongly regarded the same character.

Read the rest of this entry

Some common questions on getting started - Get on Rails with Globalize! Part 2 of 8

posted: December 3rd, 2006 · by: Sven

in: Programming, Globalization · tagged as: , , , , , , ·  14 comments »

In Part 1 of this series you’ve seen how easy it is to get up and running with Globalize. And you’ve seen what the most basic concepts of this multilanguage plugin for Ruby on Rails are, namely:

  • .t for ViewTranslations (arbitrary, static text)
  • the translates directive for ModelTranslations and
  • .loc to localize your date, time and number formats.

In this article we’ll talk about some common questions on getting started like:

  • How to setup your application to use Unicode
  • How to select and keep the current user’s locale
  • How to translate entire templates (instead of individual strings)
  • How to translate Rails ActiveRecord messages

(Update 06/12/06.: mention ActiveRecord::Multibyte and explain MySQL/Unicode character-set)

Read the rest of this entry

artweb design
Sven Fuchs
Grünberger Str. 65
10245 Berlin, Germany


http://www.artweb-design.de

Fon +49 (30) 47 98 69 96
Fax +49 (30) 47 98 69 97