i18n added

This commit is contained in:
Tomasz Gieniusz 2012-10-20 10:34:14 +02:00
parent 9acd9cbfe9
commit 26d2df4e0a
6 changed files with 11 additions and 1 deletions

2
config/locales/en.yml Normal file
View file

@ -0,0 +1,2 @@
en:
project_name: Project name

View file

@ -23,6 +23,7 @@ Gem::Specification.new do |gem|
gem.add_dependency('haml') gem.add_dependency('haml')
gem.add_dependency('launchy') gem.add_dependency('launchy')
gem.add_dependency('lazy_high_charts') gem.add_dependency('lazy_high_charts')
gem.add_dependency('i18n')
gem.add_development_dependency('rake') gem.add_development_dependency('rake')
gem.add_development_dependency('pry') gem.add_development_dependency('pry')

View file

@ -8,4 +8,5 @@ require 'fileutils'
require 'tilt' require 'tilt'
require 'lazy_high_charts' require 'lazy_high_charts'
require 'launchy' require 'launchy'
require 'i18n'
Dir['lib/**/*.rb'].each { |r| require File.expand_path(r) } Dir['lib/**/*.rb'].each { |r| require File.expand_path(r) }

View file

@ -0,0 +1,5 @@
class Symbol
def t
I18n.t self
end
end

1
lib/git_stats/i18n.rb Normal file
View file

@ -0,0 +1 @@
I18n.load_path += Dir['config/locales/*.yml']

View file

@ -1,6 +1,6 @@
%table{:class => "table table-hover table-bordered"} %table{:class => "table table-hover table-bordered"}
%tr %tr
%td Project name %td= :project_name.t
%td= repo.project_name %td= repo.project_name
%tr %tr
%td Project version %td Project version