-
Notifications
You must be signed in to change notification settings - Fork 26
controller: support for non-English user. #114
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
base: main
Are you sure you want to change the base?
Conversation
Thank you so much for the PR! 1. Use @pragma to name a storyThis is a good idea. However, we need to add a prefix to make it future proof. We plan on using annotations on stories in the future so I want to make sure this change won't clash with any future work. Here is what I have in mind. Use the pragma hint @pragma('monarch:name', 'some colorful card')
Widget someCardWithSomeColor() => Card(...);
@pragma('monarch:name', '测试')
Widget mediumCard() => const Center(...); In the future, the pragma hint @pragma('monarch:name', 'some colorful card')
@pragma('monarch:tags', ['cards', 'login'])
@pragma('monarch:ios-only')
Widget someCardWithSomeColor() => Card(...);
// or use a strongly typed annotation like:
@MonarchStory(name: 'some colorful card', tags: ['cards', 'login'], iosOnly: true)
Widget someCardWithSomeColor() => Card(...); 2. Removal of
|
Thank you for reply, the PR for the removal of The only reason I choose the @pragma annotation is that it is built-in, but if user need to add a prefix like @pragma('monarch:name', 'some colorful card'), I think it is a bit cumbersome, maybe use strongly typed annotation will be better, and I hope that when |
I also like the @pragma annotation for that reason. It is super simple to use. That is good. I also think the prefix is a bit cumbersome. However, it is necessary for now because I don't know how the API will evolve in the future. I want users to use pragma without any hints. That is super simple. However, I don't know if users will want to use pragma to do human friendly story names or to organize their stories with tags or to do something else we will discover. For example, I know some users who want to organize their stories using tags or categories:
It feels risky to assume the most common use of the pragma annotation will be what you are proposing. It may turn out to be that way but I rather be explicit for now. The strongly type annotation would be nice and it will come later too. PS. I hope to have some time to fully review and test your changes next week. |
First of all, thanks for this wonderful tool.
This pr optimizes the experience of non-English users, including the following two optimizations:
Optimization effect: