-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Validator message format #1051
Validator message format #1051
Conversation
Have you meant ICU instead of ITU? |
Yeah, of course :) |
they are not responsible for i18n ;)
It seeems there's a lot of duplication between |
It is quite duplicated but the error messages are not that nice anymore when we just use format in translate. |
Let me merge it first. Good job! |
I refactored the code as @samdark suggested. The large chunk of duplicated code is not good. For this reason, we can tolerate the less perfect error message. I also think perhaps we should reorganize/redesign the current
What do you think? |
Why? Imo having |
@qiangxue what's the con to have MessageFormatter extended as it is now? |
Ok, we can keep The current The design of |
You can use the MessageFormatter or FallbackMessageformatter alone if you want. There is just no sense in using the fallback one as Messageformatter already checks for intl extension installed. whats the problem with phar? |
This is what I proposed: https://gist.github.com/qiangxue/6641b25650d8699952ba |
@qiangxue why |
Extending Component is fine as it is a yii class. idea looks okay to me. fallback handling is not correct though. |
@cebe but it's not used anywhere: there are no events, behaviors, getters or setters. Also it's not used as a component. |
This is just a 5-minute work to explain the idea. The class can extend from |
I think provided idea is better than current solution. Will handle it together with #1062. |
Fixes #991.
ICU message format is now available for gridview summary and all validator messages.
It is not available for client validation as some params are added in JS.