Clean code

This commit is contained in:
Laurent Destailleur 2021-08-17 23:23:15 +02:00
parent bbcea38793
commit c001fb9555
4 changed files with 30 additions and 2175 deletions

View File

@ -50,6 +50,10 @@ then
then then
aaupper="SA" aaupper="SA"
fi fi
if [ $bb = "IQ" ]
then
aaupper="SA"
fi
bblower=`echo $dirshort | nawk -F"_" '{ print tolower($2) }'` bblower=`echo $dirshort | nawk -F"_" '{ print tolower($2) }'`
@ -60,7 +64,9 @@ then
echo $reflang" "$aa"_"$bb != $aa"_"$aaupper echo $reflang" "$aa"_"$bb != $aa"_"$aaupper
# If $reflang is a main language to use to sanitize the alternative file # If $reflang is a main language to use to sanitize the alternative file
if [ -d $reflang -a $aa"_"$bb != $aa"_"$aaupper ] if [ -d $reflang ]
then
if [ $aa"_"$bb != $aa"_"$aaupper ]
then then
echo "***** Search original into "$reflang echo "***** Search original into "$reflang
echo $dirshort is an alternative language of $reflang echo $dirshort is an alternative language of $reflang
@ -78,5 +84,6 @@ then
done done
fi fi
fi fi
fi
done; done;
fi fi

View File

@ -177,7 +177,7 @@ foreach ($filesToProcess as $fileToProcess) {
// Start reading and parsing English // Start reading and parsing English
$aEnglish = array();
if ($handle = fopen($lEnglishFile, 'r')) { if ($handle = fopen($lEnglishFile, 'r')) {
print "Read English File $lEnglishFile:\n"; print "Read English File $lEnglishFile:\n";
$cnt = 0; $cnt = 0;
@ -246,6 +246,9 @@ foreach ($filesToProcess as $fileToProcess) {
fwrite($oh, "# Dolibarr language file - Source file is en_US - ".(preg_replace('/\.lang$/', '', $fileToProcess))."\n"); fwrite($oh, "# Dolibarr language file - Source file is en_US - ".(preg_replace('/\.lang$/', '', $fileToProcess))."\n");
$fileFirstFound = array();
$lineFirstFound = array();
$cnt = 0; $cnt = 0;
while (($line = fgets($handle)) !== false) { while (($line = fgets($handle)) !== false) {
$cnt++; $cnt++;
@ -299,6 +302,7 @@ foreach ($filesToProcess as $fileToProcess) {
} }
// String exists in both files and value into alternative language differs from main language but also from english files // String exists in both files and value into alternative language differs from main language but also from english files
// so we keep it.
if ((! empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key] if ((! empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key]
&& ! empty($aEnglish[$key]) && $aSecondary[$key] != $aEnglish[$key]) && ! empty($aEnglish[$key]) && $aSecondary[$key] != $aEnglish[$key])
|| in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/', $key) || preg_match('/^FormatHour/', $key) || in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/', $key) || preg_match('/^FormatHour/', $key)

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@ DIRECTION=ltr
FONTFORPDF=helvetica FONTFORPDF=helvetica
FONTSIZEFORPDF=10 FONTSIZEFORPDF=10
SeparatorDecimal=. SeparatorDecimal=.
SeparatorThousand=, SeparatorThousand=None
FormatDateShort=%m/%d/%Y FormatDateShort=%m/%d/%Y
FormatDateShortInput=%m/%d/%Y FormatDateShortInput=%m/%d/%Y
FormatDateShortJava=MM/dd/yyyy FormatDateShortJava=MM/dd/yyyy