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

Change french translation for 70 to 79 & 90 to 99 #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions Numbers/Words/Locale/fr/BE.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down Expand Up @@ -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;
Expand All @@ -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 be added for 91 only
$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
Expand Down