Re: [Dhis2-devs] [Bug 541788] [NEW] Testing for Date formatted text field validation working not well formed - Data entry

2010-03-25 Thread Viet Nguyen
Hi,

After a short discussion with Hieu on another thread  in Vietnamese. I came
up with some thoughts :

*Use i18n.getString("..") for jquery validation error messages *

As you know, that method can not be called from a javascript file, it only
works with in-page javascript.

If you really want to do this, then I can create a .vm file which will have
a macro. This velocity macro will be used for calling all the i18n.getString
methods. Then in each page you need the jquery validation, you need to parse
that macro on the top of the page.

This is somehow complicated... I prefer to keep current approach.

*Validation rules depend on locale code*

As you know, I modified the jquery validation to get the messages base on
the  locale code .

For validation rules, I can also do the same.

For each rule like  dateISO, alphanumeric.. I would have different methods
for each language.

Those methods will be added to the arrays methods of jquery validation
plugin when you call the method

 jQuery.validator.loadLocaled( jQuery("#curLocaleCode").val() );.

Of course , all the rules that are generic like : maxlength , minlength ...
still be in the default array of methods.

*Disadvantage: *

Doing this means : for each language , we *must *provide the method which
has been already defined on the field. Or else, there should be error.

For example : if I defined the rule  alphanumeric for   user name field on
the form.  Then in Hindi language , even I don't know how to do it or  I
don't want that rule, I still have to define the method for that rule  in
Hindi without checking anything, just return TRUE ...

Another point is... for any new language that we use...someone has to touch
those things. or at least tell me to do it...

Please give comment.

-- 
Viet Nguyen
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] [Bug 541788] [NEW] Testing for Date formatted text field validation working not well formed - Data entry

2010-03-22 Thread Hieu Dang Duy
Hi Viet,

I do agree with Quang's idea.
It'll be better, reliability, and flexibility if re-use i18n object in
presentation layer.

How do you think Viet?

On Mon, Mar 22, 2010 at 9:15 PM, Quang Nguyen wrote:

>
>
> On Mon, Mar 22, 2010 at 8:24 PM, Viet Nguyen wrote:
>
>>
>>
>> On Mon, Mar 22, 2010 at 10:42 AM, Hieu Dang Duy <
>> hieu.hispviet...@gmail.com> wrote:
>>
>>> Hi Viet,
>>>
>>> Many thanks for working hardly on this bug. It runs fine ! But there is
>>> still English in hard-code.
>>>
>>> P.S: The key-up event is well-done in English setting only.
>>> --
>>> Hieu.HISPVietnam
>>> Good Health !
>>>
>>
>> Hi Hieu,
>>
>> Could you please take a look at this file :
>>
>>
>> dhis-web-commons-resources/dhis-web-commons/util/validate/message_locale.js
>>
>> You can see all the messages in English.
>>
>> So if you want Vietnamese messages, you have to create a  javascript array
>> of messages in Vietnamese. Just follow the format of the English one.
>>
>>
> Is it possible to put these in i18n module? It's better to have all i18n
> messages in one place.
>
> Cheers,
> Quang
>
>
>> Regards,
>>
>> --
>> Viet Nguyen
>>
>>
>> ___
>> Mailing list: 
>> https://launchpad.net/~dhis2-devs
>> Post to : dhis2-devs@lists.launchpad.net
>> Unsubscribe : 
>> https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>


-- 
Hieu.HISPVietnam
Good Health !
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] [Bug 541788] [NEW] Testing for Date formatted text field validation working not well formed - Data entry

2010-03-22 Thread Quang Nguyen
On Mon, Mar 22, 2010 at 8:24 PM, Viet Nguyen  wrote:

>
>
> On Mon, Mar 22, 2010 at 10:42 AM, Hieu Dang Duy <
> hieu.hispviet...@gmail.com> wrote:
>
>> Hi Viet,
>>
>> Many thanks for working hardly on this bug. It runs fine ! But there is
>> still English in hard-code.
>>
>> P.S: The key-up event is well-done in English setting only.
>> --
>> Hieu.HISPVietnam
>> Good Health !
>>
>
> Hi Hieu,
>
> Could you please take a look at this file :
>
> dhis-web-commons-resources/dhis-web-commons/util/validate/message_locale.js
>
> You can see all the messages in English.
>
> So if you want Vietnamese messages, you have to create a  javascript array
> of messages in Vietnamese. Just follow the format of the English one.
>
>
Is it possible to put these in i18n module? It's better to have all i18n
messages in one place.

Cheers,
Quang


> Regards,
>
> --
> Viet Nguyen
>
>
> ___
> Mailing list: 
> https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : 
> https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] [Bug 541788] [NEW] Testing for Date formatted text field validation working not well formed - Data entry

2010-03-22 Thread Viet Nguyen
On Mon, Mar 22, 2010 at 10:42 AM, Hieu Dang Duy
wrote:

> Hi Viet,
>
> Many thanks for working hardly on this bug. It runs fine ! But there is
> still English in hard-code.
>
> P.S: The key-up event is well-done in English setting only.
> --
> Hieu.HISPVietnam
> Good Health !
>

