From 6abe2c64714a38e41de23fe20fa319d0ad2fd845 Mon Sep 17 00:00:00 2001 From: Frederik Haa Date: Mon, 16 Dec 2024 17:34:18 +0100 Subject: [PATCH] Change danish language code to DA (#596) Co-authored-by: Marlon Rodriguez Garcia <47992153+mrodriguezg1991@users.noreply.github.com> --- num2words/__init__.py | 4 ++-- num2words/{lang_DK.py => lang_DA.py} | 4 ++-- tests/{test_dk.py => test_da.py} | 22 +++++++++++----------- 3 files changed, 15 insertions(+), 15 deletions(-) rename num2words/{lang_DK.py => lang_DA.py} (98%) rename tests/{test_dk.py => test_da.py} (68%) diff --git a/num2words/__init__.py b/num2words/__init__.py index 0c216ad2..882aa229 100644 --- a/num2words/__init__.py +++ b/num2words/__init__.py @@ -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, @@ -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(), diff --git a/num2words/lang_DK.py b/num2words/lang_DA.py similarity index 98% rename from num2words/lang_DK.py rename to num2words/lang_DA.py index 50ab110c..c6607383 100644 --- a/num2words/lang_DK.py +++ b/num2words/lang_DA.py @@ -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" diff --git a/tests/test_dk.py b/tests/test_da.py similarity index 68% rename from tests/test_dk.py rename to tests/test_da.py index 4c2e6ce3..3e1b4eba 100644 --- a/tests/test_dk.py +++ b/tests/test_da.py @@ -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")