Permalink
Browse files

Improved i18n; Added language links to header.

  • Loading branch information...
1 parent 5aa092f commit fd14837b0e476c6f6944d47c5b6fa6df6dc67d54 @recurser committed Oct 15, 2010
View
@@ -6,7 +6,6 @@ gem 'formtastic', '1.1.0'
gem 'haml', '3.0.18'
gem 'hpricot', '0.8.2'
gem 'i18n', '0.4.1'
-gem 'i18n_routing', '0.4.3'
gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
gem 'rails', '3.0.0'
gem 'will_paginate', :git => 'http://github.com/mislav/will_paginate.git', :branch => 'rails3'
View
@@ -91,8 +91,6 @@ GEM
rubyforge (>= 2.0.4)
hpricot (0.8.2)
i18n (0.4.1)
- i18n_routing (0.4.3)
- i18n (> 0.3.5)
jammit (0.5.3)
closure-compiler (>= 0.1.0)
yui-compressor (>= 0.9.1)
@@ -203,7 +201,6 @@ DEPENDENCIES
haml (= 3.0.18)
hpricot (= 0.8.2)
i18n (= 0.4.1)
- i18n_routing (= 0.4.3)
jammit (= 0.5.3)
metric_fu (= 1.5.1)
rails (= 3.0.0)
@@ -16,4 +16,8 @@ def body_id
"#{controller_name}_#{action_name}"
end
+ def locale
+ I18n.locale.to_s
+ end
+
end
@@ -16,6 +16,10 @@ header
line-height: 3em
list-style: none
+ &#english_tab,
+ &#french_tab
+ float: right
+
ul
width: 100%
overflow: hidden
@@ -33,13 +37,13 @@ header
&:hover
color: $header_link_hover
-body#pages_home header a#home_tab,
-body#pages_about header a#about_tab,
-body#contacts_new header a#contact_tab,
-body#users_index header a#users_tab,
-body#registrations_edit header a#profile_tab,
-body#sessions_new header a#sign_in_tab,
-body#registrations_new header a#sign_up_tab
+body#pages_home header li#home_tab a,
+body#pages_about header li#about_tab a,
+body#contacts_new header li#contact_tab a,
+body#users_index header li#users_tab a,
+body#registrations_edit header li#profile_tab a,
+body#sessions_new header li#sign_in_tab a,
+body#registrations_new header li#sign_up_tab a
//text-decoration: underline
color: $text
@@ -1,15 +1,19 @@
%header#header
%nav
%ul
- %li= link_to t('common.header_link.home'), root_path, :id => 'home_tab'
- %li= link_to t('common.header_link.about'), about_path, :id => 'about_tab'
- %li= link_to t('common.header_link.contact'), contact_path, :id => 'contact_tab'
+ %li#home_tab= link_to t('common.header_link.home'), root_path
+ %li#about_tab= link_to t('common.header_link.about'), about_path
+ %li#contact_tab= link_to t('common.header_link.contact'), contact_path
- if user_signed_in?
- if can?(:read, User)
- %li= link_to t('common.header_link.users'), users_path, :id => 'users_tab'
- %li= link_to t('common.header_link.profile'), edit_user_registration_path, :id => 'profile_tab'
- %li= link_to t('common.header_link.sign_out'), destroy_user_session_path, :id => 'sign_out_tab'
+ %li#users_tab= link_to t('common.header_link.users'), users_path
+ %li#profile_tab= link_to t('common.header_link.profile'), edit_user_registration_path
+ %li#sign_out_tab= link_to t('common.header_link.sign_out'), destroy_user_session_path
- else
- %li= link_to t('common.header_link.sign_in'), new_user_session_path, :id => 'sign_in_tab'
- %li= link_to t('common.header_link.sign_up'), new_user_registration_path, :id => 'sign_up_tab'
+ %li#sign_in_tab= link_to t('common.header_link.sign_in'), new_user_session_path
+ %li#sign_up_tab= link_to t('common.header_link.sign_up'), new_user_registration_path
+ - unless locale.eql? 'fr'
+ %li#french_tab= link_to t('common.header_link.french'), '/fr'
+ - unless locale.eql? 'en'
+ %li#english_tab= link_to t('common.header_link.english'), '/en'
@@ -12,6 +12,8 @@ en:
sign_up: "Sign Up"
sign_in: "Sign In"
sign_out: "Sign Out"
+ english: "English"
+ french: "Francais"
footer_copyright_message: "Copyright 2010"
footer_copyright_link: "Recursive Design"
@@ -13,6 +13,8 @@ fr:
sign_up: "Inscrivez-vous"
sign_in: "Identifiez-vous"
sign_out: "Inscrivez-Out"
+ english: "English"
+ french: "Francais"
footer_copyright_message: "Copyright 2010"
footer_copyright_link: "Recursive Design"
View
@@ -6,10 +6,10 @@
devise_for :users, :path => '/account'
match '/:locale/contact', :to => 'contacts#new'
- match '/contact', :to => 'contacts#new'
+ match '/contact', :to => 'contacts#new'
match '/:locale/about', :to => 'pages#about'
- match '/about', :to => 'pages#about'
+ match '/about', :to => 'pages#about'
match '/:locale' => 'pages#home'
root :to => 'pages#home'
View
@@ -1,4 +1,6 @@
General:
+- Flash messages instead of red boxes for form errors (?)
+- Error messages for signup etc need translation
- Don't allow users to edit or delete themselves
- Add instructions on contact page - mails will not be read, test only, visit recursive contact page with suggestions
- Add user/pass instructions + rebuild timeline info to login page
@@ -15,6 +15,10 @@ header li {
list-style: none;
}
/* line 19, ../../../app/stylesheets/common/header.sass */
+header li#english_tab, header li#french_tab {
+ float: right;
+}
+/* line 23, ../../../app/stylesheets/common/header.sass */
header ul {
width: 100%;
overflow: hidden;
@@ -24,27 +28,27 @@ header ul {
margin-right: auto;
width: 960px;
}
-/* line 26, ../../../app/stylesheets/common/header.sass */
+/* line 30, ../../../app/stylesheets/common/header.sass */
header a {
font-size: 1.1em;
color: #428edb;
}
-/* line 30, ../../../app/stylesheets/common/header.sass */
+/* line 34, ../../../app/stylesheets/common/header.sass */
header a:visited {
color: #428edb;
}
-/* line 33, ../../../app/stylesheets/common/header.sass */
+/* line 37, ../../../app/stylesheets/common/header.sass */
header a:hover {
color: #428edb;
}
-/* line 36, ../../../app/stylesheets/common/header.sass */
-body#pages_home header a#home_tab,
-body#pages_about header a#about_tab,
-body#contacts_new header a#contact_tab,
-body#users_index header a#users_tab,
-body#registrations_edit header a#profile_tab,
-body#sessions_new header a#sign_in_tab,
-body#registrations_new header a#sign_up_tab {
+/* line 40, ../../../app/stylesheets/common/header.sass */
+body#pages_home header li#home_tab a,
+body#pages_about header li#about_tab a,
+body#contacts_new header li#contact_tab a,
+body#users_index header li#users_tab a,
+body#registrations_edit header li#profile_tab a,
+body#sessions_new header li#sign_in_tab a,
+body#registrations_new header li#sign_up_tab a {
color: #222222;
}
@@ -671,6 +671,10 @@ header li {
list-style: none;
}
/* line 19, ../../app/stylesheets/common/header.sass */
+header li#english_tab, header li#french_tab {
+ float: right;
+}
+/* line 23, ../../app/stylesheets/common/header.sass */
header ul {
width: 100%;
overflow: hidden;
@@ -680,28 +684,28 @@ header ul {
margin-right: auto;
width: 960px;
}
-/* line 26, ../../app/stylesheets/common/header.sass */
+/* line 30, ../../app/stylesheets/common/header.sass */
header a {
font-size: 1.1em;
color: #428edb;
}
-/* line 30, ../../app/stylesheets/common/header.sass */
+/* line 34, ../../app/stylesheets/common/header.sass */
header a:visited {
color: #428edb;
}
-/* line 33, ../../app/stylesheets/common/header.sass */
+/* line 37, ../../app/stylesheets/common/header.sass */
header a:hover {
color: #428edb;
}
-/* line 36, ../../app/stylesheets/common/header.sass */
-body#pages_home header a#home_tab,
-body#pages_about header a#about_tab,
-body#contacts_new header a#contact_tab,
-body#users_index header a#users_tab,
-body#registrations_edit header a#profile_tab,
-body#sessions_new header a#sign_in_tab,
-body#registrations_new header a#sign_up_tab {
+/* line 40, ../../app/stylesheets/common/header.sass */
+body#pages_home header li#home_tab a,
+body#pages_about header li#about_tab a,
+body#contacts_new header li#contact_tab a,
+body#users_index header li#users_tab a,
+body#registrations_edit header li#profile_tab a,
+body#sessions_new header li#sign_in_tab a,
+body#registrations_new header li#sign_up_tab a {
color: #222222;
}

0 comments on commit fd14837

Please sign in to comment.