| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- const lang = {
- cn:'zh-cn',
- en:'en-us',
- }
- const textArr = [
- {
- keys: ["首页"],
- "en-us": 'Index'
- },
- {
- keys: ["English"],
- "en-us": '中文'
- },
- {
- keys: ["合方圆管理平台","管理平台"],
- "en-us": 'HFY management platform',
- "abbr-en-us": 'HFY DMP'
- },
- {
- keys: ["智慧能源"],
- "en-us": 'Smart Energy (SE)',
- "abbr-en-us": 'S Energy'
- },
- {
- keys: ["输电线路摄像头"],
- "en-us": 'Power Transmission Line Camera',
- "abbr-en-us": 'TCLC ',
- },
- {
- keys: ["4G低功耗摄像头"],
- "en-us": '4G Low Power Camera',
- "abbr-en-us": '4G-LP Camera'
- },
- {
- keys: ["自动变焦双目协同摄像头"],
- "en-us": 'Auto-focus Dual-lens Coordinated Camera',
- "abbr-en-us": 'AF dual-camera'
- },
- {
- keys: ["M2M产品"],
- "en-us": 'M2M Products',
- },
- {
- keys: ["智能终端"],
- "en-us": 'Intelligent Terminal',
- },
- {
- keys: ["关于我们"],
- "en-us": 'About us',
- },
- {
- keys: ["智能产品"],
- "en-us": 'smart product',
- },
- {
- keys: ["服务与支持"],
- "en-us": 'Server & Support',
- },
- {
- keys: ["快速链接"],
- "en-us": 'Quick link',
- },
- {
- keys: ["选择语言"],
- "en-us": 'Languages',
- },
- {
- keys: ["联系我们"],
- "en-us": 'Contact Us',
- },
- {
- keys: ["产品中心"],
- "en-us": 'ProductCenter',
- },
- {
- keys: ["了解更多"],
- "en-us": 'More',
- },
- {
- keys: ["持续创新的软硬件产品","持续创新"],
- "en-us": 'Sustainable Innovation',
- },
- {
- keys: ["输入产品名称","请输入"],
- "en-us": 'input key for search',
- },
- {
- keys: ["产品类别"],
- "en-us": 'Product Type',
- },
- {
- keys: ["解决方案"],
- "en-us": 'Solution',
- },
- {
- keys: ["新闻中心"],
- "en-us": 'News',
- },
- {
- keys: ["联系购买"],
- "en-us": 'Contact purchase',
- },
- {
- keys: ["介绍"],
- "en-us": 'Introduction'
- },
- {
- keys: ["参数"],
- "en-us": 'Parameters'
- },
- ]
- const i18Paths =
- [
- {
- keys: ['/','/index'],
- "en-us": '/index_en',
- }
- ]
- function getText(langType,langKey){
- let item = textArr.find(val=>val.keys.includes(langKey));
- if(item && item[langType]){
- return item[langType]
- }else{
- return langKey
- }
- }
- function getAbbrText(langType,langKey){
- let item = textArr.find(val=>val.keys.includes(langKey));
- let AbbrTypeKey = "abbr-"+langType
- if(item){
- if(item[AbbrTypeKey]){
- return item[AbbrTypeKey]
- }else if(item && item[langType]){
- return item[langType]
- }
- }
- return langKey
- }
- function getLangPathStr(langType,langKey){
- let item = i18Paths.find(val=>val.keys.includes(langKey));
- if(item && item[langType]){
- return item[langType]
- }else{
- return langKey
- }
- }
- export default {
- lang,
- getText,
- getAbbrText,
- getLangPathStr
- }
|