Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update i18n setup, tests passing #237

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
dadb6a2
Adding sinatra-hat gem for i18n
colindean Mar 26, 2011
0f1c207
translations gems updates and rake tasks added
colindean Mar 27, 2011
330ae83
makemo is working, add en_US translation
colindean Mar 27, 2011
1b8e4a0
added stubbed EO translations, added fgt config
colindean Mar 27, 2011
33366c6
initial i18n support - let translations begin
colindean Mar 29, 2011
f903ab2
change the \- to a ~ to make updatepo happy
colindean Mar 29, 2011
8f068f5
latest strings
colindean Mar 29, 2011
688f0b2
move translation test to the acceptance directory
colindean Apr 7, 2011
66ab999
updated test
colindean Apr 7, 2011
eee149f
gemfile lock
colindean Apr 7, 2011
43afedc
fix accidental duplication of lines (merge artifact)
colindean Apr 8, 2011
6e64234
add a note to the README about translation deploy
colindean Apr 12, 2011
1c0cadd
Remember me feature
mrkcor Apr 6, 2011
d93aba5
Made username case insensitive
mrkcor Apr 7, 2011
0306ff4
report doesn't break on nil usernames
steveklabnik Apr 9, 2011
7c2e4ba
Added space validation to User#no_special_chars
mrkcor Apr 9, 2011
27c1771
Update readme with better warningg.
steveklabnik Apr 9, 2011
6724ebb
adding small warning to the /folow page
steveklabnik Apr 10, 2011
f68a38f
Switched require_relative statements to ensure the proper environment is
mrkcor Apr 10, 2011
19311ad
This is an innocent commit.
steveklabnik Apr 10, 2011
caf1322
Adding whitespace task and running it.
steveklabnik Apr 11, 2011
682d3f7
Let's move every configuration file into config/
steveklabnik Apr 11, 2011
fc98e5f
Big bunch of documentation.
steveklabnik Apr 12, 2011
3ff848b
updating readme to point at the new Issues
steveklabnik Apr 12, 2011
43cb7b4
one more link to the lighthouse gone
steveklabnik Apr 12, 2011
1bfba1d
updating link to the irc
steveklabnik Apr 12, 2011
8c4739e
initial i18n support - let translations begin
colindean Mar 29, 2011
01ea0a2
bloody Gemfile.lock
colindean Apr 8, 2011
1f9609e
html/@lang should be whatever locale we're using
colindean Apr 13, 2011
c6715e3
layouts all use FastGettext.locale for /html/@lang
colindean Apr 13, 2011
f476ea3
added more assertions, debug code commented out
colindean Apr 13, 2011
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ gem "compass"
gem "tzinfo"
gem "exceptional"

#i18n
gem "sinatra-hat"
gem "fast_gettext"
gem "rack-contrib", :require => 'rack/contrib'

