Skip to content

Commit

Permalink
Merge pull request #625 from DuCalixte/master
Browse files Browse the repository at this point in the history
Create the translations for the creole languange examples - see 'example...
  • Loading branch information
mattwynne committed Feb 13, 2015
2 parents 01c1038 + b517f8b commit 9f349da
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/i18n/ht/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
features.html
6 changes: 6 additions & 0 deletions examples/i18n/ht/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$:.unshift(File.dirname(__FILE__) + '/../../../lib')
require 'cucumber/rake/task'

Cucumber::Rake::Task.new do |t|
t.cucumber_opts = %w{--format pretty}
end
17 changes: 17 additions & 0 deletions examples/i18n/ht/features/adisyon.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# language: ht
Karakteristik: Adisyon
   Nan lòd pou fè pou evite erè komik
   Kòm yon moun sòt nan matematik
   Mwen ta vle yo dim sòm total nan antre de nimero

Plan Senaryo: ajoute de nimero
Sipoze mwen te antre <input_1> nan kalkilatris la
Epi mwen te antre <input_2> nan kalkilatris la
Lè Mwen peze <button>
Rezilta a ta dwe <output> sou ekran an

Egzanp:
| input_1 | input_2 | button | output |
| 20 | 30 | ajoute | 50 |
| 2 | 5 | ajoute | 7 |
| 0 | 40 | ajoute | 40 |
10 changes: 10 additions & 0 deletions examples/i18n/ht/features/divizyon.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# language: ht
Karakteristik: Divizyon
   Nan lòd pou fè pou evite erè komik
   Kesye-a dwe kapab kalkile yon fraksyon

   Senaryo: nimewo regilye
     * Mwen te antre 3 nan kalkilatris la
     * Mwen te antre 2 nan kalkilatris la
     * Mwen peze divize
     * Rezilta a ta dwe 1.5 sou ekran an
25 changes: 25 additions & 0 deletions examples/i18n/ht/features/step_definitions/kalkilatris_steps.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# encoding: utf-8
begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end
require 'cucumber/formatter/unicode'
$:.unshift(File.dirname(__FILE__) + '/../../lib')
require 'kalkilatris'

Before do
@kalk = Kalkilatris.new
end

After do
end

Sipoze /Mwen te antre nan (\d+) nan kalkilatris la/ do |n|
@kalk.push n.to_i
end

/Mwen peze (\w+)/ do |op|
@result = @kalk.send op
end

sa a /Rezilta a ta dwe (.*) sou ekran an/ do |result|
@result.should == result.to_f
end
14 changes: 14 additions & 0 deletions examples/i18n/ht/lib/kalkilatris.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class Kalkilatris
def push(n)
@args ||= []
@args << n
end

def ajoute
@args.inject(0){|n,sum| sum+=n}
end

def divize
@args[0].to_f / @args[1].to_f
end
end

0 comments on commit 9f349da

Please sign in to comment.