<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;h2&gt;Adding a new language to Tog:&lt;/h2&gt;
&lt;p&gt;In the file vendor/plugins/tog_core/lib/tog_supported_languages.rb a line similar to this needs to be added:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
:es =&amp;gt; {:iso_639_1 =&amp;gt; &quot;es&quot;, :iso_639_2 =&amp;gt; &quot;spa&quot;, :name =&amp;gt; &quot;Spanish&quot;, :native_name =&amp;gt; &quot;Espa&#241;ol&quot; }
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;where &amp;#8220;es&amp;#8221; and &amp;#8220;spa&amp;#8221; 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&#241;ol is replaced with the native name of the language.&lt;/p&gt;
&lt;p&gt;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&lt;/p&gt;
&lt;h2&gt;Changing the priority in which the language is set&lt;/h2&gt;
&lt;p&gt;The following method needs to be overriden in application.rb&lt;/p&gt;
&lt;pre&gt;
def current_user_locale
    @current_user_locale ||= locale_from_session || locale_from_cookie || locale_from_browser || locale_from_settings
end
&lt;/pre&gt;</body>
  <created-at type="datetime">2009-11-26T00:45:02-08:00</created-at>
  <id type="integer">310647</id>
  <permalink>language-selector</permalink>
  <repository-id type="integer">44552</repository-id>
  <title>Language Selector</title>
  <updated-at type="datetime">2009-08-31T09:30:12-07:00</updated-at>
  <user-id type="integer">7792</user-id>
</wiki>
