Match-id-b4cee81c39335f723de7f60590cb946fdea05514
This commit is contained in:
parent
109db22ba4
commit
5643df97da
|
@ -1,2 +1,3 @@
|
|||
# Horizon-Intl
|
||||
# Inula-Intl
|
||||
|
||||
Inula-intl 是 inula 提供的生态组件,主要提供了国际化功能,涵盖了基本的国际化组件和钩子函数,便于用户构建具备国际化能力的前端界面。在 Inula-intl 中使用国际化时,无论是组件或者 Hooks,其目的就是获取当前应用程序的国际化实例,该实例提供了处理多语言文本、日期、时间等功能。
|
||||
|
|
|
@ -19,7 +19,7 @@ module.exports = {
|
|||
"@babel/preset-react",
|
||||
{
|
||||
"runtime": "automatic",
|
||||
"importSource": "@cloudsop/horizon"
|
||||
"importSource": "inulajs"
|
||||
}
|
||||
]
|
||||
],
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
|
||||
*/
|
||||
|
||||
import Horizon, { useState } from '@cloudsop/horizon';
|
||||
import Inula, { useState } from 'inulajs';
|
||||
import { IntlProvider } from "../index";
|
||||
import zh from "./locale/zh";
|
||||
import en from "./locale/en";
|
||||
|
@ -23,7 +23,7 @@ const App = () => {
|
|||
|
||||
return (
|
||||
<IntlProvider locale={locale} messages={locale === 'zh' ? zh : en}>
|
||||
<header>Horizon-Intl API Test Demo</header>
|
||||
<header>Inula-Intl API Test Demo</header>
|
||||
|
||||
<div className='container'>
|
||||
<Example1/>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
|
||||
*/
|
||||
|
||||
import Horizon from "@cloudsop/horizon";
|
||||
import Inula from "inulajs";
|
||||
import { useIntl } from "../../index";
|
||||
|
||||
const Example1 = () => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
|
||||
*/
|
||||
import Horizon from "@cloudsop/horizon";
|
||||
import Inula from "inulajs";
|
||||
import { FormattedMessage } from "../../index";
|
||||
|
||||
const Example2= () => {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
|
||||
*/
|
||||
|
||||
import Horizon from '@cloudsop/horizon';
|
||||
import Inula from 'inulajs';
|
||||
import { FormattedMessage } from "../../index";
|
||||
|
||||
const Example3 = (props) => {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
|
||||
*/
|
||||
|
||||
import Horizon from "@cloudsop/horizon";
|
||||
import Inula from "inulajs";
|
||||
import { createIntl } from "../../index";
|
||||
|
||||
const Example4 = (props) => {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
|
||||
*/
|
||||
|
||||
import Horizon, { Component } from '@cloudsop/horizon';
|
||||
import Inula, { Component } from 'inulajs';
|
||||
import { injectIntl } from '../../index';
|
||||
|
||||
class Example5 extends Component<any, any, any> {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
|
||||
*/
|
||||
|
||||
import Horizon from "@cloudsop/horizon";
|
||||
import Inula from "inulajs";
|
||||
import { createIntl, createIntlCache, RawIntlProvider } from "../../index";
|
||||
import Example6Child from "./Example6Child";
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Horizon-Intl API Test</title>
|
||||
<title>Inula-Intl API Test</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/*
|
||||
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
|
||||
*/
|
||||
import * as Horizon from '@cloudsop/horizon';
|
||||
import * as Inula from 'inulajs';
|
||||
import App from './App'
|
||||
|
||||
function render() {
|
||||
Horizon.render(
|
||||
Inula.render(
|
||||
<>
|
||||
<App/>
|
||||
</>,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"name": "@cloudsop/horizon-intl",
|
||||
"version": "1.0.7",
|
||||
"name": "Inula-intl",
|
||||
"version": "0.0.1",
|
||||
"description": "",
|
||||
"main": "build/intl.umd.js",
|
||||
"type": "commonjs",
|
||||
"types": "build/@types/index.d.ts",
|
||||
"types": "build/index.d.ts",
|
||||
"scripts": {
|
||||
"demo-serve": "webpack serve --mode=development",
|
||||
"rollup-build": "rollup --config rollup.config.js",
|
||||
|
@ -13,7 +13,7 @@
|
|||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://szv-open.codehub.huawei.com/innersource/fenghuang/horizon/horizon-ecosystem.git"
|
||||
"url": "https://szv-open.codehub.huawei.com/innersource/fenghuang/horizon/horizon-core.git"
|
||||
},
|
||||
"files": [
|
||||
"build",
|
||||
|
@ -23,9 +23,7 @@
|
|||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@cloudsop/horizon": "^0.0.46",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
"inulajs": "^0.0.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.21.3",
|
||||
|
@ -58,6 +56,8 @@
|
|||
"typescript": "4.9.3",
|
||||
"webpack": "^5.81.0",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"webpack-dev-server": "^4.13.3"
|
||||
"webpack-dev-server": "^4.13.3",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ export default {
|
|||
terser(),
|
||||
],
|
||||
external:[
|
||||
"@cloudsop/horizon",
|
||||
"inulajs",
|
||||
"react",
|
||||
"react-dom"
|
||||
]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
|
||||
*/
|
||||
import Horizon, { Children, Fragment } from '@cloudsop/horizon';
|
||||
import Horizon, { Children, Fragment } from 'inulajs';
|
||||
import { FormattedMessageProps } from '../../types/interfaces';
|
||||
import useI18n from '../hook/useI18n';
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
|
||||
*/
|
||||
import Horizon, {useRef, useState, useEffect, useMemo, Component} from '@cloudsop/horizon';
|
||||
import Horizon, {useRef, useState, useEffect, useMemo, Component} from 'inulajs';
|
||||
import utils from '../../utils/utils';
|
||||
import { InjectProvider } from './InjectI18n';
|
||||
import { I18nProviderProps} from '../../types/interfaces';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
|
||||
*/
|
||||
import Horizon , { createContext, forwardRef } from '@cloudsop/horizon';
|
||||
import Horizon , { createContext, forwardRef } from 'inulajs';
|
||||
import { isVariantI18n } from '../../utils/utils';
|
||||
import copyStaticProps from '../../utils/copyStaticProps';
|
||||
import { InjectOptions } from '../../types/interfaces';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
|
||||
*/
|
||||
import Horizon, { useContext } from '@cloudsop/horizon';
|
||||
import Inula, { useContext } from 'inulajs';
|
||||
import utils from '../../utils/utils';
|
||||
import { I18nContext } from '../components/InjectI18n';
|
||||
import I18n from "../I18n";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
|
||||
*/
|
||||
import { isMemo, ForwardRef } from '@cloudsop/horizon';
|
||||
import { isMemo, ForwardRef } from 'inulajs';
|
||||
import {
|
||||
HORIZON_FORWARD_REF_STATICS,
|
||||
HORIZON_MEMO_STATICS,
|
||||
|
|
|
@ -21,7 +21,7 @@ module.exports = {
|
|||
"@babel/preset-react",
|
||||
{
|
||||
"runtime": "automatic", // 新增
|
||||
"importSource": "@cloudsop/horizon" // 新增
|
||||
"importSource": "inulajs" // 新增
|
||||
}
|
||||
],
|
||||
'@babel/preset-typescript'],
|
||||
|
|
Loading…
Reference in New Issue