From 15b91eaef91f0df14b9f8151c9c78249ccf5591b Mon Sep 17 00:00:00 2001 From: Vikas Jain Date: Mon, 12 Oct 2020 01:23:58 +0530 Subject: [PATCH 1/2] Change french translation for 70 to 79 & 90 to 99 For French translations, the values from 70 to 79 and 90 to 99 are incorrect. For 70 till 76, we need to show 60+10 for 70, likewise 71 should be shown like 60+11 from 77 to 79, the logic is 77 - 60+10+7 Same logic applies for 90 to 99, but one change with 91 is to show with dash quantre-vingt-onze. For 71 we should show without dash Soixante et onze. --- Numbers/Words/Locale/fr/BE.php | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/Numbers/Words/Locale/fr/BE.php b/Numbers/Words/Locale/fr/BE.php index f1c6f19..f141cea 100644 --- a/Numbers/Words/Locale/fr/BE.php +++ b/Numbers/Words/Locale/fr/BE.php @@ -83,6 +83,7 @@ class Numbers_Words_Locale_fr_BE extends Numbers_Words 50=>'cinquante',// 50 60=>'soixante', // 60 70=>'septante', // 70 + 80=>'quatre-vingt', // 80 90=>'nonante', // 90 100=>'cent' // 100 ); @@ -335,6 +336,21 @@ function _showDigitsGroup($num, $last = false) $ret .= $this->_misc_numbers[10].'-'.$this->_digits[$e]; } $e = 0; + elseif ($d==7 || $d==9) { + //70 is same as 60 + 10, like wise till 76, same logic to be followed for 90 as well + if ($e<=6) { + if($e != 1) { + //for ones, below digit logic will take care of adding hyphen(-) or not + $ret .= $this->_misc_numbers[($d-1)*10].'-'.$this->_misc_numbers[$e+10]; + } else { + $ret .= $this->_misc_numbers[($d-1)*10]; + } + if($e != 1) $e = 0; + } else { + //for 77 to 79, 77 is 60+10+7 like wise for 78 and 79 + $ret .= $this->_misc_numbers[($d-1)*10].'-'.$this->_misc_numbers[10].'-'.$this->_digits[$e]; + $e = 0; + } } elseif ($d==8) { $ret .= $this->_digits[4].$this->_dash.$this->_misc_numbers[20]; $resto = $d*10+$e-80; @@ -353,13 +369,18 @@ function _showDigitsGroup($num, $last = false) // process the "ones" digit if ($e) { if ($d) { - if ($e==1) { + if ($e==1 && $d!=9) { //hyphen should not be added for 91 $ret .= $this->_sep.$this->_and.$this->_sep; } else { $ret .= $this->_dash; } } - $ret .= $this->_digits[$e]; + //for 71 and 91 we need to show onze(11) instead of un(1) + if(($d==7 || $d==9) && $e==1){ + $ret .= $this->_misc_numbers[$e+10]; + } else { + $ret .= $this->_digits[$e]; + } } // strip excessive separators From 964670f42f55b5ac729b712ea8f13464fbfed8c9 Mon Sep 17 00:00:00 2001 From: Vikas Jain Date: Mon, 12 Oct 2020 01:26:07 +0530 Subject: [PATCH 2/2] comment updated --- Numbers/Words/Locale/fr/BE.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Numbers/Words/Locale/fr/BE.php b/Numbers/Words/Locale/fr/BE.php index f141cea..55d3165 100644 --- a/Numbers/Words/Locale/fr/BE.php +++ b/Numbers/Words/Locale/fr/BE.php @@ -369,7 +369,7 @@ function _showDigitsGroup($num, $last = false) // process the "ones" digit if ($e) { if ($d) { - if ($e==1 && $d!=9) { //hyphen should not be added for 91 + if ($e==1 && $d!=9) { //hyphen should be added for 91 only $ret .= $this->_sep.$this->_and.$this->_sep; } else { $ret .= $this->_dash;