Skip to content

Commit

Permalink
Status message follow the language
Browse files Browse the repository at this point in the history
  • Loading branch information
cleitonfco committed Aug 20, 2010
1 parent 19e1a50 commit c57375c
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 40 deletions.
30 changes: 15 additions & 15 deletions locales/en.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
index:
title: How many fakes follow you?
button: Calculate
followers: You have %1 fake followers
info: !!html
We don't store their data, <a href="/images/heroku.png">our Heroku account not using storage space</a>.
retweet: !!html
<a href="/tweet">Tweet this</a>
footer:
message: !!html
Twifakes uses <a href="http://en.wikipedia.org/wiki/OAuth" target="_blank">OAuth</a> 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 <a href="?locale=pt">Portuguese</a>
credit: !!html
Twifakes is a <a href="http://github.com/gurupi/twifakes">open source</a> application
title: How many fakes follow you?
button: Calculate
followers: You have %1 fake followers
message: "I have %1 fake followers, and you? http://twifakes.heroku.com/ #Twifakes"
info: !!html
We don't store their data, <a href="/images/heroku.png">our Heroku account not using storage space</a>.
retweet: !!html
<a href="/tweet">Tweet this</a>
footer:
message: !!html
Twifakes uses <a href="http://en.wikipedia.org/wiki/OAuth" target="_blank">OAuth</a> 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 <a href="?locale=pt">Portuguese</a>
credit: !!html
Twifakes is a <a href="http://github.com/gurupi/twifakes">open source</a> application
30 changes: 15 additions & 15 deletions locales/pt.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
index:
title: Quantos fakes seguem você?
button: Calcular
followers: Você tem %1 seguidores fake
info: !!html
Nós não armazenamos seus dados, <a href="/images/heroku.png">nossa conta no Heroku não está utilizando espaço para armazenamento</a>.
retweet: !!html
<a href="/tweet">Envie um Tweet</a>
footer:
message: !!html
Para proteger sua conta o Twifakes usa <a href="http://en.wikipedia.org/wiki/OAuth" target="_blank">OAuth</a> 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 <a href="?locale=en">Inglês</a>
credit: !!html
Twifakes é uma aplicação <a href="http://github.com/gurupi/twifakes">open source</a>
title: Quantos fakes seguem você?
button: Calcular
followers: Você tem %1 seguidores fake
message: "Eu tenho %1 seguidores fake, e você? http://twifakes.heroku.com/ #Twifakes"
info: !!html
Nós não armazenamos seus dados, <a href="/images/heroku.png">nossa conta no Heroku não está utilizando espaço para armazenamento</a>.
retweet: !!html
<a href="/tweet">Envie um Tweet</a>
footer:
message: !!html
Para proteger sua conta o Twifakes usa <a href="http://en.wikipedia.org/wiki/OAuth" target="_blank">OAuth</a> 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 <a href="?locale=en">Inglês</a>
credit: !!html
Twifakes é uma aplicação <a href="http://github.com/gurupi/twifakes">open source</a>
3 changes: 2 additions & 1 deletion twifakes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@
end

get "/tweet" do
status = t.message(@fakes)
client = TwitterOAuth::Client.new(:consumer_key => ENV["CONSUMER_KEY"], :consumer_secret => ENV["CONSUMER_SECRET"])
session[:access_token] = client.authorize(session[:request_token], session[:request_token_secret], :oauth_verifier => session[:oauth_verifier])
@fakes = (client.info["followers_count"].to_i/12).to_i
client.update("I have #{(@fakes).to_i} fake followers, and you? http://twifakes.heroku.com/ #Twifakes") if client.authorized?
client.update(status) if client.authorized?
redirect "/?s=ok"
end
6 changes: 3 additions & 3 deletions views/index.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<h1><%= r18n.index.title %></h1>
<p id="calculate"><a href="/connect"><%= r18n.index.button %></a></p>
<p class="info"><%= r18n.index.info %></p>
<h1><%= r18n.title %></h1>
<p id="calculate"><a href="/connect"><%= r18n.button %></a></p>
<p class="info"><%= r18n.info %></p>
6 changes: 3 additions & 3 deletions views/layout.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="description" content="How many fakes follow you?" />
<meta name="keywords" content="Twitter, Fakes, Joke, Calculate, Twitter Fakes, Twitter service" />
<link rel="stylesheet" media="screen" href="/stylesheets/style.css" />
<title><%= r18n.index.title %> | Twifakes</title>
<title><%= r18n.title %> | Twifakes</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
Expand Down Expand Up @@ -37,8 +37,8 @@
</section>

<footer>
<p id="message"><%= r18n.index.footer.message %></p>
<p id="locale"><%= r18n.index.footer.credit %> - <%= r18n.index.footer.locale %></p>
<p id="message"><%= r18n.footer.message %></p>
<p id="locale"><%= r18n.footer.credit %> - <%= r18n.footer.locale %></p>
</footer>
</body>
</html>
6 changes: 3 additions & 3 deletions views/show.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<h1><%= r18n.index.followers(@fakes) %></h1>
<p id="retweet"><%= r18n.index.retweet %></p>
<p class="info"><%= r18n.index.info %></p>
<h1><%= r18n.followers(@fakes) %></h1>
<p id="retweet"><%= r18n.retweet %></p>
<p class="info"><%= r18n.info %></p>

0 comments on commit c57375c

Please sign in to comment.