mifos

parameterize messages used for loan amount bean validation

Details

  • Team:
    Community
  • Scheduled For:
    Product

Description

To ease localizability of Mifos, parameterize strings used during loan creation. Example:

Min.loanProduct.loanAmountByLastLoanAmount0.lower=Please Specify the valid Start Range Loan Amount for by last loan at row 1.
Min.loanProduct.loanAmountByLastLoanAmount1.lower=Please Specify the valid Start Range Loan Amount for by last loan at row 2.
Min.loanProduct.loanAmountByLastLoanAmount2.lower=Please Specify the valid Start Range Loan Amount for by last loan at row 3.
Min.loanProduct.loanAmountByLastLoanAmount3.lower=Please Specify the valid Start Range Loan Amount for by last loan at row 4.
Min.loanProduct.loanAmountByLastLoanAmount4.lower=Please Specify the valid Start Range Loan Amount for by last loan at row 5.
Min.loanProduct.loanAmountByLastLoanAmount5.lower=Please Specify the valid Start Range Loan Amount for by last loan at row 6.

According to JSR 303, these messages are parameterizable. ie: only a single message should be necessary, for example:

Min.loanProduct.loanAmountByLastLoanAmount.lower=Please Specify the valid Start Range Loan Amount for by last loan at row {num}.

This should reduce the number of strings in userInterface/../messages.properties by 300 or so.

Activity

Hide
Adam Monsen added a comment - - edited

Hi Stanley, will you take a look at this? Once this is complete, I think we're ready to have the Translatewiki.net folks add the user interface messages file and get that translated for the 1.7.0 release!

Show
Adam Monsen added a comment - - edited Hi Stanley, will you take a look at this? Once this is complete, I think we're ready to have the Translatewiki.net folks add the user interface messages file and get that translated for the 1.7.0 release!
Hide
Adam Monsen added a comment -

Nevermind, I'm asking Jasmine to look at this one. But she may need help! Will you guys work together?

Show
Adam Monsen added a comment - Nevermind, I'm asking Jasmine to look at this one. But she may need help! Will you guys work together?
Hide
jasmine sandhu added a comment -

Patch that parameterizes (almost) all messages.

Two files were modified:
1) messages.properties - now contains the parameterized messages
2) LoanProductFormBeanValidator.java - which constructs these messages for display.

The only messages that do not show up correctly are the typeMismatch.* messages. As an example, when I entered a string in the box instead of a number, the displayed error message is:
Please Specify the valid Min Loan Amount for by loan cycle at row loanAmountByLoanCycle0.min.

but it should just be:
Please Specify the valid Min Loan Amount for by loan cycle at row 1.

But I don't believe this is working correctly in the current non-parameterized code either. However, the error in the current code is:
Invalid data.

It does not display the message stored in typeMismatch.* ..

I did test the updates by putting strings in my messages to make sure they were being displayed and ensuring I understood which message was displayed for which box. I did document this within messages.properties in a shorthand notation, feel free to remove if this documentation is confusing. I do have a copy of this for myself and can document this on the wiki as that might be more appropriate.

Show
jasmine sandhu added a comment - Patch that parameterizes (almost) all messages. Two files were modified: 1) messages.properties - now contains the parameterized messages 2) LoanProductFormBeanValidator.java - which constructs these messages for display. The only messages that do not show up correctly are the typeMismatch.* messages. As an example, when I entered a string in the box instead of a number, the displayed error message is: Please Specify the valid Min Loan Amount for by loan cycle at row loanAmountByLoanCycle0.min. but it should just be: Please Specify the valid Min Loan Amount for by loan cycle at row 1. But I don't believe this is working correctly in the current non-parameterized code either. However, the error in the current code is: Invalid data. It does not display the message stored in typeMismatch.* .. I did test the updates by putting strings in my messages to make sure they were being displayed and ensuring I understood which message was displayed for which box. I did document this within messages.properties in a shorthand notation, feel free to remove if this documentation is confusing. I do have a copy of this for myself and can document this on the wiki as that might be more appropriate.
Hide
Adam Monsen added a comment -

Patch accepted. head/1.7.x commit 7d543c9621afadd7754e72b83401678b0bf410ca

Show
Adam Monsen added a comment - Patch accepted. head/1.7.x commit 7d543c9621afadd7754e72b83401678b0bf410ca

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
Not Specified
Original Estimate - Not Specified
Remaining:
1d
Time Spent - 3 days Remaining Estimate - 1 day
Logged:
3d
Time Spent - 3 days Remaining Estimate - 1 day