support parameterized errors

This commit is contained in:
MaysWind
2020-10-25 21:48:29 +08:00
parent 35eac86454
commit 9c0af9a1bd
6 changed files with 169 additions and 5 deletions
+19
View File
@@ -6,6 +6,9 @@ export default {
},
'error': {
'system error': 'System Error',
'incomplete or incorrect submission': 'Incomplete or incorrect submission',
'operation failed': 'Operation failed',
'nothing will be updated': 'Nothing will be updated',
'unauthorized access': 'Unauthorized access',
'token is expired': 'Token is expired',
'token is invalid': 'Token is invalid',
@@ -32,6 +35,22 @@ export default {
'two factor has already been enabled': 'Two factor has already been enabled',
'two factor backup code does not exist': 'Two factor backup code does not exist',
},
'parameter': {
'username': 'Username',
'password': 'Password',
'email': 'Email',
'nickname': 'Nickname',
},
'parameterizedError': {
'parameter invalid': '{parameter} is invalid',
'parameter required': '{parameter} is required',
'parameter too long': '{parameter} must be at most {length} characters',
'parameter too short': '{parameter} must be at least {length} characters',
'parameter length not equal': '{parameter} must be {length} characters',
'parameter cannot be blank': '{parameter} cannot be blank',
'parameter invalid username format': '{parameter} is invalid format',
'parameter invalid email format': '{parameter} is invalid format',
},
'OK': 'OK',
'Cancel': 'Cancel',
'Done': 'Done',