group :development, :test do
gem "minitest", :platforms => :ruby_18
gem "minitest", :platforms => :ruby_18
gem "gettext"
gem 'coffee-script'
gem 'rack-test'
gem "database_cleaner"
Expand Down
102 changes: 56 additions & 46 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ GEM
Platform (>= 0.4.0)
open4
Platform (0.4.0)
activesupport (3.0.5)
activesupport (3.0.6)
addressable (2.2.4)
bcrypt-ruby (2.1.4)
bson (1.2.4)
bson_ext (1.2.4)
builder (2.1.2)
bson (1.3.0)
bson_ext (1.3.0)
capybara (0.4.1.2)
celerity (>= 0.7.9)
culerity (>= 0.2.4)
Expand All @@ -41,21 +40,23 @@ GEM
database_cleaner (0.6.6)
exceptional (2.0.32)
rack
execjs (0.1.0)
execjs (0.1.1)
factory_girl (1.3.3)
faraday (0.5.7)
faraday (0.6.0)
addressable (~> 2.2.4)
multipart-post (~> 1.1.0)
rack (< 2, >= 1.1.0)
faraday_middleware (0.3.2)
faraday (~> 0.5.4)
fb_graph (1.6.4)
faraday_middleware (0.6.3)
faraday (~> 0.6.0)
fast_gettext (0.5.11)
activesupport (>= 2.3)
json (>= 1.4.3)
oauth2 (>= 0.1.0)
restclient_with_cert
ffi (1.0.7)
rake (>= 0.8.7)
gettext (2.1.0)
locale (>= 2.0.5)
haml (3.0.25)
hashie (1.0.0)
i18n (0.5.0)
Expand All @@ -66,6 +67,8 @@ GEM
activesupport (>= 2.3.4)
json (1.5.1)
json_pure (1.5.1)
libxml-ruby (1.1.4)
locale (2.0.5)
mail (2.2.15)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
Expand All @@ -74,8 +77,8 @@ GEM
mime-types (1.16)
minitest (2.0.2)
mocha (0.9.12)
mongo (1.2.4)
bson (>= 1.2.4)
mongo (1.3.0)
bson (>= 1.3.0)
mongo_mapper (0.8.6)
activesupport (>= 2.3.4)
jnunemaker-validatable (~> 1.8.4)
Expand All @@ -88,64 +91,64 @@ GEM
multipart-post (1.1.0)
mustache (0.99.3)
net-ldap (0.1.1)
newrelic_rpm (2.14.0)
newrelic_rpm (2.14.1)
nokogiri (1.4.4)
oa-basic (0.2.0)
oa-basic (0.2.1)
multi_json (~> 0.0.2)
nokogiri (~> 1.4.2)
oa-core (= 0.2.0)
oa-core (= 0.2.1)
rest-client (~> 1.6.0)
oa-core (0.2.0)
oa-core (0.2.1)
rack (~> 1.1)
oa-enterprise (0.2.0)
oa-enterprise (0.2.1)
net-ldap (~> 0.1.1)
nokogiri (~> 1.4.2)
oa-core (= 0.2.0)
oa-core (= 0.2.1)
pyu-ruby-sasl (~> 0.0.3.1)
rubyntlm (~> 0.1.1)
oa-more (0.2.0)
oa-more (0.2.1)
multi_json (~> 0.0.2)
oa-core (= 0.2.0)
oa-core (= 0.2.1)
rest-client (~> 1.6.0)
oa-oauth (0.2.0)
oa-oauth (0.2.1)
multi_json (~> 0.0.2)
nokogiri (~> 1.4.2)
oa-core (= 0.2.0)
oa-core (= 0.2.1)
oauth (~> 0.4.0)
oauth2 (~> 0.1.1)
oa-openid (0.2.0)
oa-core (= 0.2.0)
oauth2 (~> 0.2.0)
oa-openid (0.2.1)
oa-core (= 0.2.1)
rack-openid (~> 1.2.0)
ruby-openid-apps-discovery
oauth (0.4.4)
oauth2 (0.1.1)
faraday (~> 0.5.0)
oauth2 (0.2.0)
faraday (~> 0.6.0)
multi_json (~> 0.0.4)
omniauth (0.2.0)
oa-basic (= 0.2.0)
oa-core (= 0.2.0)
oa-enterprise (= 0.2.0)
oa-more (= 0.2.0)
oa-oauth (= 0.2.0)
oa-openid (= 0.2.0)
omniauth (0.2.1)
oa-basic (= 0.2.1)
oa-core (= 0.2.1)
oa-enterprise (= 0.2.1)
oa-more (= 0.2.1)
oa-oauth (= 0.2.1)
oa-openid (= 0.2.1)
open4 (1.0.1)
opub (0.0.1)
ostatus (0.0.6)
nokogiri
ostatus (0.0.7)
oauth
tinyatom
osub (0.0.4)
ratom
osub (0.0.6)
ostatus
ruby-hmac
plucky (0.3.7)
mongo (~> 1.1)
polyglot (0.3.1)
pony (1.1)
mail (> 2.0)
public_suffix_service (0.8.2)
pygmentize (0.0.2)
pyu-ruby-sasl (0.0.3.2)
rack (1.2.2)
rack-contrib (1.1.0)
rack (>= 0.9.1)
rack-flash (0.1.1)
rack
rack-openid (1.2.0)
Expand All @@ -155,6 +158,10 @@ GEM
rack (>= 1.0)
rack-timeout (0.0.1)
rake (0.8.7)
rash (0.3.0)
hashie (~> 1.0.0)
ratom (0.6.7)
libxml-ruby (>= 1.1.2)
rdiscount (1.6.8)
redfinger (0.1.0)
hashie
Expand Down Expand Up @@ -186,26 +193,25 @@ GEM
tilt (< 2.0, >= 1.2.2)
sinatra-content-for (0.2)
sinatra
sinatra-hat (0.0.4)
sinatra-redirect-with-flash (0.1.2)
rack-flash (>= 0.1.1)
sinatra (>= 0.9.1)
tilt (1.2.2)
time-lord (0.1.5)
tinyatom (0.3.4)
builder (~> 2.0)
public_suffix_service (~> 0.0)
treetop (1.4.9)
polyglot (>= 0.3.1)
twitter (1.2.0)
faraday (~> 0.5.4)
faraday_middleware (~> 0.3.2)
twitter (1.3.0)
faraday (~> 0.6.0)
faraday_middleware (~> 0.6.3)
hashie (~> 1.0.0)
multi_json (~> 0.0.5)
multi_xml (~> 0.2.0)
rash (~> 0.3.0)
simple_oauth (~> 0.1.4)
tzinfo (0.3.25)
tzinfo (0.3.26)
uuidtools (2.1.2)
vcr (1.7.2)
vcr (1.8.0)
webmock (1.6.2)
addressable (>= 2.2.2)
crack (>= 0.1.7)
Expand All @@ -227,7 +233,9 @@ DEPENDENCIES
database_cleaner
exceptional
factory_girl
fast_gettext
fb_graph
gettext
haml
i18n
jammit
Expand All @@ -243,6 +251,7 @@ DEPENDENCIES
osub
pony
pygmentize
rack-contrib
rack-flash
rack-test
rack-timeout
Expand All @@ -254,6 +263,7 @@ DEPENDENCIES
sass
sinatra
sinatra-content-for
sinatra-hat
sinatra-redirect-with-flash
time-lord
twitter
Expand Down
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ If you'd like to contribute, here are some details:
- The stack: ruby/sinatra/mongodb
- [The code][code]
- [The documentation][docs] (need lots of improvement here!)
- [The Issues list][issues], currently being moved to lighthouse from
github.
- [The Issues list][issues]
- Please fork the project and make a pull request
- Pull requests will not be merged without tests/documentation
- We use [minitest][minitest]/[capybara][capy] for tests
Expand All @@ -21,7 +20,7 @@ If you'd like to contribute, here are some details:

