Skip to content

Commit

Permalink
lab2023#2 Configure Middleman i18n
Browse files Browse the repository at this point in the history
 - i18n was enabled
 - Sign in and forgot password page's translations was added
  • Loading branch information
tayfunoziserikan committed Aug 12, 2013
1 parent da668bd commit 29bfd35
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
3 changes: 3 additions & 0 deletions config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
# end
# end

# i18n
activate :i18n

set :fonts_dir, 'assets/fonts'
set :css_dir, 'assets/stylesheets'
set :js_dir, 'assets/javascripts'
Expand Down
13 changes: 13 additions & 0 deletions locales/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
en:
login_heading: "Login to your account"
login_remember_me: "Remember me on this computer"
login_email: "Email address"
login_email_hint: "Enter your email address"
login_password: "Password"
forgot_password: "Forgot password?"
forgot_password_heading: "Reset your password"

sign_in: "Sign in"
sign_out: "Sign out"
send: "Send"
go_back: "Go back"
10 changes: 5 additions & 5 deletions source/forgot_password.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

.row
.col-lg-12
%h4
Reset your password
%h4=t(:forgot_password_heading)
%form
.form-group
%input.form-control{placeholder: 'Email address', type: 'text'}/
%label.control-label=t(:login_email)
%input.form-control{placeholder: t(:login_email_hint), type: 'text'}/

=link_to 'Send', 'index.html', class: 'btn btn-default'
=link_to 'Go back', 'index.html'
=link_to t(:send), 'index.html', class: 'btn btn-default'
=link_to t(:go_back), 'index.html'
13 changes: 6 additions & 7 deletions source/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@
Hierapolis
.row
.col-lg-12
%h4
Login to your account
%h4=t(:login_heading)
%form
.form-group
%input.form-control{placeholder: 'Email address', type: 'text'}/
%input.form-control{placeholder: t(:login_email), type: 'text'}/
.form-group
%input.form-control{placeholder: 'Password', type: 'password'}/
%input.form-control{placeholder: t(:login_password), type: 'password'}/
.text-center
.checkbox
%label
%input{:type => 'checkbox'}/
Remember me on this computer
=link_to 'Sign in', 'dashboard.html', class: 'btn btn-default'
=t(:login_remember_me)
=link_to t(:sign_in), 'dashboard.html', class: 'btn btn-default'
%br/
=link_to 'Forgot password?', 'forgot_password.html'
=link_to t(:forgot_password), 'forgot_password.html'

0 comments on commit 29bfd35

Please sign in to comment.