mirror of
https://github.com/tomgi/git_stats.git
synced 2024-11-16 08:38:34 +01:00
i18n added
This commit is contained in:
parent
9acd9cbfe9
commit
26d2df4e0a
6 changed files with 11 additions and 1 deletions
2
config/locales/en.yml
Normal file
2
config/locales/en.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
en:
|
||||||
|
project_name: Project name
|
|
@ -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')
|
||||||
|
|
|
@ -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) }
|
5
lib/git_stats/core_extensions/symbol.rb
Normal file
5
lib/git_stats/core_extensions/symbol.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
class Symbol
|
||||||
|
def t
|
||||||
|
I18n.t self
|
||||||
|
end
|
||||||
|
end
|
1
lib/git_stats/i18n.rb
Normal file
1
lib/git_stats/i18n.rb
Normal file
|
@ -0,0 +1 @@
|
||||||
|
I18n.load_path += Dir['config/locales/*.yml']
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue