Skip to content
molpe edited this page Sep 13, 2010 · 2 revisions

Adding a new language to Tog:

In the file vendor/plugins/tog_core/lib/tog_supported_languages.rb a line similar to this needs to be added:

:es => {:iso_639_1 => "es", :iso_639_2 => "spa", :name => "Spanish", :native_name => "Español" }

where “es” and “spa” needs to be replaced with the corresponding iso_639_1 and iso_639_2. Spanish is replaced with the English name of that language, whereas Español is replaced with the native name of the language.

Also you will have to add a translation of the locale files for each tog plugin found in vendor/plugin/tog_plugin_name/locale/*.yml

Changing the priority in which the language is set

The following method needs to be overriden in application.rb

def current_user_locale
    @current_user_locale ||= locale_from_session || locale_from_cookie || locale_from_browser || locale_from_settings
end