feat: refactor message handling to use MessageName constants for improved internationalisation support

This commit is contained in:
siujamo
2026-03-24 12:23:13 +08:00
parent 776ddd28c1
commit 08c18fea90
33 changed files with 391 additions and 152 deletions
+2
View File
@@ -27,6 +27,8 @@ spring:
hikari:
minimum-idle: 1
maximum-pool-size: 10
messages:
basename: i18n/messages
flyway:
enabled: true
baseline-on-migrate: true
+20 -2
View File
@@ -19,10 +19,28 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
tree.multiple-roots=
user.not-found=User with ID [{0}] not found.
security.context-user-not-found=Cannot retrieve user information from security context.
role.not-exists=Role does not exist in database.
captcha.generate-failed=
auth.provider.password-not-configured=Username or password is incorrect.
auth.provider.bad-credentials=Username or password is incorrect.
auth.provider.failed=Authentication failed, please try again later.
auth.login.failed=Cannot perform login due to server error.
auth.login.captcha-incorrect=Captcha is incorrect.
auth.login.captcha-not-found=Captcha not found.
authority.not-found=Authority with ID [{0}] not found.
authority.code-used=Authority code [{0}] is already in use.
asset.upload-failed=Failed to upload file: {0}
asset.delete-forbidden=You are not able to delete an asset that is not uploaded by you.
asset.invalid-prefix=Prefix must not be empty and must not start with '/' or '..'.
asset.not-empty = File cannot be empty.
authority.deleted = Authority [{0}] deleted.
user.password-reset-success = Password has been reset.
user.deleted = User [{0}] deleted.
user.deleted = User [{0}] deleted.
role.not-found=Role with ID {0} not found.
role.deleted=Role [{0}] deleted.
request.role.name.not-empty=Name of the role cannot be empty.
@@ -21,8 +21,56 @@
#
asset.not-empty = File cannot be empty.
asset.invalid-prefix = Prefix must not be empty and must not start with '/' or '..'.
asset.delete-forbidden = You are not able to delete an asset that is not uploaded by you.
asset.upload-failed = Failed to upload file: {0}
authority.deleted = Authority [{0}] deleted.
authority.code-used = Authority code [{0}] is already in use.
authority.not-found = Authority with ID [{0}] not found.
auth.login.captcha-not-found = Captcha not found.
auth.login.captcha-incorrect = Captcha is incorrect.
auth.login.failed = Cannot perform login due to server error.
auth.provider.failed = Authentication failed, please try again later.
auth.provider.bad-credentials = Username or password is incorrect.
auth.provider.password-not-configured = Password is not configured. Please sign in with a third-party account.
captcha.generate-failed = Unable to generate captcha image.
role.not-exists = Role does not exist in database.
role.not-found = Role with ID {0} not found.
role.deleted = Role [{0}] deleted.
user.password-reset-success = Password has been reset.
user.deleted = User [{0}] deleted.
user.deleted = User [{0}] deleted.
user.not-found = User with ID [{0}] not found.
security.context-user-not-found = Cannot retrieve user information from security context.
tree.multiple-roots = Multiple root items found in given values.
request.add-user.username.not-empty = Username cannot be empty.
request.add-user.password.not-empty = Password cannot be empty.
request.add-user.full-name.not-empty = Full name cannot be empty.
request.authority.code.not-editable = Code cannot be edited.
request.authority.code.not-null = Code cannot be null.
request.authority.name.not-null = Name of the authority cannot be null.
request.department.name.not-null = Name of the department should not be null.
request.edit-role.id.not-null = Role ID cannot be null.
request.edit-role.status.invalid = Status can only be ACTIVE or INACTIVE.
request.edit-user.id.not-null = User ID cannot be null.
request.edit-user.id.positive = User ID must be positive.
request.reset-password.password.not-empty = Password cannot be empty.
request.role.name.not-empty = Name of the role cannot be empty.
request.role.code.not-empty = Code of the role cannot be empty.
request.role.sort.not-null = Sort number cannot be null.
request.query-role.status.invalid = Status can only be ACTIVE or INACTIVE.
request.query-user.status.invalid = Status can only be ACTIVE, INACTIVE, or LOCKED.
@@ -21,8 +21,56 @@
#
asset.not-empty = 文件不能为空。
asset.invalid-prefix = 前缀不能为空,且不能以 '/' 或 '..' 开头。
asset.delete-forbidden = 你不能删除非自己上传的文件。
asset.upload-failed = 文件上传失败:{0}
authority.deleted = 权限【{0}】删除成功。
authority.code-used = 权限编码【{0}】已被使用。
authority.not-found = 找不到 ID 为【{0}】的权限。
auth.login.captcha-not-found = 未找到验证码。
auth.login.captcha-incorrect = 验证码错误。
auth.login.failed = 登录失败,服务器出现错误。
auth.provider.failed = 用户认证失败,请稍后再试。
auth.provider.bad-credentials = 用户名或密码错误。
auth.provider.password-not-configured = 你还没有配置密码,请使用第三方账号登录。
captcha.generate-failed = 无法生成验证码图片。
role.not-exists = 角色不存在。
role.not-found = 找不到 ID 为 {0} 的角色。
role.deleted = 角色【{0}】删除成功。
user.password-reset-success = 密码修改成功。
user.deleted = 用户【{0}】删除成功。
user.deleted = 用户【{0}】删除成功。
user.not-found = 找不到 ID 为【{0}】的用户信息。
security.context-user-not-found = 无法从安全上下文中获取用户信息。
tree.multiple-roots = 数据中包含多个根节点。
request.add-user.username.not-empty = 用户名不能为空。
request.add-user.password.not-empty = 密码不能为空。
request.add-user.full-name.not-empty = 姓名不能为空。
request.authority.code.not-editable = 权限编码不可修改。
request.authority.code.not-null = 权限编码不能为空。
request.authority.name.not-null = 权限名称不能为空。
request.department.name.not-null = 部门名称不能为空。
request.edit-role.id.not-null = 角色 ID 不能为空。
request.edit-role.status.invalid = 状态只能是 ACTIVE 或 INACTIVE。
request.edit-user.id.not-null = 用户 ID 不能为空。
request.edit-user.id.positive = 用户 ID 必须为正数。
request.reset-password.password.not-empty = 密码不能为空。
request.role.name.not-empty = 角色名称不能为空。
request.role.code.not-empty = 角色编码不能为空。
request.role.sort.not-null = 排序编号不能为空。
request.query-role.status.invalid = 状态只能是 ACTIVE 或 INACTIVE。
request.query-user.status.invalid = 状态只能是 ACTIVE、INACTIVE 或 LOCKED。