<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>app/helpers/click_to_globalize_helper.rb</filename>
    </added>
    <added>
      <filename>test/unit/helpers/click_to_globalize_helper_test.rb</filename>
    </added>
    <added>
      <filename>test/unit/helpers/locales_helper_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,2 +1,29 @@
 module LocalesHelper
+  # Return all available locales from I18n, except &lt;tt&gt;:root&lt;/tt&gt;.
+  def locales
+    I18n.available_locales - [ :root ]
+  end
+
+  # Creates the HTML markup for the languages picker menu.
+  #
+  # Example:
+  # I18n.available_locales # =&gt; [:root, :en, :it]
+  # I18n.locale            # =&gt; :en
+  #
+  #   &lt;ul&gt;
+  #     &lt;li&gt;&lt;a href=&quot;/locales/en/change&quot; title=&quot;* en&quot;&gt;* en&lt;/a&gt;&lt;/li&gt; |
+  #     &lt;li&gt;&lt;a href=&quot;/locales/it/change&quot; title=&quot;it&quot;&gt;it&lt;/a&gt;&lt;/li&gt;
+  #   &lt;/ul&gt;
+  def locales_menu
+    returning html = &quot;&quot; do
+      html &lt;&lt; content_tag(:ul) do
+        locales.map do |locale|
+          title = locale == I18n.locale ? &quot;* #{h(locale)}&quot; : h(locale)
+          content_tag(:li) do
+            link_to title, change_locale_path(locale), :title =&gt; title, :method =&gt; :put
+          end
+        end * &quot; | &quot;
+      end
+    end
+  end
 end</diff>
      <filename>app/helpers/locales_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,5 +7,4 @@ end
 
 ActionView::Base.class_eval do
   include Click::Observer::View
-  include Click::Helper
 end</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -93,43 +93,4 @@ module Click
       end
     end
   end
-
-  module Helper
-    @@click_partial = 'shared/_click_to_globalize'
-
-    # Render +app/views/shared/_click_to_globalize.html.erb+.
-    def click_to_globalize
-      render @@click_partial if controller.globalize?
-    end
-
-    # Get form_authenticity_token if the application is protected from forgery.
-    # See ActionController::RequestForgeryProtection for details.
-    def authenticity_token
-      protect_against_forgery? ? form_authenticity_token : ''
-    end
-
-    def locales
-      I18n.available_locales
-    end
-
-    # Creates the HTML markup for the languages picker menu.
-    #
-    # Example:
-    # I18n.available_locales # =&gt; [:en, :it]
-    # I18n.locale            # =&gt; :en
-    #
-    #   &lt;ul&gt;
-    #     &lt;li&gt;&lt;a href=&quot;/locales/set/en&quot; title=&quot;* en&quot;&gt;* en&lt;/a&gt;&lt;/li&gt; |
-    #     &lt;li&gt;&lt;a href=&quot;/locales/set/it&quot; title=&quot;it&quot;&gt;it&lt;/a&gt;&lt;/li&gt;
-    #   &lt;/ul&gt;
-    def languages_menu
-      returning result = '&lt;ul&gt;' do
-        result &lt;&lt; locales.map do |locale|
-          locale = &quot;* #{locale}&quot; if locale == I18n.locale
-          &quot;&lt;li&gt;#{link_to locale, {:controller =&gt; 'locales', :action =&gt; 'set', :id =&gt; locale}, {:title =&gt; &quot;#{language} [#{locale}]&quot;}}&lt;/li&gt;&quot;
-        end * ' | '
-      end
-      result &lt;&lt; '&lt;/ul&gt;'
-    end
-  end
 end</diff>
      <filename>lib/click_to_globalize.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,4 +12,17 @@ class ActiveSupport::TestCase
     def locale_observer
       @locale_observer ||= Click::Observer::LocaleObserver.new
     end
-end
\ No newline at end of file
+end
+
+class ActionView::TestCase
+  private
+    # HACK this is a placehoder, dunno why it isn't included by default
+    def protect_against_forgery?
+      false
+    end
+
+    # HACK this is a placehoder, dunno why it isn't included by default
+    def form_authenticity_token
+      &quot;hack&quot;
+    end
+end</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>test/unit/helpers/helper_test.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>89018d89ecb0f07efa05048cc859447d341431e0</id>
    </parent>
  </parents>
  <author>
    <name>Luca Guidi</name>
    <email>guidi.luca@gmail.com</email>
  </author>
  <url>http://github.com/jodosha/click-to-globalize/commit/960fc809e96aeff5b56fba2d40f98aed60cf6129</url>
  <id>960fc809e96aeff5b56fba2d40f98aed60cf6129</id>
  <committed-date>2009-04-06T04:22:13-07:00</committed-date>
  <authored-date>2009-04-06T04:22:13-07:00</authored-date>
  <message>Extracted some code into proper helpers</message>
  <tree>7d3af6d29b261748f3794f6e026ef308f021ea06</tree>
  <committer>
    <name>Luca Guidi</name>
    <email>guidi.luca@gmail.com</email>
  </committer>
</commit>
