feat: add normalization helper functions and integrate into services

- Introduced new helper functions for string and date normalization, enhancing input validation across various services.
- Updated SiteSettingService and SystemSettingService to utilize the new normalization functions for improved data handling.
- Refactored existing code to replace custom normalization logic with the new helper methods, ensuring consistency and reducing redundancy.
- Enhanced localization files to support new error messages related to normalization.

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2025-11-22 01:21:26 +08:00
parent f0678038c2
commit 9095bb08c8
36 changed files with 5273 additions and 340 deletions

View File

@@ -278,9 +278,14 @@
"photos.storage.managed.actions.cancel": "Cancel managed storage",
"photos.storage.managed.actions.current": "Current plan",
"photos.storage.managed.actions.loading": "Updating…",
"photos.storage.managed.actions.make-active": "Make active",
"photos.storage.managed.actions.make-inactive": "Make inactive",
"photos.storage.managed.actions.manage": "Manage billing",
"photos.storage.managed.actions.retry": "Try again",
"photos.storage.managed.actions.subscribe": "Subscribe",
"photos.storage.managed.actions.subscribed": "Subscribed",
"photos.storage.managed.actions.switch": "Switch to this plan",
"photos.storage.managed.actions.upgrade": "Upgrade",
"photos.storage.managed.capacity.label": "Storage capacity: {{value}}",
"photos.storage.managed.capacity.unknown": "Capacity information is not available.",
"photos.storage.managed.capacity.unlimited": "Unlimited storage capacity",
@@ -291,7 +296,12 @@
"photos.storage.managed.price.label": "{{price}} / month",
"photos.storage.managed.provider": "Backed by provider {{provider}}",
"photos.storage.managed.title": "Managed storage",
"photos.storage.managed.toast.checkout-failure": "Unable to start checkout, please try again.",
"photos.storage.managed.toast.checkout-unavailable": "Managed storage checkout is unavailable right now.",
"photos.storage.managed.toast.error": "Failed to update managed storage: {{reason}}",
"photos.storage.managed.toast.missing-checkout-url": "Checkout URL is missing.",
"photos.storage.managed.toast.missing-portal-url": "Portal URL is missing.",
"photos.storage.managed.toast.portal-failure": "Unable to open billing portal, please try again.",
"photos.storage.managed.toast.success": "Managed storage plan updated.",
"photos.storage.managed.unavailable": "Managed storage hasnt been enabled for this workspace yet.",
"photos.sync.actions.button.apply": "Sync photos",

View File

@@ -278,9 +278,14 @@
"photos.storage.managed.actions.cancel": "取消托管存储",
"photos.storage.managed.actions.current": "当前方案",
"photos.storage.managed.actions.loading": "处理中…",
"photos.storage.managed.actions.make-active": "启用",
"photos.storage.managed.actions.make-inactive": "停用",
"photos.storage.managed.actions.manage": "管理账单",
"photos.storage.managed.actions.retry": "重试",
"photos.storage.managed.actions.subscribe": "立即订阅",
"photos.storage.managed.actions.subscribed": "已订阅",
"photos.storage.managed.actions.switch": "切换到此方案",
"photos.storage.managed.actions.upgrade": "升级方案",
"photos.storage.managed.capacity.label": "可用容量:{{value}}",
"photos.storage.managed.capacity.unknown": "暂无法获取该方案的容量信息。",
"photos.storage.managed.capacity.unlimited": "容量无限制",
@@ -291,7 +296,12 @@
"photos.storage.managed.price.label": "{{price}} / 月",
"photos.storage.managed.provider": "托管服务提供方:{{provider}}",
"photos.storage.managed.title": "托管存储",
"photos.storage.managed.toast.checkout-failure": "无法拉起支付,请稍后再试。",
"photos.storage.managed.toast.checkout-unavailable": "当前无法发起托管存储的支付。",
"photos.storage.managed.toast.error": "更新托管存储方案失败:{{reason}}",
"photos.storage.managed.toast.missing-checkout-url": "缺少结账链接,稍后再试。",
"photos.storage.managed.toast.missing-portal-url": "缺少账单门户链接,稍后再试。",
"photos.storage.managed.toast.portal-failure": "无法打开账单门户,请稍后再试。",
"photos.storage.managed.toast.success": "托管存储方案已更新。",
"photos.storage.managed.unavailable": "托管存储尚未启用,请联系管理员。",
"photos.sync.actions.button.apply": "同步照片",