Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Serbian (Latin) #207

Merged
merged 9 commits into from Nov 10, 2018
Merged

Conversation

fatkaratekid
Copy link
Contributor

@fatkaratekid fatkaratekid commented Oct 8, 2018

Changes proposed in this pull request:

Add support for Serbian (Latin)
Adds support for local currency RSD, EUR and RUB

Status

  • READY
  • HOLD
  • WIP (Work-In-Progress)

How to verify this change

Just run the tests.
I included tests for RUB, EUR and RSD.
Tried to cover all the possible case combinations (in grammar sense) and plural form changes.

Additional notes

The ordinal numbers have not been implemented yet.

Used the long scale name instead of the short one. Simplified the scale and the ones geneder definition.
@coveralls
Copy link

coveralls commented Oct 8, 2018

Pull Request Test Coverage Report for Build 483

  • 66 of 70 (94.29%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 89.552%

Changes Missing Coverage Covered Lines Changed/Added Lines %
num2words/lang_SR.py 65 69 94.2%
Totals Coverage Status
Change from base Build 478: 0.03%
Covered Lines: 660
Relevant Lines: 737

💛 - Coveralls

Copy link
Contributor

@shulcsm shulcsm left a comment

Choose a reason for hiding this comment

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

Could you refactor base into something like:

    def _currency_units_verbose(self, number, currency):
        return self.to_cardinal(number)

    def _currency_fractions_verbose(self, number, currency):
        return self.to_cardinal(number)

to_currency:

        unit_str = self._currency_units_verbose(left, currency)
        fraction_str = self._currency_fractions_verbose(right, currency) \
            if cents else "%02d" % right

        return u'%s%s %s%s %s %s' % (
            minus_str,
            unit_str,
            self.pluralize(left, cr1),
            seperator,
            fraction_str,
            self.pluralize(right, cr2)
        )

So you don't have to overload whole thing?

Copy link
Collaborator

@erozqba erozqba left a comment

Choose a reason for hiding this comment

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

Thanks for taking the time to make this contribution!
Could you please also update the README.rst to include lang_SR?

@coveralls
Copy link

coveralls commented Oct 17, 2018

Pull Request Test Coverage Report for Build 535

  • 66 of 70 (94.29%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 89.805%

Changes Missing Coverage Covered Lines Changed/Added Lines %
num2words/lang_SR.py 65 69 94.2%
Totals Coverage Status
Change from base Build 531: 0.1%
Covered Lines: 2537
Relevant Lines: 2825

💛 - Coveralls

erozqba
erozqba previously approved these changes Nov 10, 2018
@erozqba erozqba merged commit 1ed09f5 into savoirfairelinux:master Nov 10, 2018
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.

None yet

4 participants