Hi Hieu,

Could you please take a look at this file :

dhis-web-commons-resources/dhis-web-commons/util/validate/message_locale.js

You can see all the messages in English.

So if you want Vietnamese messages, you have to create a  javascript array
of messages in Vietnamese. Just follow the format of the English one.

Regards,

-- 
Viet Nguyen
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] [Bug 541788] [NEW] Testing for Date formatted text field validation working not well formed - Data entry

2010-03-21 Thread Hieu Dang Duy
Hi Viet,

Many thanks for working hardly on this bug. It runs fine ! But there is
still English in hard-code.

P.S: The key-up event is well-done in English setting only.
-- 
Hieu.HISPVietnam
Good Health !
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] [Bug 541788] [NEW] Testing for Date formatted text field validation working not well formed - Data entry

2010-03-19 Thread Viet Nguyen
On Fri, Mar 19, 2010 at 4:20 PM, Viet Nguyen  wrote:

>
>
> On Fri, Mar 19, 2010 at 4:05 PM, Hieu Duy Dang  > wrote:
>
>> Public bug reported:
>>
>> I verified a date string with format is '-MM-dd' for each date text
>> field. The validation rule for this would work effectively when using the
>> default setting as English interface. But this one would not well done or
>> not working if I change the user setting to other language. Please reviewing
>> and fixed it again as soon as possible.
>> Thank you !
>>
>>
> If you are using jquery validate plugin then you need to define Vietnamese
> error messages in the file
>
>  web-common-resources/util/validate/message_locale.js
>
> Regards,
>
>
>

OK, I will set the  English as the default messages in case you don't have
Vietnamese messages.

Fix will be committed soon.

Regards,


>  ** Affects: dhis2
>> Importance: Undecided
>> Status: New
>>
>> --
>> Testing for Date formatted text field validation working not well formed -
>> Data entry
>> https://bugs.launchpad.net/bugs/541788
>> You received this bug notification because you are a member of DHIS 2
>> developers, which is subscribed to DHIS.
>>
>> Status in DHIS 2 - District Health Information Software: New
>>
>> Bug description:
>> I verified a date string with format is '-MM-dd' for each date text
>> field. The validation rule for this would work effectively when using the
>> default setting as English interface. But this one would not well done or
>> not working if I change the user setting to other language. Please reviewing
>> and fixed it again as soon as possible.
>> Thank you !
>>
>>
>>
>> ___
>> Mailing list: 
>> https://launchpad.net/~dhis2-devs
>> Post to : dhis2-devs@lists.launchpad.net
>> Unsubscribe : 
>> https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>
>
>
> --
> Viet Nguyen
>
>


-- 
Viet Nguyen
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] [Bug 541788] [NEW] Testing for Date formatted text field validation working not well formed - Data entry

2010-03-19 Thread Viet Nguyen
On Fri, Mar 19, 2010 at 4:05 PM, Hieu Duy Dang
wrote:

> Public bug reported:
>
> I verified a date string with format is '-MM-dd' for each date text
> field. The validation rule for this would work effectively when using the
> default setting as English interface. But this one would not well done or
> not working if I change the user setting to other language. Please reviewing
> and fixed it again as soon as possible.
> Thank you !
>
>
If you are using jquery validate plugin then you need to define Vietnamese
error messages in the file

 web-common-resources/util/validate/message_locale.js

Regards,



> ** Affects: dhis2
> Importance: Undecided
> Status: New
>
> --
> Testing for Date formatted text field validation working not well formed -
> Data entry
> https://bugs.launchpad.net/bugs/541788
> You received this bug notification because you are a member of DHIS 2
> developers, which is subscribed to DHIS.
>
> Status in DHIS 2 - District Health Information Software: New
>
> Bug description:
> I verified a date string with format is '-MM-dd' for each date text
> field. The validation rule for this would work effectively when using the
> default setting as English interface. But this one would not well done or
> not working if I change the user setting to other language. Please reviewing
> and fixed it again as soon as possible.
> Thank you !
>
>
>
> ___
> Mailing list: 
> https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : 
> https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>



-- 
Viet Nguyen
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Bug 541788] [NEW] Testing for Date formatted text field validation working not well formed - Data entry

2010-03-19 Thread Hieu Duy Dang
Public bug reported:

I verified a date string with format is '-MM-dd' for each date text field. 
The validation rule for this would work effectively when using the default 
setting as English interface. But this one would not well done or not working 
if I change the user setting to other language. Please reviewing and fixed it 
again as soon as possible.
Thank you !

** Affects: dhis2
 Importance: Undecided
 Status: New

-- 
Testing for Date formatted text field validation working not well formed - Data 
entry
https://bugs.launchpad.net/bugs/541788
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.

Status in DHIS 2 - District Health Information Software: New

Bug description:
I verified a date string with format is '-MM-dd' for each date text field. 
The validation rule for this would work effectively when using the default 
setting as English interface. But this one would not well done or not working 
if I change the user setting to other language. Please reviewing and fixed it 
again as soon as possible.
Thank you !



___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp