From bdea4772b3f96e84c11ccf6b7791f241ecadba74 Mon Sep 17 00:00:00 2001 From: Cleiton Francisco Date: Fri, 20 Aug 2010 09:14:06 -0300 Subject: [PATCH] Footer and Locale --- locales/en.yml | 8 ++++++++ locales/pt.yml | 8 ++++++++ public/stylesheets/style.css | 23 +++++++++++++++++++++-- twifakes.rb | 8 ++++++++ views/index.erb | 15 ++++++++++----- 5 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 locales/en.yml create mode 100644 locales/pt.yml diff --git a/locales/en.yml b/locales/en.yml new file mode 100644 index 0000000..b6c4f14 --- /dev/null +++ b/locales/en.yml @@ -0,0 +1,8 @@ +index: + title: How many fakes follow you? + button: Calculate + footer: + message: !!html + Twifakes uses OAuth for Authentication. This is designed to protect your account. You will be redirected to Twitter and asked to allow the Twifakes Application. Simply click Allow to use Twifakes. We promise not to misuse or abuse your account. + locale: !!html + Change language to Portuguese diff --git a/locales/pt.yml b/locales/pt.yml new file mode 100644 index 0000000..83f9f88 --- /dev/null +++ b/locales/pt.yml @@ -0,0 +1,8 @@ +index: + title: Quantos fakes seguem você? + button: Calcular + footer: + message: !!html + Para proteger sua conta o Twifakes usa OAuth na Autenticação. Você será redirecionado para o Twitter que perguntará se você dar permissão à aplicação Twifakes. Simplesmente clique em "Allow" para usar o Twifakes. Prometemos não fazer uso indevido ou abusar da sua conta. + locale: !!html + Mudar idioma para Inglês diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index 2ccf420..cf34256 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -14,7 +14,7 @@ html, body { body { background:#e5e5e5 url("/images/bg.gif") repeat-x; font:88%/1.4em Arial, sans-serif; - color:#555; + color:#888; text-align:center; } header, section, footer { @@ -22,7 +22,9 @@ header, section, footer { } #wrapper { background:url("/images/bg-point.jpg") center top no-repeat; - height:100%; + height:auto !important; + margin-bottom:-100px; + min-height:100%; } header { height:180px; @@ -70,4 +72,21 @@ header h1 { text-shadow:none; height:59px; padding:1px 59px 0 61px; +} +#stick { + height:100px; + padding-bottom:1em; +} +footer { + height:100px; + width:900px; + margin:0 auto; + font-size:0.9em; +} +footer a { + color:#656565; +} +#locale { + margin-top:10px; + font-size:0.9em; } \ No newline at end of file diff --git a/twifakes.rb b/twifakes.rb index 49dac9f..589ea36 100644 --- a/twifakes.rb +++ b/twifakes.rb @@ -2,6 +2,14 @@ require 'sinatra' require 'yaml' require 'twitter_oauth' +require 'sinatra/r18n' + +set :default_locale, 'en' +set :translations, './locales' + +before do + session[:locale] = params[:locale] || "en" +end get "/" do erb :index diff --git a/views/index.erb b/views/index.erb index 1f36bf0..8df24e6 100644 --- a/views/index.erb +++ b/views/index.erb @@ -1,11 +1,11 @@ - + - How many fakes follow you? | Twifakes + <%= r18n.index.title %> | Twifakes @@ -30,11 +30,16 @@
-

How many fakes follow you?

-

Calculate

+

<%= r18n.index.title %>

+

<%= r18n.index.button %>

+ +
- +