Multiple languages
As the summary says: multiple languages. Maybe a default set by the admin, and a user configurable setting in the preferences? That would be great..
Leave a comment
I could help with this. I've already patched my instalation to support Russian via utf-8. This works in Mysql , not sure about sqlite. I've also managed to get everything work in Safari. (Firefox woked fine from the start)
So. You need to
1. Add encoding: UTF8 after each of configurations (or just in the production ) in your database.yml
2. Add
I'm not pretty sure that the both filters a absolute requirenment - but they work for me )
P.S. I could implement the full multi-lang support -I just need to know what is expected besides the interface translations.
So. You need to
1. Add encoding: UTF8 after each of configurations (or just in the production ) in your database.yml
2. Add
$KCODE = 'u'
require 'jcode'
}}} in the begining of enivonment.rb
3. And the last thing - add the following piece of code in the application_controller.rb
{{{
after_filter :fix_unicode_for_safari
# automatically and transparently fixes utf-8 bug
# with Safari when using xmlhttp
def fix_unicode_for_safari
if @headers["Content-Type"] == "text/javascript" and
@request.env['HTTP_USER_AGENT'].to_s.include? 'AppleWebKit' and request.xhr?
@response.body = @response.body.gsub(/([^\x00-\xa0])/u) { |s| "&#x%x;" % $1.unpack('U')[0] }
end
end
after_filter :set_charset
def set_charset
content_type = @headers["Content-Type"] || 'text/html'
if /^text\//.match(content_type)
@headers["Content-Type"] = "#{content_type}; charset=utf-8"
end
end
I'm not pretty sure that the both filters a absolute requirenment - but they work for me )
P.S. I could implement the full multi-lang support -I just need to know what is expected besides the interface translations.
Strange - wiki formatting failed (
I'll repost
I could help with this. I've already patched my instalation to support Russian via utf-8. This works in Mysql , not sure about sqlite. I've also managed to get everything work in Safari. (Firefox woked fine from the start)
So. You need to
1. Add encoding: UTF8 after each of configurations (or just in the production ) in your database.yml
2. Add
-----
$KCODE = 'u'
require 'jcode'
-----
in the begining of enivonment.rb
3. And the last thing - add the following piece of code in the application_controller.rb
I'm not pretty sure that the both filters a absolute requirenment - but they work for me )
P.S. I could implement the full multi-lang support -I just need to know what is expected besides the interface translations.
I'll repost
I could help with this. I've already patched my instalation to support Russian via utf-8. This works in Mysql , not sure about sqlite. I've also managed to get everything work in Safari. (Firefox woked fine from the start)
So. You need to
1. Add encoding: UTF8 after each of configurations (or just in the production ) in your database.yml
2. Add
-----
$KCODE = 'u'
require 'jcode'
-----
in the begining of enivonment.rb
3. And the last thing - add the following piece of code in the application_controller.rb
after_filter :fix_unicode_for_safari
# automatically and transparently fixes utf-8 bug
# with Safari when using xmlhttp
def fix_unicode_for_safari
if @headers["Content-Type"] == "text/javascript" and
@request.env['HTTP_USER_AGENT'].to_s.include? 'AppleWebKit' and request.xhr?
@response.body = @response.body.gsub(/([^\x00-\xa0])/u) { |s| "&#x%x;" % $1.unpack('U')[0] }
end
end
after_filter :set_charset
def set_charset
content_type = @headers["Content-Type"] || 'text/html'
if /^text\//.match(content_type)
@headers["Content-Type"] = "#{content_type}; charset=utf-8"
end
end
I'm not pretty sure that the both filters a absolute requirenment - but they work for me )
P.S. I could implement the full multi-lang support -I just need to know what is expected besides the interface translations.