refactor(frontend): modulize locale

This commit is contained in:
Qincheng Zheng 2023-10-29 15:40:00 +08:00
parent 30268e9048
commit 4c7021c615
32 changed files with 1385 additions and 1464 deletions

View File

@ -0,0 +1,24 @@
{
"name": "@beiming-system/locale",
"version": "0.0.0",
"type": "module",
"files": [
"dist"
],
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"./*": "./dist/*"
},
"scripts": {
"build": "tsup src/*.ts",
"dev": "tsup src/*.ts --watch",
"prepublishOnly": "npm run build"
}
}

View File

@ -0,0 +1,4 @@
export default {
ShowVerified: "Show verified learnwares",
ShowUnverified: "Show unverified learnwares",
};

View File

@ -0,0 +1,12 @@
export default {
ChangePassword: "Change Password",
OldPassword: "Old Password",
NewPassword: "New Password",
ConfirmNewPassword: "Confirm New Password",
Change: "Change",
Success: "Password changed successfully",
Error: {
NewPasswordAtLeast8Chars: "New password needs to be at least 8 characters.",
NewPasswordNotMatch: "The two new passwords you entered do not match.",
},
};

View File

@ -0,0 +1,5 @@
export default {
Title: "Client Token",
Description: "Tokens you have generated that can be used to access the learnware api.",
Generate: "Generate",
};

View File

@ -0,0 +1,49 @@
export default {
Cover: {
SmallModelsDo: "Small models do",
Big: "Big",
Slogan:
"Learnware paradigm systematically reuses numerous various models to do things that may even be beyond their original purposes, and enables users to easily identify and reuse helpful models, not need to build their models from scratch.",
Try: "Try It Out",
Submit: "Be A Developer",
},
What: {
Title: "What is Learnware?",
Description:
"A learnware is a well-performed trained machine learning model with a specification which enables it to be adequately identified to reuse according to the requirement of future users who know nothing about the learnware in advance.",
},
Why: {
Title: "Why do we need learnware?",
Description:
"There are complaints about current machine learning techniques such as the requirement of a huge amount of training data and proficient training skills, the difficulty of continual learning, the risk of catastrophic forgetting, the leaking of data privacy/proprietary, etc.",
LackOfTrainingDataSkills: "Lack of training data/skills",
LackOfTrainingDataSkillsDescription:
"Strong machine learning models can be attained even for ordinary users with little training skills or small data, because the users can adapte or refine well-performed learnwares rather than building a model from scratch by themselves.",
ContinualLearning: "Continual learning",
ContinualLearningDescription:
"The learnware market naturally realizes continual and lifelong learning, because with the constant submissions of well-performed learnwares trained from diverse tasks, the knowledge held in the learnware market is being continually enriched.",
CatastrophicForgetting: "Catastrophic forgetting",
CatastrophicForgettingDescription:
"A learnware will always be accommodated in the learnware market once it is accepted, unless every aspect of its function can be replaced by other learnwares. Thus, the old knowledge in the learnware market is always held. Nothing to be forgotten.",
DataPrivacyProprietary: "Data privacy/proprietary",
DataPrivacyProprietaryDescription:
"The developers only submit their models without sharing their own data, and thus, the data privacy/proprietary can be well preserved. Although one could not deny the possibility of reverse engineering the models, the risk would be too small compared with many other privacy-preserving solutions.",
},
How: {
Title: "How does learnware work?",
Description:
"There are three important entities: developers, users, and the market. The developers are usually machine learning experts who produce and want to share/sell their well-performed trained machine learning models. The users need machine learning services but usually have only limited data and lack machine learning knowledge and skills. The learnware market accepts/buys well-performed trained models from developers, accommodates them in the market, and provides/sells services to users via identifying and reusing learnwares to help users tackle their present tasks.",
},
SpecificationWorld: {
Title: "Specification world",
Description:
"Note that the specification islands, corresponding to models from different feature/label spaces, can be merged if their connections are discovered and established.",
},
Footer: {
About: "About",
Github: "Github",
ContactUs: "Contact Us",
RightClickToCopy: "Right click to copy",
AllRightsReserved: "All rights reserved",
},
};

View File

@ -0,0 +1,27 @@
import Page from "./page";
import Home from "./home";
import Login from "./login";
import Register from "./register";
import ChangePassword from "./changePassword";
import ClientToken from "./clientToken";
import Submit from "./submit";
import Search from "./search";
import AllLearnware from "./allLearnware";
import Learnware from "./learnware";
import Public from "./public";
import LearnwareDetail from "./learnwareDetail";
export default {
Page,
Home,
Login,
Register,
ChangePassword,
ClientToken,
Submit,
Search,
AllLearnware,
Learnware,
Public,
LearnwareDetail,
};

View File

@ -0,0 +1,3 @@
export default {
OopsThereNoLearnware: "Oops! There is no learnware.",
};

View File

@ -0,0 +1,9 @@
export default {
VerifyStatus: {
VerifyStatus: "Verify Status",
SUCCESS: "SUCCESS",
Unverified: "UNVERIFIED",
},
Logs: "Logs",
LastModified: "Last Modified",
};

View File

@ -0,0 +1,13 @@
export default {
Login: "Login",
Email: "E-mail",
Password: "Password",
NoAccount: "Don't have an accounut?",
RegisterFirst: "Register first",
ResetPassword: "Reset Password",
Success: "Login successfully",
Error: {
InvalidEmail: "Invalid e-mail address",
PasswordAtLeast8Chars: "Password needs to be at least 8 characters.",
},
};

View File

@ -0,0 +1,24 @@
export default {
Home: "Home",
Search: "Search",
Submit: "Submit",
Docs: "Docs",
User: {
User: "User",
Login: "Login",
Register: "Register",
ChangePassword: "Change Password",
MyLearnware: "My Learnware",
ClientToken: "Client Token",
Logout: "Logout",
},
Language: {
Language: "Language",
Chinese: "中文",
English: "English",
},
LearnwareDetail: "Learnware Detail",
Summary: "Summary",
Learnwares: "All Learnwares",
Users: "All Users",
};

View File

@ -0,0 +1,3 @@
export default {
Description: "Description",
};

View File

@ -0,0 +1,18 @@
export default {
Register: "Register",
Username: "Username",
Email: "E-mail",
Password: "Password",
ConfirmPassword: "Confirm Password",
SentEmail:
"We have sent an email with a confirmation link to your email address. Please follow the link in the email.",
Resend: "Resend",
Close: "Close",
Error: {
UsernameAtLeast2Chars: "Username needs to be at least 2 characters.",
InvalidEmail: "Invalid e-mail address",
PasswordAtLeast8Chars: "Password needs to be at least 8 characters.",
PasswordNotEmpty: "Password must not be empty.",
PasswordNotMatch: "The two passwords you entered do not match.",
},
};

View File

@ -0,0 +1,7 @@
export default {
Search: "Search",
ChooseSemanticRequirement: "Choose semantic requirement",
SearchByName: "Search by name",
LearnwareName: "Learnware Name",
UploadStatisticalRequirement: "Upload statistical requirement",
};

View File

@ -0,0 +1,130 @@
export default {
Step: "Step",
Name: {
Name: "Name",
Title: "Type the name of your learnware",
Placeholder: "Please type the name of your learnware",
Description: "This is the name of your learnware you will submit",
Error: {
AtLeast5Chars: "Learnware name needs to be at least 5 characters.",
},
},
Tag: {
Tag: "Tag",
Title: "Choose the tags (semantic specification)",
DataType: {
DataType: "Data Type",
Error: {
NotEmpty: "Data type must not be empty.",
},
Type: {
Table: "Table",
Image: "Image",
Text: "Text",
Audio: "Audio",
Video: "Video",
},
DescriptionInput: {
Name: "Feature",
Description: "Description",
FeatureTips:
"Fill in the description for each feature on the left or paste a JSON object on the right. Clarifying the description for each feature will help your learnware to be available for tasks with hetergenous feature space.",
FeatureTipsSmall:
"Fill in the description for each feature or paste a JSON object. Clarifying the description for each feature will help your learnware to be available for tasks with hetergenous feature space.",
},
},
TaskType: {
TaskType: "Task Type",
Error: {
NotEmpty: "Task type must not be empty.",
},
Type: {
Classification: "Classification",
Regression: "Regression",
Clustering: "Clustering",
Ranking: "Ranking",
ObjectDetection: "Object Detection",
FeatureExtraction: "Feature Extraction",
Segmentation: "Segmentation",
Others: "Others",
OtherTask: "Other Task",
},
DescriptionOutput: {
Name: "Label",
Description: "Description",
LabelTips:
"Fill in the description for each label on the left or paste a JSON object on the right. Clarifying the description for each label will help your learnware to be available for tasks with hetergenous label space.",
LabelTipsSmall:
"Fill in the description for each label or paste a JSON object. Clarifying the description for each label will help your learnware to be available for tasks with hetergenous label space.",
},
},
LibraryType: {
LibraryType: "Library Type",
Error: {
NotEmpty: "Library type must not be empty.",
},
Type: {
PyTorch: "PyTorch",
TensorFlow: "TensorFlow",
"Scikit-learn": "Scikit-learn",
Others: "Others",
OtherLibrary: "Other Library",
},
},
Scenario: {
Scenario: "Scenario",
Type: {
Business: "Business",
Financial: "Financial",
Health: "Health",
Politics: "Politics",
Computer: "Computer",
Internet: "Internet",
Traffic: "Traffic",
Nature: "Nature",
Fashion: "Fashion",
Industry: "Industry",
Agriculture: "Agriculture",
Education: "Education",
Entertainment: "Entertainment",
Architecture: "Architecture",
},
},
},
Description: {
Description: "Description",
Title: "Type the description of your learnware",
Placeholder: "Please type the description of your learnware",
Error: {
AtLeast10Chars: "Description needs to be at least 10 characters.",
},
},
File: {
File: "File",
Title: "Upload your model & statistical specification",
DragFileHere: "Drag file here",
ClickHere: "Click here",
ForInstructionsOnHowToCreateTheRequiredZipFile:
"for instructions on how to create the required zip file",
ToDownloadTemplate: "to download a template",
YourOldLearnware: "Your old learnware",
Error: {
NoFile: "Please upload your model & statistical specification.",
NotZipFile: "Please upload a zip file.",
GreaterThan1GB: "Please upload a file smaller than 1GB.",
FileNotFound: "File {filename} not found",
FileNotJSON: "File {filename} is not a JSON file",
KeyNotFoundInFile: "Key '{key}' not found in file {filename}",
KeyEmptyInFile: "Key '{key}' is empty in file {filename}",
KeyNotFoundOrEmptyInFile: "Key '{key}' not found or empty in file {filename}",
KeyNotNonEmptyArrayInFile: "Key '{key}' is not an non-empty array in file {filename}",
},
},
Navigation: {
NextStep: "Next Step",
PreviousStep: "Previous Step",
Finish: "Finish",
},
Submiting: "Submiting, please wait...",
Success: "Submit successfully",
};

View File

@ -0,0 +1,2 @@
export { default as zh } from "./zh";
export { default as en } from "./en";

View File

@ -0,0 +1,4 @@
export default {
ShowVerified: "显示已验证学件",
ShowUnverified: "显示未验证学件",
};

View File

@ -0,0 +1,12 @@
export default {
ChangePassword: "修改密码",
OldPassword: "旧密码",
NewPassword: "新密码",
ConfirmNewPassword: "确认新密码",
Change: "修改",
Success: "密码修改成功",
Error: {
NewPasswordAtLeast8Chars: "新密码至少需要 8 个字符",
NewPasswordNotMatch: "两次输入的新密码不一致",
},
};

View File

@ -0,0 +1,5 @@
export default {
Title: "客户端令牌",
Description: "您已生成的可用于访问学件 API 的令牌。",
Generate: "生成",
};

View File

@ -0,0 +1,49 @@
export default {
Cover: {
SmallModelsDo: "小模型做",
Big: "大事",
Slogan:
"学件范式以系统化的方式复用大量不同的模型,以完成甚至可能超出其原始目标的任务,并使用户能够轻松识别和复用有帮助的模型,而无需从头开始构建模型。",
Try: "小试牛刀",
Submit: "大展身手",
},
What: {
Title: "学件是什么?",
Description:
"学件由性能优良的机器学习模型和描述模型的规约组成。规约刻画了模型的能力,使得模型能够在未来用户事先对学件一无所知的情况下被充分识别并复用,以满足用户需求。",
},
Why: {
Title: "我们为什么需要学件?",
Description:
"当前的机器学习技术面临着诸多问题,例如需要大量的训练数据和高超的训练技巧、持续学习的困难、灾难性遗忘的风险以及数据隐私/所有权的泄漏等。",
LackOfTrainingDataSkills: "缺乏训练数据/技能",
LackOfTrainingDataSkillsDescription:
"即使对于缺乏训练技能或数据量较小的普通用户,也可以获得强大的机器学习模型,因为用户可以调整或改进性能优良的学件,而不是自己从头开始构建模型。",
ContinualLearning: "持续学习",
ContinualLearningDescription:
"随着在各种不同任务上训练得到的、性能优良的学件被不断提交,学件市场中的知识将不断丰富,进而自然地实现持续和终身学习。",
CatastrophicForgetting: "灾难性遗忘",
CatastrophicForgettingDescription:
"一旦学件被接收,它将永远被容纳在学件市场中,除非其各方面功能都可以被其他学件所替代。因此,学件市场中的旧知识总是会被保留。什么都不会被遗忘。",
DataPrivacyProprietary: "数据隐私/所有权",
DataPrivacyProprietaryDescription:
"开发者只提交他们的模型而不共享自己的数据,因此数据隐私/所有权可以得到很好的保护。尽管无法完全排除对模型进行逆向工程的可能性,但与许多其它隐私保护方案相比,学件泄露隐私的风险非常小。",
},
How: {
Title: "学件是如何工作的?",
Description:
"学件范式中有三个重要的实体:开发者、用户和学件市场。开发者通常是机器学习专家,他们生产并希望分享/出售他们性能优良的机器学习模型。用户需要机器学习服务,但通常只拥有有限的数据,并且缺乏机器学习知识和技能。学件市场从开发者那里接收/购买性能优良的机器学习模型,将它们纳入市场,并通过识别和复用学件向用户提供/出售服务,以帮助用户解决当前的任务。",
},
SpecificationWorld: {
Title: "规约世界",
Description:
"不同的规约岛屿对应着来自不同特征/标记空间的模型,如果能够发现并建立不同岛屿之间的联系,那么相对应的规约岛屿将可以进行合并。",
},
Footer: {
About: "关于我们",
Github: "Github",
ContactUs: "联系我们",
RightClickToCopy: "右键复制",
AllRightsReserved: "版权所有",
},
};

View File

@ -0,0 +1,27 @@
import Page from "./page";
import Home from "./home";
import Login from "./login";
import Register from "./register";
import ChangePassword from "./changePassword";
import ClientToken from "./clientToken";
import Submit from "./submit";
import Search from "./search";
import AllLearnware from "./allLearnware";
import Learnware from "./learnware";
import Public from "./public";
import LearnwareDetail from "./learnwareDetail";
export default {
Page,
Home,
Login,
Register,
ChangePassword,
ClientToken,
Submit,
Search,
AllLearnware,
Learnware,
Public,
LearnwareDetail,
};

View File

@ -0,0 +1,3 @@
export default {
OopsThereNoLearnware: "哦豁,这里没有学件。",
};

View File

@ -0,0 +1,9 @@
export default {
VerifyStatus: {
VerifyStatus: "验证状态",
SUCCESS: "验证成功",
Unverified: "未验证",
},
Logs: "日志",
LastModified: "最后修改",
};

View File

@ -0,0 +1,13 @@
export default {
Login: "登录",
Email: "邮箱",
Password: "密码",
NoAccount: "没有账号?",
RegisterFirst: "请先注册",
ResetPassword: "重置密码",
Success: "登录成功",
Error: {
InvalidEmail: "邮箱格式不正确",
PasswordAtLeast8Chars: "密码至少需要 8 个字符",
},
};

View File

@ -0,0 +1,24 @@
export default {
Home: "首页",
Search: "查搜",
Submit: "提交",
Docs: "文档",
User: {
User: "用户",
Login: "登录",
Register: "注册",
ChangePassword: "修改密码",
MyLearnware: "我的学件",
ClientToken: "客户端令牌",
Logout: "登出",
},
Language: {
Language: "语言",
Chinese: "中文",
English: "English",
},
LearnwareDetail: "学件详情",
Summary: "概览",
Learnwares: "所有学件",
Users: "所有用户",
};

View File

@ -0,0 +1,3 @@
export default {
Description: "描述",
};

View File

@ -0,0 +1,17 @@
export default {
Register: "注册",
Username: "用户名",
Email: "邮箱",
Password: "密码",
ConfirmPassword: "确认密码",
SentEmail: "我们向您的邮箱发送了一封确认邮件,请点击邮件中的链接完成注册。",
Resend: "重新发送",
Close: "关闭",
Error: {
UsernameAtLeast2Chars: "用户名至少需要 2 个字符",
InvalidEmail: "邮箱格式不正确",
PasswordAtLeast8Chars: "密码至少需要 8 个字符",
PasswordNotEmpty: "密码不能为空",
PasswordNotMatch: "两次输入的密码不一致",
},
};

View File

@ -0,0 +1,7 @@
export default {
Search: "查搜",
ChooseSemanticRequirement: "选择语义需求",
SearchByName: "按名称查找",
LearnwareName: "学件名称",
UploadStatisticalRequirement: "上传统计需求",
};

View File

@ -0,0 +1,129 @@
export default {
Step: "步骤",
Name: {
Name: "名称",
Title: "输入学件名称",
Placeholder: "请输入学件名称",
Description: "这是您将提交的学件的名称",
Error: {
AtLeast5Chars: "学件名称至少需要 5 个字符",
},
},
Tag: {
Tag: "标签",
Title: "选择学件的标签(语义规约)",
DataType: {
DataType: "数据类型",
Error: {
NotEmpty: "数据类型不能为空",
},
Type: {
Table: "表格",
Image: "图像",
Text: "文本",
Audio: "音频",
Video: "视频",
},
DescriptionInput: {
Name: "特征",
Description: "描述",
FeatureTips:
"在左侧为每个特征填写描述,或在右侧粘贴 JSON 对象。澄清每个特征的描述将有助于您的学件适用于具有异构特征空间的任务。",
FeatureTipsSmall:
"为每个特征填写描述或粘贴 JSON 对象。澄清每个特征的描述将有助于您的学件适用于具有异构特征空间的任务。",
},
},
TaskType: {
TaskType: "任务类型",
Error: {
NotEmpty: "任务类型不能为空",
},
Type: {
Classification: "分类",
Regression: "回归",
Clustering: "聚类",
Ranking: "排序",
ObjectDetection: "目标检测",
FeatureExtraction: "特征提取",
Segmentation: "分割",
Others: "其他",
OtherTask: "其他任务",
},
DescriptionOutput: {
Name: "输出",
Description: "描述",
LabelTips:
"在左侧为每个输出维度填写描述,或在右侧粘贴 JSON 对象。澄清每个特征的描述将有助于您的学件适用于具有异构输出空间的任务。",
LabelTipsSmall:
"为每个输出维度填写描述或粘贴 JSON 对象。澄清每个特征的描述将有助于您的学件适用于具有异构输出空间的任务。",
},
},
LibraryType: {
LibraryType: "库类型",
Error: {
NotEmpty: "库类型不能为空",
},
Type: {
PyTorch: "PyTorch",
TensorFlow: "TensorFlow",
"Scikit-learn": "Scikit-learn",
Others: "其他",
OtherLibrary: "其他库",
},
},
Scenario: {
Scenario: "应用场景",
Type: {
Business: "商业",
Financial: "金融",
Health: "医疗",
Politics: "政治",
Computer: "计算机",
Internet: "互联网",
Traffic: "交通",
Nature: "自然",
Fashion: "时尚",
Industry: "工业",
Agriculture: "农业",
Education: "教育",
Entertainment: "娱乐",
Architecture: "建筑",
},
},
},
Description: {
Description: "描述",
Title: "输入学件的描述",
Placeholder: "请输入学件的描述",
Error: {
AtLeast10Chars: "描述至少需要 10 个字符",
},
},
File: {
File: "文件",
Title: "上传模型和统计规约",
DragFileHere: "拖拽文件到此处",
ClickHere: "点击此处",
ForInstructionsOnHowToCreateTheRequiredZipFile: "查看如何创建所需的 zip 文件",
ToDownloadTemplate: "下载模板学件",
YourOldLearnware: "您的旧学件文件",
Error: {
NoFile: "请上传模型和统计规约",
NotZipFile: "请上传 zip 文件",
GreaterThan1GB: "请上传小于 1GB 的文件",
FileNotFound: "找不到文件 {filename}",
FileNotJSON: "文件 {filename} 不是 JSON 文件",
KeyNotFoundInFile: "文件 {filename} 中找不到键 '{key}'",
KeyEmptyInFile: "文件 {filename} 中的键 '{key}' 为空",
KeyNotFoundOrEmptyInFile: "文件 {filename} 中的键 '{key}' 不存在或为空",
KeyNotNonEmptyArrayInFile: "文件 {filename} 中的键 '{key}' 不是非空数组",
},
},
Navigation: {
NextStep: "下一步",
PreviousStep: "上一步",
Finish: "完成",
},
Submiting: "正在上传,请等待...",
Success: "提交成功",
};

View File

@ -0,0 +1,3 @@
{
"extends": "../../tsconfig.json"
}

View File

@ -0,0 +1 @@
export { default } from "../../tsup.config";

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,7 @@
"@beiming-system/hooks": ["./packages/hooks/src/index.ts"], "@beiming-system/hooks": ["./packages/hooks/src/index.ts"],
"@beiming-system/types": ["./packages/types/src/index.ts"], "@beiming-system/types": ["./packages/types/src/index.ts"],
"@beiming-system/types/*": ["./packages/types/src/*"], "@beiming-system/types/*": ["./packages/types/src/*"],
"@beiming-system/locale": ["./packages/locale/src/index.ts"],
}, },
/* Bundler mode */ /* Bundler mode */