r18n-desktop 0.1.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -31,14 +31,6 @@ Spec::Rake::SpecTask.new('specs_html') do |t|
31
31
  t.spec_files = Dir['spec/**/*_spec.rb'].sort
32
32
  end
33
33
 
34
- desc 'RCov'
35
- Spec::Rake::SpecTask.new('rcov') do |t|
36
- t.spec_opts = ['--format', 'specdoc', '--colour']
37
- t.spec_files = Dir['spec/**/*_spec.rb'].sort
38
- t.libs = ['lib']
39
- t.rcov = true
40
- end
41
-
42
34
  ##############################################################################
43
35
  # Documentation and distribution
44
36
  ##############################################################################
data/lib/r18n-desktop.rb CHANGED
@@ -37,7 +37,7 @@ module R18n
37
37
  # information and translations from +translations_dir+. If user set locale
38
38
  # +manual+ put it as last argument.
39
39
  def from_env(translations_dir, manual = nil)
40
- locales = R18n::I18n.system_locale
40
+ locales = Array(R18n::I18n.system_locale)
41
41
  locales.insert(0, manual) if not manual.nil?
42
42
  self.set I18n.new(locales, translations_dir)
43
43
  end
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
  module R18n
21
21
  class I18n
22
22
  def self.system_locale
23
- ENV['LANG'].split('.').first.to_a
23
+ ENV['LANG'].split('.').first
24
24
  end
25
25
  end
26
26
  end
@@ -3,24 +3,18 @@ require File.join(File.dirname(__FILE__), 'spec_helper')
3
3
  describe "r18n-desktop" do
4
4
 
5
5
  it "should return array of system locales" do
6
- locales = R18n::I18n.system_locale
7
- locales.class.should == Array
8
- locales.should_not be_empty
9
- locales.each do |locale|
10
- locale.class.should == String
11
- locale.should_not be_empty
12
- end
6
+ locale = R18n::I18n.system_locale
7
+ locale.class.should == String
8
+ locale.should_not be_empty
13
9
  end
14
10
 
15
11
  it "should load I18n from system environment" do
16
12
  i18n = R18n.from_env('')
17
13
  i18n.class.should == R18n::I18n
18
- if R18n::Locale != i18n.locale.class
19
- i18n.locale.should_not be_empty
20
- end
14
+ i18n.locale.should_not be_empty if String == i18n.locale.class
21
15
 
22
16
  i18n = R18n.from_env('', 'en')
23
- i18n.locale.should == R18n::Locale.new('en')
17
+ i18n.locale.should == R18n::Locale.load('en')
24
18
 
25
19
  R18n.get.should == i18n
26
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r18n-desktop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: "0.2"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey "A.I." Sitnik
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-23 00:00:00 +03:00
12
+ date: 2008-12-06 00:00:00 +03:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - "="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.1.1
23
+ version: "0.2"
24
24
  version:
25
25
  description: A tool to translate your desktop application in several languages. It is just a wrap for R18n core library. It can format numbers and time to the rules of the user locale, has translation for common words, storage translation in YAML format with pluralization and procedures and has special support for countries with two official languages.
26
26
  email: andrey@sitnik.ru