{"title":"国际化","inframe":false,"hidden":false,"roles":{"demo":1,"dev":1},"pageLink":"","children":[{"configs":{"itemId":"module"},"events":{"finalize":"app.text1.focus(false, true);","initialize":"/*\n * 国际化包括文字，日期和数字等的国际化。在WebBuilder中可在多处定义国际化资源：\n * 1、在目录wb/libs/ext/locale内定义ExtJS用到的国际化资源；\n * 2、在目录wb/libs/touch/locale内定义touch用到的国际化资源；\n * 3、在目录wb/script/locale内定义WebBuilder用到的国际化资源；\n * 4、在模块内定义国际化资源。\n * 在方法1、2、3内使用不同文件定义不同区域的资源，每个文件末尾按ISO语言和国家（区域）代码作为后缀。系统会根据客户端请求自动加载指定文件。\n * 如果文件名中只有语言代码而省略国家代码，将作为该类语言的默认语言。\n * request的属性sys.useLang为当前请求的语言种类，多语言Str.lang为WebBuilder中已经定义的语言种类。\n * WebBuilder默认提供中文英，如有需要可扩展目录wb/script/locale内的资源。\n */\n\n// 定义模块内的国际化资源，此方法同样可用于ServerScript或Java代码。\n//Wb.getLang方法根据Str.lang值获取对应语言组成的对象，因此用到的语言必须在目录wb/script/locale内已经定义。\nvar str = Wb.getLang({ //str为小写，以区别WebBuilder定义的Str\n  name: {\n    zh: '姓名', //默认中文使用的语言，使用中文的国家地区包含中国，台湾，香港，澳门，新加坡等，如果未找到指定国家的中文默认使用此中文。\n    //zh_TW:'姓名',可定义繁体中文，台湾地区适用\n    en: 'name'\n  },\n  plsEnterName: {\n    zh: '请输入你的姓名',\n    en: 'Please enter your name'\n  },\n  hintName: {\n    zh: '你的姓名为 \u201c{0}\u201d。',\n    en: 'Your name is \"{0}\".'\n  },\n  date: {\n    zh: '日期',\n    en: 'Date'\n  },\n  num: {\n    zh: '数字',\n    en: 'number'\n  }\n});\n//使用上述方法定义后在中文环境下str.name指向\u201c姓名\u201d"},"children":[{"configs":{"title":"@str.plsEnterName","height":"192","layout":"absolute","width":"400","margin":"8","itemId":"panel1"},"children":[{"configs":{"height":"22","width":"360","labelAlign":"right","itemId":"text1","fieldLabel":"@str.name","y":"16","x":"8"},"children":[],"type":"text","expanded":false},{"configs":{"height":"22","width":"360","value":"@new Date()","labelAlign":"right","itemId":"date1","fieldLabel":"@str.date","y":"48","x":"8"},"children":[],"type":"date","expanded":false},{"configs":{"height":"22","width":"360","value":"15.78","labelAlign":"right","itemId":"number1","fieldLabel":"@str.num","y":"80","x":"8"},"children":[],"type":"number","expanded":false},{"configs":{"text":"@Str.ok","height":"22","width":"112","itemId":"button1","y":"120","x":"256"},"events":{"click":"Wb.info(Wb.format(str.hintName, app.text1.getValue()));"},"children":[],"type":"button","expanded":false}],"type":"panel","expanded":true}],"type":"module","expanded":true}],"iconCls":""}