commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (VALIDATOR-225) locale aware validator scripts required
Date Wed, 07 Jan 2015 00:01:34 GMT

     [ https://issues.apache.org/jira/browse/VALIDATOR-225?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sebb resolved VALIDATOR-225.
----------------------------
    Resolution: Won't Fix

Javascript routines are no longer maintained and have been deprecated

> locale aware validator scripts required
> ---------------------------------------
>
>                 Key: VALIDATOR-225
>                 URL: https://issues.apache.org/jira/browse/VALIDATOR-225
>             Project: Commons Validator
>          Issue Type: Bug
>          Components: JavaScript
>    Affects Versions: 1.3.1 Release
>         Environment: shale1.0.4, JSF1.1
>            Reporter: Hasan Turksoy
>
> when the locale is EN: thousand seperator="," ,  decimal seperator='.' (like: 123,45.67)
> when the locale is TR(my case): thousand seperator="." ,  decimal seperator=',' (like:
123.45,67)
>  
> as far as i can see, validator javascripts written for EN locale in mind.. so, validator
scripts are not working properly for my situation...
>  
> for example, for the above value, validateFloat will split my number after 123.. i didn't
control all but some other validators may fail in such a situation too..
> A solution that we can apply to commons-validator might be like this;
> ValidatorScript component reaches necessary localized symbols and puts them into a localeSpecificSymbols[]
array... resulting javascipt code will be like this:
> ------------------------------------------------------------------
> var GROUPING_SEPARATOR_INDEX = 0;
> var DECIMAL_SEPARATOR_INDEX = 1;
> var localeSpecificSymbols = {'.', ',', .....};
> ------------------------------------------------------------------
> by this way, any validator which needs one of these symbols can reach this symbols array
and use it as necessary....
> example validateFloat implementation code will then be like:
> var tempArray = value.split(localeSpecificSymbols[DECIMAL_SEPARATOR_INDEX]);
> instead of
> var tempArray = value.split('.');
> i have injected this solution into my local commons-validator and shale jars and it's
succeeded :)...
> PS : sorry for the incorrect code parts.. i can not reach my original code for now..
written them only for visualize the problem and solution.. however, i can send the correct
code later, if required..
> regards..
> hasan..



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message