Skip to content

Commit

Permalink
Change danish language code to DA (#596)
Browse files Browse the repository at this point in the history
Co-authored-by: Marlon Rodriguez Garcia <47992153+mrodriguezg1991@users.noreply.github.com>
  • Loading branch information
FredHaa and mrodriguezg1991 authored Dec 16, 2024
1 parent 282f72d commit 6abe2c6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions num2words/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from __future__ import unicode_literals

from . import (lang_AM, lang_AR, lang_AZ, lang_BE, lang_BN, lang_CA, lang_CE,
lang_CS, lang_CY, lang_DE, lang_DK, lang_EN, lang_EN_IN,
lang_CS, lang_CY, lang_DA, lang_DE, lang_EN, lang_EN_IN,
lang_EN_NG, lang_EO, lang_ES, lang_ES_CO, lang_ES_CR,
lang_ES_GT, lang_ES_NI, lang_ES_VE, lang_FA, lang_FI, lang_FR,
lang_FR_BE, lang_FR_CH, lang_FR_DZ, lang_HE, lang_HU, lang_ID,
Expand Down Expand Up @@ -69,7 +69,7 @@
'sr': lang_SR.Num2Word_SR(),
'sv': lang_SV.Num2Word_SV(),
'no': lang_NO.Num2Word_NO(),
'dk': lang_DK.Num2Word_DK(),
'da': lang_DA.Num2Word_DA(),
'pt': lang_PT.Num2Word_PT(),
'pt_BR': lang_PT_BR.Num2Word_PT_BR(),
'he': lang_HE.Num2Word_HE(),
Expand Down
4 changes: 2 additions & 2 deletions num2words/lang_DK.py → num2words/lang_DA.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
from . import lang_EU


class Num2Word_DK(lang_EU.Num2Word_EU):
class Num2Word_DA(lang_EU.Num2Word_EU):
GIGA_SUFFIX = "illiarder"
MEGA_SUFFIX = "illioner"

def setup(self):
super(Num2Word_DK, self).setup()
super(Num2Word_DA, self).setup()

self.negword = "minus "
self.pointword = "komma"
Expand Down
22 changes: 11 additions & 11 deletions tests/test_dk.py → tests/test_da.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@
from unittest import TestCase

from num2words import num2words
from num2words.lang_DK import Num2Word_DK
from num2words.lang_DA import Num2Word_DA


class Num2WordsDKTest(TestCase):
def test_ordinal(self):
self.assertEqual(num2words(1, to="ordinal", lang="dk"), "første")
self.assertEqual(num2words(5, to="ordinal", lang="dk"), "femte")
self.assertEqual(num2words(1, to="ordinal", lang="da"), "første")
self.assertEqual(num2words(5, to="ordinal", lang="da"), "femte")

def test_cardinal(self):
self.assertEqual(num2words(0, to="cardinal", lang="dk"), "nul")
self.assertEqual(num2words(1, to="cardinal", lang="dk"), "et")
self.assertEqual(num2words(2, to="cardinal", lang="dk"), "to")
self.assertEqual(num2words(5, to="cardinal", lang="dk"), "fem")
self.assertEqual(num2words(8, to="cardinal", lang="dk"), "otte")
self.assertEqual(num2words(18, to="cardinal", lang="dk"), "atten")
self.assertEqual(num2words(45, to="cardinal", lang="dk"), "femogfyrre")
self.assertEqual(num2words(0, to="cardinal", lang="da"), "nul")
self.assertEqual(num2words(1, to="cardinal", lang="da"), "et")
self.assertEqual(num2words(2, to="cardinal", lang="da"), "to")
self.assertEqual(num2words(5, to="cardinal", lang="da"), "fem")
self.assertEqual(num2words(8, to="cardinal", lang="da"), "otte")
self.assertEqual(num2words(18, to="cardinal", lang="da"), "atten")
self.assertEqual(num2words(45, to="cardinal", lang="da"), "femogfyrre")

def test_to_ordinal_num(self):
num2words_dk = Num2Word_DK()
num2words_dk = Num2Word_DA()
self.assertEqual(num2words_dk.to_ordinal_num(1), "1te")
self.assertEqual(num2words_dk.to_ordinal_num(2), "2en")
self.assertEqual(num2words_dk.to_ordinal_num(5), "5te")
Expand Down

0 comments on commit 6abe2c6

Please sign in to comment.