[ 
http://mifosforge.jira.com/browse/MIFOS-3859?page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#action_10103
 ]

jasmine sandhu logged work on MIFOS-3859:
-----------------------------------------

                Author: jasmine sandhu
            Created on: 29/Oct/10 2:46 AM
            Start Date: 09/Oct/10 2:37 AM
    Worklog Time Spent: 2 days 
      Work Description: Studied examples to see how the validator was invoking 
the message from messages.properties. Analyzed the LoanProduct example, 
specifically LoanProductFormBeanValidator.java. As it turns out, the proposed 
solution in the email to mifos-developers (10/10) works. 

Basically in the validator methods ObjectError is defined and the Constructor 
used for ObjectError:
ObjectError(String objectName, String[] codes, Object[] args, String 
defaultMessage)

In our example:
objectName: loanProduct
codes: a single string constructed using buildViolationMessage() method within 
this class
args: none
defaultMessage: uses ConstraintViolation.getMessage(), which I think is the 
un-customized message reported by JSR303

args are the array of arguments used to resolve this message. I think perhaps 
this is where the parameter gets passed
into the message for resolution. Updating the java code to pass the counter as 
an args and parameterizing the message in properties.messages did the trick.

Making the changes should only be a couple more hours. However, it will take 
some time to test it thoroughly. And I think we could do a little work on 
making the messages more informative - this will likely require understanding 
the functionality of parts of this form.


Issue Time Tracking
-------------------

            Time Spent: 2 days
    Remaining Estimate: 2 days

> parameterize messages used for loan amount bean validation
> ----------------------------------------------------------
>
>                 Key: MIFOS-3859
>                 URL: http://mifosforge.jira.com/browse/MIFOS-3859
>             Project: mifos
>          Issue Type: Improvement
>          Components: Internationalization
>            Reporter: Adam Monsen
>            Assignee: jasmine sandhu
>             Fix For: Gazelle Backlog
>
>          Time Spent: 2 days
>  Remaining Estimate: 2 days
>
> To ease localizability of Mifos, parameterize strings used during loan 
> creation. Example:
> {noformat}
> 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.
> {noformat}
> According to JSR 303, these messages are parameterizable. ie: only a single 
> message should be necessary, for example:
> {noformat}
> Min.loanProduct.loanAmountByLastLoanAmount.lower=Please Specify the valid 
> Start Range Loan Amount for by last loan at row {num}.
> {noformat}
> This should reduce the number of strings in 
> userInterface/../messages.properties by 300 or so.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://mifosforge.jira.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Mifos-issues mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-issues

Reply via email to