[code]: http://github.com/hotsh/rstat.us
[docs]: http://hotsh.github.com/rstat.us/
[issues]: http://rstatus.lighthouseapp.com/
[issues]: http://github.com/hotsh/rstat.us/issues
[minitest]: https://github.com/seattlerb/minitest
[capy]: https://github.com/jnicklas/capybara
[docco]: https://github.com/jashkenas/docco
Expand All @@ -41,7 +40,7 @@ Then do:
Copy the config file; if you have actual Twitter API keys, you can add yours,
but this file just needs to exist for the server to work.

$ cp config.yml.sample config.yml
$ cp config/config.yml.sample config/config.yml

Then update your gemset:

Expand All @@ -52,7 +51,7 @@ And start the server:
$ rackup

Bam! Visit http://localhost:9292/ in your browser, and you'll be good.

[mongo-quickstart]: http://www.mongodb.org/display/DOCS/Quickstart

Compiling CSS and Javascript
Expand Down Expand Up @@ -83,9 +82,26 @@ jammit using yui compressor and closure compiler. Installing a JDK, such as
[coffee-install]: http://jashkenas.github.com/coffee-script/#installation
[openjdk]: http://openjdk.java.net/

Translations
------------

We use gettext for translations. Please contribute only if you have
a sufficient working knowledge of a language to do so.

To update the translations template file and each language's strings file, run
`rake updatepo`. To build each language's database after making changes to po
files, run `rake makemo`.

For now, you can commit your mo files in addition to po files.

Running your own node
---------------------

If you need help with this, then you're not ready to run one.
Here's the deal: we're still finishing up our ostatus implementation,
and until it's 100% compatible, these instructions are kept secret.
Eventually, we plan on making this _super easy_, but until we feel that
it's ready, we're keeping the instructions 'secret.' Sorry!

If you do run your own node anyway, please keep current with upstream
until we hit 1.0, and it should all be smooth sailing!
2 changes: 1 addition & 1 deletion config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require 'bundler/setup'
require File.dirname(__FILE__) + '/rstatus'

unless ENV['RACK_ENV'] == "production"
config = YAML.load_file('config.yml')[ENV['RACK_ENV']]
config = YAML.load_file('config/config.yml')[ENV['RACK_ENV']]

config.each do |key, value|
ENV[key] = value
Expand Down
14 changes: 9 additions & 5 deletions config.rb → config/config.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require_relative '../lib/rstatus/session'

class Rstatus
# The `PONY_VIA_OPTIONS` hash is used to configure `pony`. Basically, we only
# want to actually send mail if we're in the production environment. So we set
Expand Down Expand Up @@ -28,17 +30,17 @@ class Rstatus
# that we don't have to give it away in the source code. Heroku makes it really
# easy to keep environment variables set up, so this ends up being pretty nice.
# This also has to be included before rack-flash, or it blows up.
use Rack::Session::Cookie, :secret => ENV['COOKIE_SECRET']
use Rstatus::Session, :secret => ENV['COOKIE_SECRET']

# We're using rack-timeout to ensure that our dynos don't get starved by renegade
# processes.
use Rack::Timeout
Rack::Timeout.timeout = 10

set :root, File.dirname(__FILE__)
set :root, File.join(File.dirname(__FILE__), "..")
set :haml, :escape_html => true

# This method enables the ability for our forms to use the _method hack for
# This method enables the ability for our forms to use the _method hack for
# actual RESTful stuff.
set :method_override, true

Expand All @@ -56,11 +58,11 @@ class Rstatus
MongoMapper.database = "rstatus-#{settings.environment}"
end

Compass.add_project_configuration(File.join(File.dirname(__FILE__), 'config', 'compass.config'))
Compass.add_project_configuration(File.join(File.dirname(__FILE__), 'compass.config'))
MongoMapperExt.init

# now that we've connected to the db, let's load our models.
require_relative 'models/all'
require_relative '../models/all'
end

helpers Sinatra::UserHelper
Expand All @@ -78,4 +80,6 @@ class Rstatus
provider :twitter, ENV["CONSUMER_KEY"], ENV["CONSUMER_SECRET"]
provider :facebook, ENV["APP_ID"], ENV["APP_SECRET"], {:scope => 'publish_stream,offline_access,email'}
end

use Rack::Locale
end
File renamed without changes.