Hi All. When translating a string to in swedish, using HTML codes for å,ä,ö i have a minor problem. Eg: (se.yaml) ui_core_over: Över All I get when calling l(''ui_core_over'') in my view is "Ouml;ver" The leeding & is missing, making the page look silly. The HTML characters works fine as long as it''s not used as the first letter in the string. Anyone experienced this, and solved it? Regards // Jonas Montonen
Samuel Kvarnbrink
2005-Jul-04 18:38 UTC
Re: Localization problems with leeding html escaped ÅÄÖ
That''s because the ampersand has a special meaning in YAML (it defines anchors). If you place quotes (double or single) around the string, the data will be treated as a string literal and the problem won''t appear. But if you stick to the same encoding, preferably UTF-8, throughout your project and make sure that the content-type header is correct, you won''t have to mess with HTML characters in the first place :) Also, you may want to check out Sascha Ebach''s excellent manual on how to internationalize your apps using Gettext - it is an extremely elegant way of doing it: http://manuals.rubyonrails.com/read/chapter/82 //samuel Den 4 jul 2005 kl. 13.32 skrev Jonas Montonen:> Hi All. > > When translating a string to in swedish, using HTML codes for å,ä,ö > i have a minor problem. > Eg: (se.yaml) > ui_core_over: Över > > All I get when calling l(''ui_core_over'') in my view is "Ouml;ver" > The leeding & is missing, making the page look silly. > > The HTML characters works fine as long as it''s not used as the > first letter in the string. > > Anyone experienced this, and solved it? > Regards // Jonas Montonen > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________ Samuel Kvarnbrink mail: samuel.kvarnbrink-SiIintg/mUyhy6ZWzZ/+Cw@public.gmane.org blog: http://samuelk.info "I once had a problem. I thought: "Oh, I know: I''ll just use XML!" Now I had two problems."