Socket
Book a DemoInstallSign in
Socket

ac-lang-cn

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ac-lang-cn

1. 运行时多语组件,组件通过对资源文件的加载达到支持不同语言; 2. 提供tinper-bee的多语组件 > [提供cli 工具实现 pack.json 和 excel 的相互转换。](https://package.yonyoucloud.com/#/package/bGFuZy1jbGk=)

latest
npmnpm
Version
1.0.8
Version published
Maintainers
1
Created
Source

ac-lang-cn

描述

  • 运行时多语组件,组件通过对资源文件的加载达到支持不同语言;
  • 提供tinper-bee的多语组件

提供cli 工具实现 pack.json 和 excel 的相互转换。

如何使用


  安装
  ynpm install @yonyou/ac-lang-cn --save

  引入
  import lang ,{ Local } from "ac-lang-cn";

  使用
  const pack = require('components/lang/pack').default;
  lang.init(pack, null);
  console.log(" ************************多语加载成功!***************************");
  
  ...

  render(){
    let _title = `${lang.template("YS_FI_FP_0000033576")}`/* 我是变量的多余! */;
    return(<div>{_title}</div>)
  }
  

组件多语


  引入
  import lang ,{ Local } from "ac-lang-cn";

  render(<Local> //入口路由处加入
        <Router>
      </Local>, document.getElementById('#app'));

API

API说明类型默认值/参数
lang语言string
langType语言类型string
defaultLangType默认类型string
languages所有语言类型string[]
init初始化化入口function
getLanguageType获取语言。优先级:URL配置 > 系统语言 > 默认语言function
getLanguage获取语言function
getG_Language浏览器语言function
getCookie获取cookiefunction
setLanguage设置语言function
setPack设置语言包function
setChangeLanguage语言变化时重新设置语言function
template渲染模版内容function
jsonpJSONP获取网络多语资源function

React Native 如何使用

注意事项

更新日志

FAQs

Package last updated on 06 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts