-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add globalization #2407
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
Add globalization #2407
Conversation
1a466e5 to
21aceb2
Compare
257e731 to
d9c538b
Compare
| var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | ||
|
|
||
| UserModel.validatesFormatOf('email', { with: re, message: 'Must provide a valid email' }); | ||
| UserModel.validatesFormatOf('email', { with: re, message: g.f('Must provide a valid email') }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regexp is one of the challenges for globalization. In short, it does not work because the word order in sentences varies from language to language. This case requires careful refactoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message option is just the error string returned if the regex fails, it is not part of the regex.
| }); | ||
| } else { | ||
| fn(new Error('must specify an id or data')); | ||
| fn(new Error(g.f('must specify an id or data'))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{id}}
|
LGTM |
|
|
||
| setRemoting(PersistedModel, 'findById', { | ||
| description: 'Find a model instance by id from the data source.', | ||
| description: g.f('Find a model instance by id from the data source.'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{id}}
f6a5f9f to
75c8f1d
Compare
|
@0candy a few nitpick comments. Other than that LGTM. 👍 |
* Revert globalization of Swagger descriptions (Miroslav Bajtoš) * Expose `Replace*` methods (Amir Jafarian) * Add bcrypt validation (Loay) * Cache remoting descriptions to speed up tests (Miroslav Bajtoš) * Revert globalization of assert() messages (Miroslav Bajtoš) * Fix token middleware to not trigger CLS init (Miroslav Bajtoš) * common: add KeyValueModel (Miroslav Bajtoš) * Globalize current-context deprecation messages (Miroslav Bajtoš) * Deprecate current-context API (Miroslav Bajtoš) * test: increase timeout to prevent CI failures (Miroslav Bajtoš) * Backport of #2407 (Candy) * test: fix timeout in rest.middleware.test (Miroslav Bajtoš) * test: fix "socket hang up" error in app.test (Miroslav Bajtoš) * test: increate timeout in Role test (Miroslav Bajtoš) * test: make status test more robust (Miroslav Bajtoš) * test: fix broken Role tests (Miroslav Bajtoš) * Update dependencies to their latest versions (Miroslav Bajtoš) * Increase timeout (jannyHou) * Backport of #2565 (Miroslav Bajtoš) * Avoid calling deprecated methds (Amir Jafarian) * test: use local registry in test fixtures (Miroslav Bajtoš) * Fix test case error (Loay) * Backport/Fix security issue 580 (Loay)
Connect to https://github.com/strongloop-internal/scrum-loopback/issues/910
Connect to #2422