Skip to content

Commit

Permalink
The app name can only contain letters, numbers and underscores.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjj1024 committed Feb 20, 2025
1 parent 708eca9 commit f369ac3
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pakeplus",
"private": true,
"version": "0.5.2",
"version": "0.5.3",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
3 changes: 2 additions & 1 deletion src/lang/en_us.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export default {
urlInvalid: 'The url must start with http',
example: 'example',
appName: 'AppName',
appNameInvalid: 'The app name cannot start with a digit',
appNameInvalid:
'The app name can only contain letters, numbers and underscores.',
appId: 'Identifier',
appIdInvalid: 'The appid must be alphanumeric and dot',
appIcon: 'AppIcon',
Expand Down
2 changes: 1 addition & 1 deletion src/lang/ja_jp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default {
urlInvalid: 'urlはhttpで始まる必要があります',
example: '例',
appName: 'アプリ名',
appNameInvalid: 'アプリ名は数字で始めることはできません',
appNameInvalid: 'アプリ名は英数字と_で構成されている必要があります',
appId: 'アプリID',
appIdInvalid: 'アプリIDは英数字と.で構成されている必要があります',
appIcon: 'アプリアイコン',
Expand Down
2 changes: 1 addition & 1 deletion src/lang/ko_kr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {
urlInvalid: 'url은 http로 시작해야 합니다',
example: '예',
appName: '앱 이름',
appNameInvalid: '앱 이름은 숫자로 시작할 수 없습니다',
appNameInvalid: '앱 이름은 영어 숫자와 _로만 구성되어야 합니다',
appId: '앱 ID',
appIdInvalid: '앱 ID는 영어 숫자와 .로 구성되어야 합니다',
appIcon: '앱 아이콘',
Expand Down
2 changes: 1 addition & 1 deletion src/lang/zh_cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default {
urlInvalid: 'url必须以http开头',
example: '例如',
appName: 'APP名称',
appNameInvalid: 'APP名称不能以数字开头',
appNameInvalid: 'APP名称只能包含字母、数字和下划线',
appId: 'APP标识',
appIdInvalid: 'appid必须为字母、数字和.组成',
appIcon: 'APP图标',
Expand Down
2 changes: 1 addition & 1 deletion src/lang/zh_tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default {
urlInvalid: 'url必須以http開頭',
example: '例如',
appName: 'APP名稱',
appNameInvalid: 'APP名稱不能以數字開頭',
appNameInvalid: 'APP名稱只能包含字母、數字和下劃線',
appId: 'APP標識',
appIdInvalid: 'appid必須為字母、數字和.組成',
appIcon: 'APP圖標',
Expand Down
7 changes: 6 additions & 1 deletion src/pages/edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,12 @@ const appRules = reactive<FormRules>({
// console.log('appshow name value', value)
// the name cannot start with a digit
// the name cannot contain special characters
if (/^[0-9]/.test(value) || value.includes(' ')) {
// the name cannot include chinese characters
if (
/^[0-9]/.test(value) ||
value.includes(' ') ||
/[\u4e00-\u9fa5]/.test(value)
) {
callback(new Error(t('appNameInvalid')))
} else {
callback()
Expand Down

0 comments on commit f369ac3

Please sign in to comment.