From 7282a6faf24d08762993af285b10b8217085b6c8 Mon Sep 17 00:00:00 2001 From: frederic34 Date: Sat, 28 Mar 2015 10:59:10 +0100 Subject: [PATCH] Trans in Loan Calculator --- htdocs/langs/en_US/loan.lang | 10 ++++++++++ htdocs/loan/calc.php | 28 +++++++++++++--------------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/htdocs/langs/en_US/loan.lang b/htdocs/langs/en_US/loan.lang index 056ce1d0b48..98a7fb4ed93 100644 --- a/htdocs/langs/en_US/loan.lang +++ b/htdocs/langs/en_US/loan.lang @@ -28,11 +28,21 @@ ExplainCalculations=Explain Calculations ShowMeCalculationsAndAmortization=Show me the calculations and amortization MortgagePaymentInformation=Mortgage Payment Information DownPayment=Down Payment +DownPaymentDesc=The down payment = The price of the home multiplied by the percentage down divided by 100 (for 5% down becomes 5/100 or 0.05) +InterestRateDesc=The interest rate = The annual interest percentage divided by 100 +MonthlyFactorDesc=The monthly factor = The result of the following formula +MonthlyInterestRateDesc=The monthly interest rate = The annual interest rate divided by 12 (for the 12 months in a year) +MonthTermDesc=The month term of the loan in months = The number of years you've taken the loan out for times 12 +MonthlyPaymentDesc=The montly payment is figured out using the following formula +AmortizationPaymentDesc=The amortization breaks down how much of your monthly payment goes towards the bank's interest, and how much goes into paying off the principal of your loan. AmountFinanced=Amount Financed AmortizationMonthlyPaymentOverYears=Amortization For Monthly Payment: %s over %s years Totalsforyear=Totals for year MonthlyPayment=Monthly Payment LoanCalcDesc=This mortgage calculator can be used to figure out monthly payments of a home mortgage loan, based on the home's sale price, the term of the loan desired, buyer's down payment percentage, and the loan's interest rate.
This calculator factors in PMI (Private Mortgage Insurance) for loans where less than 20% is put as a down payment. Also taken into consideration are the town property taxes, and their effect on the total monthly mortgage payment.
+GoToInterest=%s will go towards INTEREST +GoToPrincipal=%s will go towards PRINCIPAL +YouWillSpend=You will spend %s on your house in year %s # Admin ConfigLoan=Configuration of the module loan LOAN_ACCOUNTING_ACCOUNT_CAPITAL=Accountancy code capital by default diff --git a/htdocs/loan/calc.php b/htdocs/loan/calc.php index 06b62231a67..bb6fe9451b6 100644 --- a/htdocs/loan/calc.php +++ b/htdocs/loan/calc.php @@ -255,48 +255,46 @@ if ($form_complete && $show_progress) { print ''; print ''. $step++ .''; print ''; - echo 'The down payment - = The price of the home multiplied by the percentage down divided by 100 (for 5% down becomes 5/100 or 0.05)

- ' . number_format($down_payment,"2",".",",") . ' ' . $langs->trans("Currency".$conf->currency) . ' = '.number_format($sale_price,"2",".",",") . ' ' . $langs->trans("Currency".$conf->currency) . ' X - ('.$down_percent.' / 100)'; + print $langs->trans('DownPaymentDesc').'

'; + print number_format($down_payment,"2",".",",") . ' ' . $langs->trans("Currency".$conf->currency) . ' = '; + print number_format($sale_price,"2",".",",") . ' ' . $langs->trans("Currency".$conf->currency) . ' X (' . $down_percent . ' / 100)'; print ''; print ''; print ''; print '' . $step++ . ''; print ''; - print 'The interest rate = The annual interest percentage divided by 100

'; + print $langs->trans('InterestRateDesc') . '

'; print $annual_interest_rate . ' = ' . $annual_interest_percent . '% / 100'; print ''; print ''; print ''; print ''; - print 'The monthly factor = The result of the following formula:'; + print $langs->trans('MonthlyFactorDesc') . ':'; print ''; print ''; print ''; print '' . $step++ . ''; print ''; - print 'The monthly interest rate = The annual interest rate divided by 12 (for the 12 months in a year)

'; + print $langs->trans('MonthlyInterestRateDesc') . '

'; print $monthly_interest_rate . ' = ' . $annual_interest_rate . ' / 12'; print ''; print ''; print ''; print '' . $step++ . ''; print ''; - print 'The month term of the loan in months = The number of years you\'ve taken the loan out for times 12

'; - print $month_term . ' Months = ' . $year_term . ' Years X 12'; + print $langs->trans('MonthTermDesc') . '

'; + print $month_term . ' '. $langs->trans('Months') . ' = ' . $year_term . ' '. $langs->trans('Years') . ' X 12'; print ''; print ''; print ''; print '' . $step++ . ''; print ''; - print 'The montly payment is figured out using the following formula:
'; + print $langs->trans('MonthlyPaymentDesc') . ':
'; print $langs->trans('MonthlyPayment').' = ' . number_format($financing_price, "2", "", "") . ' * '; print '(1 - ((1 + ' . number_format($monthly_interest_rate, "4", "", "") . ')'; print '-(' . $month_term . '))))'; print '

'; - print 'The amortization breaks down how much of your monthly payment goes towards the bank\'s interest,'; - print 'and how much goes into paying off the principal of your loan.'; + print $langs->trans('AmortizationPaymentDesc'); print ''; print ''; print ''; @@ -357,9 +355,9 @@ if ($form_complete && $show_progress) { print ''; print ' '; print ''; - print 'You will spend ' . number_format($total_spent_this_year, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . ' on your house in year ' . $current_year . '
'; - print number_format($this_year_interest_paid, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . ' will go towards INTEREST
'; - print number_format($this_year_principal_paid, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . ' will go towards PRINCIPAL
'; + print $langs->trans('YouWillSpend', number_format($total_spent_this_year, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency), $current_year) . '
'; + print $langs->trans('GoToInterest', number_format($this_year_interest_paid, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency)) . '
'; + print $langs->trans('GoToPrincipal', number_format($this_year_principal_paid, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency)) . '
'; print ''; print '';