Skip to content

Czech language support fixed and improved#148

Merged
jlduran merged 5 commits intokslazarev:masterfrom
foton:master
Aug 9, 2017
Merged

Czech language support fixed and improved#148
jlduran merged 5 commits intokslazarev:masterfrom
foton:master

Conversation

@foton
Copy link
Copy Markdown
Contributor

@foton foton commented Aug 8, 2017

Continued on work from #123.

@foton foton changed the title Czexh language support fixed and improved Czech language support fixed and improved Aug 8, 2017
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.5%) to 99.73% when pulling 8e4fa66 on foton:master into 3355822 on kslazarev:master.

1 similar comment
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.5%) to 99.73% when pulling 8e4fa66 on foton:master into 3355822 on kslazarev:master.

@coveralls
Copy link
Copy Markdown

coveralls commented Aug 8, 2017

Coverage Status

Coverage decreased (-0.2%) to 99.016% when pulling 8e4fa66 on foton:master into 3355822 on kslazarev:master.

@coveralls
Copy link
Copy Markdown

coveralls commented Aug 8, 2017

Coverage Status

Coverage decreased (-0.2%) to 99.016% when pulling 8e4fa66 on foton:master into 3355822 on kslazarev:master.

Copy link
Copy Markdown
Collaborator

@jlduran jlduran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking the time to revisit this one.

I have made a few suggestions, once these are addressed, I will squash the commits and merge!

end
end

%i[megs thousands].each do |method_name|
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

megs is also defined below.

In order to achieve 100% coverage, the thousands method should be removed/tested.

end

it 'should pluralize correctly' do
@backend.send(:pluralize, :cs, @hash, 1).should eq('one')
Copy link
Copy Markdown
Collaborator

@jlduran jlduran Aug 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the new:expect syntax:

expect(@backend.send(:pluralize, :cs, @hash, 1)).to eq('one')

https://travis-ci.org/kslazarev/numbers_and_words/jobs/262259408#L197

@@ -0,0 +1,32 @@
to_words:
# simple_example:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please uncomment/remove these specs.

- jedno sto jedna
- dvacet jedna
- třináct
# complex_example_with_options:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please uncomment/remove these specs.

# - 0.31
# - 0.12
# :
# - nula celá jedna desetina
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess, with options: :remove_zero, this should be just jedna desetina.

@current_capacity ||= 0
# @current_capacity = order of block of 3 digits, backwards

case @current_capacity
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this case could be replaced with a multiple if statement, for instance:

if @current_capacity.zero?
  options.gender.result
elsif @current_capacity > 2 && @current_capacity.odd?
  :female
else
  :male
end

0.77: nula celých sedmdesát sedm setin
0.777: nula celých sedm set sedmdesát sedm tisícin
0.7777: nula celých sedm tisíc sedm set sedmdesát sedm desetitisícin
0.293517431: nula celých dvě stě devadesát tři milióny pět set sedmnáct tisíc čtyři sta třicet jedna miliardtina
Copy link
Copy Markdown
Collaborator

@jlduran jlduran Aug 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to get 100% coverage, we need a test like this, for example:

0.21021: nula celých dvacet jeden tisíc dvacet jedna stotisícina

https://travis-ci.org/kslazarev/numbers_and_words/jobs/262259408#L214

36: třicátá šestá
100: stá
999: devítistá devadesátá devátá

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this extra line.

t([options[:prefix], :hundreds, gender_to_use(options)].join('.'))[number]
end

def thousands(number, options = {})
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to achieve 100% coverage, this method should be removed/tested.

@dblock
Copy link
Copy Markdown
Collaborator

dblock commented Aug 8, 2017

@foton want to finish this?

@jlduran
Copy link
Copy Markdown
Collaborator

jlduran commented Aug 8, 2017

@dblock it's OK to merge as is. I can address the suggestions on the weekend.

@dblock
Copy link
Copy Markdown
Collaborator

dblock commented Aug 8, 2017

I see now, ignore me. I think the change requests should be addressed before merging.

@foton
Copy link
Copy Markdown
Contributor Author

foton commented Aug 9, 2017

I will fix it today

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.8%) to 100.0% when pulling b51284e on foton:master into 3355822 on kslazarev:master.

1 similar comment
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.8%) to 100.0% when pulling b51284e on foton:master into 3355822 on kslazarev:master.

@coveralls
Copy link
Copy Markdown

coveralls commented Aug 9, 2017

Coverage Status

Coverage increased (+0.07%) to 99.282% when pulling b51284e on foton:master into 3355822 on kslazarev:master.

@foton
Copy link
Copy Markdown
Contributor Author

foton commented Aug 9, 2017

Fixed and coverage is back to 100%.

@jlduran
Copy link
Copy Markdown
Collaborator

jlduran commented Aug 9, 2017

Thank you @foton!

@jlduran jlduran merged commit 20a8ade into kslazarev:master Aug 9, 2017
@jlduran
Copy link
Copy Markdown
Collaborator

jlduran commented Aug 9, 2017

Closes #123

@jlduran jlduran mentioned this pull request Aug 9, 2017
jlduran added a commit that referenced this pull request Aug 14, 2017
Release 0.11.2 (August 14, 2017)

- Add full support for Czech language. [#148]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants