@itera-web/utils-locale-toggle 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
File without changes
package/README.md ADDED
@@ -0,0 +1 @@
1
+ ### [使用文档](http://iterative.keyboardecho.com/)
package/es/index.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ type LocaleKey = 'zh_CN' | 'en_US';
2
+ declare const Intl: {
3
+ init: (currentLocale?: LocaleKey, zhExt?: string[], enExt?: string[]) => Promise<void>;
4
+ v: (key?: string, option?: Record<string, any>) => string;
5
+ vHtml: (key?: string, option?: Record<string, any>) => string;
6
+ getAllLocals: () => {
7
+ key: LocaleKey;
8
+ label: string;
9
+ }[];
10
+ };
11
+ export { Intl, type LocaleKey };
package/es/index.js ADDED
@@ -0,0 +1 @@
1
+ import*as e from"react-intl-universal";var t={d:(e,a)=>{for(var o in a)t.o(a,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:a[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},a={};t.d(a,{R:()=>n});const o=(e=>{var a={};return t.d(a,e),a})({default:()=>e.default});var r={zh_CN:{zh_CN_List:["全部","是","否","男","女","有","无","提示","操作成功","系统异常","确定","取消","确定删除吗","请求超时","请求终止","加载中","数据加载中","小","中","大","特大","序号","查询","重置","当前 {page}-{pageSize}/共 {total}条","共 <em>{n}</em> 条","搜索","刷新","设置","全选","请输入","请选择","复制","参数说明","类型","默认值","是否必填","说明","返回值","收起","展开","参数","米","公里","起点","总长","关闭","缺省","中等","紧凑","回复","添加","高级搜索","保存","编辑行","编辑表格","已选择{count}项","取消选择","文件名称","文件大小","修改时间","文件夹","文档","视频","音频","图片","压缩","其他","宽度","颜色","橡皮","预览","清除","绘制","编辑签名","编辑","您没有访问此页面的权限","页面未找到","服务器发生错误","较大","较小","默认","密度","导出","查询表格","新增","操作","编辑【{title}】信息","切换开关","性别","上传图片","查看已上传图片","选择已上传图片","已上传图片","预览大图","确认删除","用户名","创建时间","删除","查看","首页","批量删除"],desc:"简体中文"},en_US:{en_US_List:["all","Yes","no","male","Female","Have","none","hint","Successful operation","System exception","Sure","Cancel","confirm to delete","Request timed out","Request to terminate","Loading","loading","Small","middle","Big","extra large","serial number","Inquire","reset","Current {page}-{pageSize}/total {total}","Total <em>{n}</em> entries","search","refresh","set up","select all","please enter","please choose","copy","Parameter Description","type","Defaults","Is it required","illustrate","return value","put away","Expand","parameter","Meter","kilometer","starting point","total length","closure","default","medium","compact","Reply","Add to","Advanced Search","Save","Edit Row","Edit Table","{count} items selected","deselect","File name","File size","Modification time","Folder","Document","Video","Audio","Image","Compression","Other","width","color","eraser","preview","clear","draw","edit signature","edit","You Do Not Have Permission to Access This Page","Page Not Found","Server Error","Larger","Smaller","Default","Density","Export","Query Table","Add","Action","Edit【{title}】Information","Toggle Switch","Gender","Upload Image","View Uploaded Images","Select Uploaded Images","Uploaded Images","Preview Image","Confirm Deletion","Username","Creation Time","Delete","View","Home Page","Batch Delete"],desc:"英文"}},i={},n={init:function(e,t,a){void 0===e&&(e="zh_CN"),void 0===t&&(t=[]),void 0===a&&(a=[]),r.zh_CN.zh_CN_List=(r.zh_CN.zh_CN_List||[]).concat(t),r.en_US.en_US_List=(r.en_US.en_US_List||[]).concat(a),i={};var n={currentLocale:e,locales:{}},l=[];(r.zh_CN.zh_CN_List||[]).forEach(function(e,t){var a="t_".concat(t);l.push(a),i[e]=a}),(r.en_US.en_US_List||[]).forEach(function(e,t){var a="t_".concat(t);l.push(a),i[e]=a});for(var c=function(e){var t=r[e]["".concat(e,"_List")]||[],a={};t.forEach(function(e,t){a[l[t]]=e}),n.locales[e]=a},s=0,d=Object.keys(r);s<d.length;s++){c(d[s])}return o.default.init(n)},v:function(e,t){return void 0===e&&(e=""),void 0===t&&(t={}),i[e]?o.default.get(i[e],t):e},vHtml:function(e,t){return void 0===e&&(e=""),void 0===t&&(t={}),i[e]?o.default.getHTML(i[e],t):""},getAllLocals:function(){return Object.keys(r).map(function(e){return{key:e,label:r[e].desc}})}},l=a.R;export{l as Intl};
@@ -0,0 +1,2 @@
1
+ export default en_US;
2
+ declare const en_US: string[];
@@ -0,0 +1,2 @@
1
+ export default zh_CN;
2
+ declare const zh_CN: string[];
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@itera-web/utils-locale-toggle",
3
+ "description": "语言切换",
4
+ "version": "1.19.0",
5
+ "main": "es/index.js",
6
+ "types": "es/index.d.ts",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
10
+ "license": "MIT",
11
+ "scripts": {
12
+ "build": "itera-cli package",
13
+ "up": "npm publish"
14
+ },
15
+ "dependencies": {
16
+ "react-intl-universal": "^2.9.1"
17
+ },
18
+ "devDependencies": {
19
+ "@itera-web/cli": "^1.1.45"
20
+ },
21
+ "gitHead": "8eee810020627ddc6fb8cb18fbc042cdcec7fb4b"
22
+ }