Skip to content

Commit

Permalink
perf: Modify i18 file format to JSON (#3171)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaowoxiaobala authored Oct 18, 2023
1 parent 0cf79d4 commit c24e0ef
Show file tree
Hide file tree
Showing 33 changed files with 1,052 additions and 1,172 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"i18n-ally.sortKeys": true,
"i18n-ally.namespace": true,
"i18n-ally.pathMatcher": "{locale}/{namespaces}.{ext}",
"i18n-ally.enabledParsers": ["ts"],
"i18n-ally.enabledParsers": ["json"],
"i18n-ally.sourceLanguage": "en",
"i18n-ally.displayLanguage": "zh-CN",
"i18n-ally.enabledFrameworks": ["vue", "react"],
Expand Down
2 changes: 1 addition & 1 deletion src/locales/lang/en.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { genMessage } from '../helper';
import antdLocale from 'ant-design-vue/es/locale/en_US';

const modules = import.meta.glob('./en/**/*.ts', { eager: true });
const modules = import.meta.glob('./en/**/*.json', { eager: true });
export default {
message: {
...genMessage(modules as Recordable<Recordable>, 'en'),
Expand Down
17 changes: 17 additions & 0 deletions src/locales/lang/en/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"okText": "OK",
"closeText": "Close",
"cancelText": "Cancel",
"loadingText": "Loading...",
"saveText": "Save",
"delText": "Delete",
"resetText": "Reset",
"searchText": "Search",
"queryText": "Search",
"inputText": "Please enter ",
"chooseText": "Please choose ",
"redo": "Refresh",
"back": "Back",
"light": "Light",
"dark": "Dark"
}
20 changes: 0 additions & 20 deletions src/locales/lang/en/common.ts

This file was deleted.

124 changes: 124 additions & 0 deletions src/locales/lang/en/component.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"app": {
"searchNotData": "No search results yet",
"toSearch": "to search",
"toNavigate": "to navigate"
},
"countdown": {
"normalText": "Get SMS code",
"sendText": "Reacquire in {0}s"
},
"cropper": {
"selectImage": "Select Image",
"uploadSuccess": "Uploaded success!",
"imageTooBig": "Image too big",
"modalTitle": "Avatar upload",
"okText": "Confirm and upload",
"btn_reset": "Reset",
"btn_rotate_left": "Counterclockwise rotation",
"btn_rotate_right": "Clockwise rotation",
"btn_scale_x": "Flip horizontal",
"btn_scale_y": "Flip vertical",
"btn_zoom_in": "Zoom in",
"btn_zoom_out": "Zoom out",
"preview": "Preivew"
},
"drawer": {
"loadingText": "Loading...",
"cancelText": "Close",
"okText": "Confirm"
},
"excel": {
"exportModalTitle": "Export data",
"fileType": "File type",
"fileName": "File name"
},
"form": {
"putAway": "Put away",
"unfold": "Unfold",
"maxTip": "The number of characters should be less than {0}",
"apiSelectNotFound": "Wait for data loading to complete..."
},
"icon": {
"placeholder": "Click the select icon",
"search": "Search icon",
"copy": "Copy icon successfully!"
},
"menu": {
"search": "Menu search"
},
"modal": {
"cancelText": "Close",
"okText": "Confirm",
"close": "Close",
"maximize": "Maximize",
"restore": "Restore"
},
"table": {
"settingDens": "Density",
"settingDensDefault": "Default",
"settingDensMiddle": "Middle",
"settingDensSmall": "Compact",
"settingColumn": "Column settings",
"settingColumnShow": "Column display",
"settingIndexColumnShow": "Index Column",
"settingSelectColumnShow": "Selection Column",
"settingFixedLeft": "Fixed Left",
"settingFixedRight": "Fixed Right",
"settingFullScreen": "Full Screen",
"index": "Index",
"total": "total of {total}"
},
"time": {
"before": " ago",
"after": " after",
"just": "just now",
"seconds": " seconds",
"minutes": " minutes",
"hours": " hours",
"days": " days"
},
"tree": {
"selectAll": "Select All",
"unSelectAll": "Cancel Select",
"expandAll": "Expand All",
"unExpandAll": "Collapse all",
"checkStrictly": "Hierarchical association",
"checkUnStrictly": "Hierarchical independence"
},
"upload": {
"save": "Save",
"upload": "Upload",
"imgUpload": "ImageUpload",
"uploaded": "Uploaded",
"operating": "Operating",
"del": "Delete",
"download": "download",
"saveWarn": "Please wait for the file to upload and save!",
"saveError": "There is no file successfully uploaded and cannot be saved!",
"preview": "Preview",
"choose": "Select the file",
"accept": "Support {0} format",
"acceptUpload": "Only upload files in {0} format",
"maxSize": "A single file does not exceed {0}MB ",
"maxSizeMultiple": "Only upload files up to {0}MB!",
"maxNumber": "Only upload up to {0} files",
"legend": "Legend",
"fileName": "File name",
"fileSize": "File size",
"fileStatue": "File status",
"startUpload": "Start upload",
"uploadSuccess": "Upload successfully",
"uploadError": "Upload failed",
"uploading": "Uploading",
"uploadWait": "Please wait for the file upload to finish",
"reUploadFailed": "Re-upload failed files"
},
"verify": {
"error": "verification failed!",
"time": "The verification is successful and it takes {time} seconds!",
"redoTip": "Click the picture to refresh",
"dragText": "Hold down the slider and drag",
"successText": "Verified"
}
}
130 changes: 0 additions & 130 deletions src/locales/lang/en/component.ts

This file was deleted.

Loading

0 comments on commit c24e0ef

Please sign in to comment.