Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error string internationalisation #46

Closed
mahermeg17 opened this issue Aug 1, 2016 · 5 comments
Closed

error string internationalisation #46

mahermeg17 opened this issue Aug 1, 2016 · 5 comments

Comments

@mahermeg17
Copy link
Contributor

Hi,
I need to show error msg for Arabic users which not supported (https://github.com/vekexasia/android-edittext-validator/tree/09a1a466e687e9afb4eef0daf3f179cdae8b967f/library/res)
So I use [whatever:emptyErrorString="@string/msg_invalid_data_empty"] into my layout xml file.
But it only shows fr msg which is the default language of the phone. Even I force my app to use Arabic language (all other UI are correctly in Arabic).
And when I use a Validator from java like this

MultiValidator tmpValidator = new AndValidator(); tmpValidator.enqueue(new FormAlphaNumericValidator(getResources().getString(R.string.msg_invalid_data_format))); tmpValidator.enqueue(new EmptyValidator(getResources().getString(R.string.msg_invalid_data_empty))); mScannedDocNumber.addValidator(tmpValidator);

My FormAlphaNumericValidator extends AlphaNumericValidator show correctly the error msg in Arabic. But not the EmptyValidator.
Are there a better way to show error msg in Arabic, or should I extends all needed Validators ?

Thanks,

@vekexasia
Copy link
Owner

Just create The translations and submit a pull request :)

Il 01 ago 2016 12:14 PM, "megadmini" notifications@github.com ha scritto:

Hi,
I need to show error msg for Arabic users which not supported (
https://github.com/vekexasia/android-edittext-validator/tree/09a1a466e687e9afb4eef0daf3f179cdae8b967f/library/res
)
So I use [whatever:emptyErrorString="@string/msg_invalid_data_empty"] into
my layout xml file.
But it only shows fr msg which is the default language of the phone. Even
I force my app to use Arabic language (all other UI are correctly in
Arabic).
And when I use a Validator from java like this

MultiValidator tmpValidator = new AndValidator();
tmpValidator.enqueue(new
FormAlphaNumericValidator(getResources().getString(R.string.msg_invalid_data_format)));
tmpValidator.enqueue(new
EmptyValidator(getResources().getString(R.string.msg_invalid_data_empty)));
mScannedDocNumber.addValidator(tmpValidator);

My FormAlphaNumericValidator extends AlphaNumericValidator show correctly
the error msg in Arabic. But not the EmptyValidator.
Are there a better way to show error msg in Arabic, or should I extends
all needed Validators ?

Thanks,


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#46, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAMPS5-YTot2a_ca1Bzh0jBD7BZcbfQ8ks5qbccAgaJpZM4JZcJV
.

@mahermeg17
Copy link
Contributor Author

OK. I will.
But just to confirm, passing a custom string to the constructor do not really change the error msg ?
new EmptyValidator(getResources().getString(R.string.msg_invalid_data_empty)));

@vekexasia
Copy link
Owner

Depends on the validator. but correct way to localize is to create proper
string values for the desired language

On Mon, Aug 1, 2016 at 1:23 PM, megadmini notifications@github.com wrote:

OK. I will.
But just to confirm, passing a custom string to the constructor do not
really change the error msg ?
new
EmptyValidator(getResources().getString(R.string.msg_invalid_data_empty)));


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#46 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAMPS14VuIEdJU8kD2NvdDEcRSkCuMuLks5qbdcZgaJpZM4JZcJV
.

Andrea Baccega
[image: Email]me@andreabaccega.com
[image: Hangouts]vekexasia@gmail.com
[image: Personal site] http://www.andreabaccega.com/ [image: Linkedin
Profile] http://it.linkedin.com/in/andreabaccega [image: Facebook]
https://www.facebook.com/andrea.baccega [image: Google+]
https://plus.google.com/109217393200753135791 [image: Twitter]
http://twitter.com/veke87 [image: StackOverflow]
http://stackoverflow.com/users/314407/andrea-baccega [image: GitHub]
https://github.com/vekexasia

@mahermeg17
Copy link
Contributor Author

waiting for the pull acceptation :)

@vekexasia
Copy link
Owner

Done, will release it today :) thank you and sorry for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants