【求助】ray里如何使用I18n?

面板小程序开发相关产品技术讨论,包括面板小程序、智能小程序、React Native、Ray跨端框架、Panel SDK、微信小程序、小程序开发工具(IDE)及其他开发技术相关等话题


Post Reply
User avatar
Muzzzhi
Posts: 80

如题? :?: :?: :?: :?:

:geek: :ugeek: :mrgreen: :roll: :lol: :idea: :arrow: LGTM


Tags:
智能小程序开发者
Posts: 137

Re: 【求助】ray里如何使用I18n?

导出多语言

Code: Select all

import { kit } from '@ray-js/ray';
import Strings from './strings';

const { I18N } = kit;

export default new I18N(Strings);

使用多语言

Code: Select all

import Strings from '../i18n';

const localizedText = Strings.getLang('hello');

console.log(localizedText);
智能小程序开发者
Posts: 137

Re: 【求助】ray里如何使用I18n?

请注意使用最新的ray版本哦~

Post Reply