diff --git a/en/Shopify-restyle.md b/en/Shopify-restyle.md index bb821c3ed67c75fcd7ee263675bac08c0f1a9ba1..8e6915da0a354e2c1f338848f8b9c696bbdbb69f 100644 --- a/en/Shopify-restyle.md +++ b/en/Shopify-restyle.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

@shopify/restyle

@@ -12,11 +12,11 @@

-> [!TIP] [Github 地址](https://github.com/Shopify/restyle) +> [!TIP] [GitHub address](https://github.com/Shopify/restyle) -## 安装与使用 +## Installation and Usage -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -34,9 +34,9 @@ yarn add @shopify/restyle@2.4.4 -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: -> [!WARNING] 使用时 import 的库名不变。 +> [!WARNING] The name of the imported repository remains unchanged. ```js import { createTheme } from "@shopify/restyle"; @@ -96,28 +96,28 @@ export const App = () => ( ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking. -首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` +Open the `harmony` directory of the HarmonyOS project in DevEco Studio. -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -本文档内容基于以下版本验证通过: +This document is verified based on the following versions: 1. RNOH:0.72.27; SDK:HarmonyOS NEXT Developer Beta1 5.0.0.25; IDE:DevEco Studio 5.0.3.400; ROM:3.0.0.25 2. RNOH:0.72.33; SDK:OpenHarmony 5.0.0.71(API Version 12 Release); IDE:DevEco Studio 5.0.3.900; ROM:NEXT.0.0.71; ## Hooks -详细请查看 [restyle 的文档介绍](https://shopify.github.io/restyle/) +For details, see [restyle](https://shopify.github.io/restyle/) -以下为目前已支持的 Hooks: +Here are the currently supported Hooks: -> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 +> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | |:-----------------:|:-----------------------------------------------------------------------------------------------:|:--------:|:--------:|:--------:|:-----------------:| @@ -125,15 +125,15 @@ export const App = () => ( | useRestyle | Dynamically styles reaction components based on a theme and a set of rules for resetting styles | function | No | All | Yes | | useResponsiveProp | Fetching the value of a responsive prop in a custom component | function | No | All | Yes | -## 方法 +## Methods -详细请查看 [restyle 的文档介绍](https://shopify.github.io/restyle/) +For details, see [restyle](https://shopify.github.io/restyle/) -以下为目前已支持的方法: +Here are the currently supported methods: -> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 +> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | |:----------------------:|:------------------------------------------------------------------------------:|:--------:|:--------:|:--------:|:-----------------:| @@ -142,15 +142,15 @@ export const App = () => ( | createRestyleFunction | Creating a Predefined Restyle | function | No | All | Yes | | createRestyleComponent | To create a custom component, you need to set the predefined Restyle function. | function | No | All | Yes | -## 预定义组件 +## Predefined components -详细请查看 [restyle 的文档介绍](https://shopify.github.io/restyle/) +For details, see [restyle](https://shopify.github.io/restyle/) -以下为目前已支持的预定义组件: +Here are the currently supported predefined components: -> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 +> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | |:-------------:|:----------------------------------------------:|:--------:|:--------:|:--------:|:-----------------:| @@ -158,15 +158,15 @@ export const App = () => ( | createBox | Predefined Box component | function | No | All | Yes | | ThemeProvider | Set the theme to the outermost React component | function | No | All | Yes | -## 预定义 Restyle 函数 +## Predefined Restyle Functions -详细请查看 [restyle 的文档介绍](https://shopify.github.io/restyle/fundamentals/restyle-functions) +For details, see [restyle](https://shopify.github.io/restyle/fundamentals/restyle-functions) -以下为目前已支持的预定义 Restyle 函数: +Here are the currently supported predefined Restyle functions: -> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 +> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Props | Type | Required | Platform | HarmonyOS Support | |:------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:--------:|:--------:|:--------:|:-----------------:| @@ -186,12 +186,12 @@ export const App = () => ( | textShadow | textShadowOffset, textShadowRadius | function | No | All | NO | | textShadow | textShadowColor | function | No | All | NO | -## 遗留问题 +## Known Issues -## 其他 +## Others - - 预函数textShadow在Android和iOS不生效, HarmonyOS与Android,iOS表现一致 [原库 issue](https://github.com/Shopify/restyle/issues/307) + - The pre-defined function textShadow does not take effect on Android and iOS, but HarmonyOS exhibits consistent behavior with Android and iOS in this regard. [issue](https://github.com/Shopify/restyle/issues/307) -## 开源协议 +## License -本项目基于 [The MIT License (MIT)](https://github.com/Shopify/restyle/blob/master/LICENSE.md),请自由地享受和参与开源。 +This project is licensed under [The MIT License (MIT)](https://github.com/Shopify/restyle/blob/master/LICENSE.md),请自由地享受和参与开源。 diff --git a/en/nativewind.md b/en/nativewind.md index 8396feda21b7d521610972edeee7e06161389c8a..0273195660a68f52af5667337fd742f80d10ff3a 100644 --- a/en/nativewind.md +++ b/en/nativewind.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

nativewind

@@ -13,15 +13,15 @@

-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/nativewind) +> [!TIP] [GitHub address](https://github.com/react-native-oh-library/nativewind) -## 安装与使用 +## Installation and Usage Find the matching version information in the release address of a third-party library:[@react-native-oh-tpl/nativewind Releases](https://github.com/react-native-oh-library/nativewind/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: -> [!TIP] # 处替换为 tgz 包的路径 +> [!TIP] Replace the content with the path of the .tgz package at the comment sign (#). @@ -43,7 +43,7 @@ yarn add @react-native-oh-tpl/nativewind npx tailwindcss init ``` -#### **在你的 tailwind.config.js 文件中添加所有组件文件的路径。** +#### **Add the paths of all component files to your tailwind.config.js file.** ```diff module.exports = { @@ -56,7 +56,7 @@ module.exports = { } ``` -#### **修改你的 babel.config.js。** +#### **Modify your babel.config.js.** ```diff module.exports = { @@ -67,9 +67,9 @@ module.exports = { -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: -> [!WARNING] 使用时 import 的库名不变。 +> [!WARNING] The name of the imported repository remains unchanged. ```jsx import React from 'react'; @@ -91,18 +91,18 @@ const NativewindDemo = () => { export default NativewindDemo ``` -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/nativewind Releases](https://github.com/react-native-oh-library/nativewind/releases) +Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/nativewind Releases](https://github.com/react-native-oh-library/nativewind/releases) ## API -> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 +> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | | -------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- | -------- | ----------------- | @@ -111,10 +111,10 @@ export default NativewindDemo | useColorScheme() | provides access to the devices color scheme. | () =>{colorScheme,setColorScheme} | no | All | yes | | NativeWindStyleSheet | A StyleSheet is an abstraction similar to CSS StyleSheets and React Native's StyleSheet | component | no | All | yes | -## 遗留问题 +## Known Issues -## 其他 +## Others -## 开源协议 +## License -本项目基于 [The MIT License (MIT)](https://github.com/nativewind/nativewind/blob/main/packages/nativewind/LICENSE) ,请自由地享受和参与开源。 \ No newline at end of file +This project is licensed under [The MIT License (MIT)](https://github.com/nativewind/nativewind/blob/main/packages/nativewind/LICENSE). \ No newline at end of file diff --git a/en/react-native-action-sheet.md b/en/react-native-action-sheet.md index d16495e5867e4f96ba678b9ecdf0e0998189e290..a6af45f6b37a90edd099dab965dffe3fcead983f 100644 --- a/en/react-native-action-sheet.md +++ b/en/react-native-action-sheet.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.0 +> Template version: v0.2.0

react-native-action-sheet

@@ -12,12 +12,12 @@

-> [!TIP] [Github 地址](https://github.com/expo/react-native-action-sheet) +> [!TIP] [GitHub address](https://github.com/expo/react-native-action-sheet) -## 安装与使用 +## Installation and Usage -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -36,9 +36,9 @@ yarn add @expo/react-native-action-sheet@4.0.1 -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: ->[!WARNING] 使用时 import 的库名不变。 +>[!WARNING] The name of the imported repository remains unchanged. ```js import { ActionSheetProvider, connectActionSheet, ActionSheetProps } from '@expo/react-native-action-sheet'; @@ -187,22 +187,22 @@ const styles = StyleSheet.create({ }, }); ``` -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机ROM。 +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -本文档内容基于以下版本验证通过: +This document is verified based on the following versions: 1. RNOH:0.72.20; SDK:HarmonyOS NEXT Developer Beta1; IDE:DevEco Studio 5.0.3.200; ROM:3.0.0.18; 2. RNOH:0.72.33; SDK:OpenHarmony 5.0.0.71(API Version 12 Release); IDE:DevEco Studio 5.0.3.900; ROM:NEXT.0.0.71; -## 属性 +## Properties -> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 +> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. **showActionSheetWithOptions** @@ -234,9 +234,9 @@ const styles = StyleSheet.create({ | ------------------ | ----------------------------------------------- | --------------- | -------- | -------- | ----------------- | | `useCustomActionSheet` | iOS only prop that uses the custom pure JS action sheet (Android/Web version) instead of the native ActionSheetIOS component. Defaults to false. |boolean | no | ios | yes | | `useNativeDriver` | Windows only option that provides the option to disable the native animation driver for React Native Windows projects targeting Windows 10 Version-1809 ; Build-10.0.17763.0 and earlier. useNativeDriver is supported in Version-1903 and later so if your project is targeting that, you don't need to set this prop. |boolean | no | Web | yes | -## 遗留问题 +## Known Issues -## 其他 +## Others -## 开源协议 -本项目基于 [The MIT License (MIT)](https://github.com/expo/react-native-action-sheet/blob/master/LICENSE) ,请自由地享受和参与开源。 +## License +This project is licensed under [The MIT License (MIT)](https://github.com/expo/react-native-action-sheet/blob/master/LICENSE). diff --git a/en/react-native-autocomplete-dropdown.md b/en/react-native-autocomplete-dropdown.md index 56a600c8d34f9fd83239e7646df56cfbd3dbc519..f718a0d2b6e83196d44f99861f03d83f4e680b7a 100644 --- a/en/react-native-autocomplete-dropdown.md +++ b/en/react-native-autocomplete-dropdown.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-autoComplete-dropdown

@@ -14,9 +14,9 @@ -> [!TIP] [Github 地址](https://github.com/onmotion/react-native-autocomplete-dropdown) +> [!TIP] [GitHub address](https://github.com/onmotion/react-native-autocomplete-dropdown) -## 安装与使用 +## Installation and Usage @@ -34,9 +34,9 @@ yarn add react-native-autocomplete-dropdown@4.0.0-rc.5 -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: ->[!WARNING] 使用时 import 的库名不变。 +>[!WARNING] The name of the imported repository remains unchanged. 1. Wrap your root component in AutocompleteDropdownContextProvider from react-native-autocomplete-dropdown @@ -92,24 +92,24 @@ export const LocalDataSetExample = memo(() => { ## Link -本库 HarmonyOS 侧实现依赖@react-native-oh-tpl/react-native-svg 的原生端代码,如已在 HarmonyOS 工程中引入过该库,则无需再次引入,可跳过本章节步骤,直接使用。 +The HarmonyOS implementation of this library depends on the native code from @react-native-oh-tpl/react-native-svg. If this library is included into your HarmonyOS application, there is no need to include it again; you can skip the steps in this section and use it directly. -如未引入请参照[@react-native-oh-tpl/react-native-svg 文档](/zh-cn/react-native-svg-capi.md)进行引入 +If it is not included, follow the guide provided in @react-native-oh-tpl/react-native-svg to add it to your project. -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -本文档内容基于以下版本验证通过: +This document is verified based on the following versions: 1. RNOH: 0.72.27; SDK:HarmonyOS-Next-DB1 5.0.0.25; IDE: DevEco Studio 5.0.3.400SP7; ROM: 3.0.0.25; -## 属性 +## Properties -> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 +> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | @@ -155,14 +155,14 @@ export const LocalDataSetExample = memo(() => { | flatListProps | props for \ component | FlatListProps | no | iOS/Android | yes | -## 遗留问题 +## Known Issues -- [ ] TextInput在页面底部时,键盘弹起会导致View标签measure方法计算pageY错误,导致dropdown位置不正确,RN框架问题。 +- [ ] When the TextInput is at the bottom of the page, the keyboard popping up can cause the measure method of the View tag to calculate the pageY incorrectly, resulting in an improperly positioned dropdown. This is an issue with the React Native framework. -## 其他 +## Others -- closeOnBlur、bottomOffset属性在4.0.0-rc5版本不支持,源码组件入口props中不接收这两个属性 [源码:index.tsx](https://github.com/onmotion/react-native-autocomplete-dropdown/blob/main/src/index.tsx#L59) +- The closeOnBlur and bottomOffset properties are not supported in version 4.0.0-rc5. These properties are not accepted in the props of the component entry in the source code [Source code: index.tsx](https://github.com/onmotion/react-native-autocomplete-dropdown/blob/main/src/index.tsx#L59) -## 开源协议 +## License -本项目基于 [The MIT License (MIT)](https://github.com/onmotion/react-native-autocomplete-dropdown/blob/main/LICENSE) ,请自由地享受和参与开源。 +This project is licensed under [The MIT License (MIT)](https://github.com/onmotion/react-native-autocomplete-dropdown/blob/main/LICENSE). diff --git a/en/react-native-barcode-builder.md b/en/react-native-barcode-builder.md index 984fa4cf66f9562003fe03632e2303ae0f551f2f..401856f8cdb4da25630a9d46dda0b24dba6ce7fb 100644 --- a/en/react-native-barcode-builder.md +++ b/en/react-native-barcode-builder.md @@ -96,7 +96,7 @@ Check the release version information in the release address of the third-party > [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. -该库为 UI 组件库,通过配置 Properties 标签,实现对应的功能。 +This library is a UI component library that achieves corresponding functions by configuring the Properties tag. | Name | Type | Description | Required | Platform | HarmonyOS Support | | ---------- | -------- | ------------------------------------------------------------------------------------------------ | -------- | ----------- | ----------------- | diff --git a/en/react-native-code-push.md b/en/react-native-code-push.md index 74fdd419a81228601a97d28a7fb9807c9b54f333..8da81b11cb1919109d79b97abd42cf7eef3103bc 100644 --- a/en/react-native-code-push.md +++ b/en/react-native-code-push.md @@ -85,21 +85,21 @@ class App extends Component { }; } componentDidMount() { - console.log("开始检查更新"); - this.syncImmediate(); //开始检查更新 + console.log("Begin checking for updates."); + this.syncImmediate(); } syncImmediate() { CodePush.sync( { updateDialog: { - appendReleaseDescription: true, //是否显示更新description,默认为false - descriptionPrefix: "更新内容:", //更新说明的前缀。 默认是” Description: - mandatoryContinueButtonLabel: "立即更新", //强制更新的按钮文字,默认为continue - mandatoryUpdateMessage: "", //- 强制更新时,更新通知. Defaults to “An update is available that must be installed.”. - optionalIgnoreButtonLabel: "稍后", //非强制更新时,取消按钮文字,默认是ignore - optionalInstallButtonLabel: "后台更新", //非强制更新时,确认文字. Defaults to “Install” - optionalUpdateMessage: "有新版本了,是否更新?", //非强制更新时,更新通知. Defaults to “An update is available. Would you like to install it?”. - title: "更新提示", //要显示的更新通知的标题. Defaults to “Update available”. + appendReleaseDescription: true, + descriptionPrefix: "Update content:", + mandatoryContinueButtonLabel: "Update immediately.", + mandatoryUpdateMessage: "", + optionalIgnoreButtonLabel: "later", + optionalInstallButtonLabel: "Background update.", + optionalUpdateMessage: "There's a new version available. Would you like to update?", + title: "Update notification.", }, }, this.codePushStatusDidChange.bind(this), @@ -158,7 +158,7 @@ class App extends Component { render() { return ( - 欢迎使用热更新--test! + Welcome to the hot update--test! SyncStatus: {this.state.syncMessage} {this.state.progressModalVisible.toString()} @@ -432,18 +432,8 @@ When using **CodePush.InstallMode**, the following parameters are optional: inst | --------------- | ------------------ | ------ | -------- | ----------- | ----------------- | | IMMEDIATE | Directly update | number | no | Android iOS | yes | | ON_NEXT_RESTART | Next update launch | number | no | Android iOS | yes | -| ON_NEXT_RESUME | Switch to the front-end to initiate updates | number | no | Android iOS | yes | -| ON_NEXT_SUSPEND | Switch to the backend to initiate updates | number | no | Android iOS | yes | - -**checkFrequency** - -When using **CodePush.CheckFrequency**, the following parameters are optional: checkFrequency - -| Name | Description | Type | Required | Platform | HarmonyOS Support | -| ------------- | ------------------- | ------ | -------- | ----------- | ----------------- | -| ON_APP_START | Automatic update | number | no | Android iOS | yes | -| ON_APP_RESUME | Automatic update | number | no | Android iOS | yes | -| MANUAL | Manual update | number | no | Android iOS | yes | +| ON_NEXT_RESUME | Next update launch | number | no | Android iOS | yes | +| ON_NEXT_SUSPEND | Next update launch | number | no | Android iOS | yes | ## Known Issues diff --git a/en/react-native-collapsible.md b/en/react-native-collapsible.md index e5b8f8bf3cf6bc6ddb5ef9ccc7a85b2830a4bd12..df0f2b5b25643b030f175a2c528d9355609db6fd 100644 --- a/en/react-native-collapsible.md +++ b/en/react-native-collapsible.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-collapsible

@@ -13,11 +13,11 @@

-> [!TIP] [Github 地址](https://github.com/oblador/react-native-collapsible) +> [!TIP] [GitHub address](https://github.com/oblador/react-native-collapsible) -## 安装与使用 +## Installation and Usage -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -35,7 +35,7 @@ yarn add react-native-collapsible@1.6.1 -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: ```js import React, { useState } from 'react'; @@ -83,20 +83,20 @@ const CONTENT = [ ``` -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -本文档内容基于以下版本验证通过: +This document is verified based on the following versions: 1. RNOH: 0.72.20; SDK:HarmonyOS NEXT Developer Beta1; IDE:DevEco Studio 5.0.3.200; ROM:3.0.0.18; 2. RNOH:0.72.33; SDK:OpenHarmony 5.0.0.71(API Version 12 Release); IDE:DevEco Studio 5.0.3.900; ROM:NEXT.0.0.71; -## 属性 +## Properties -> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 +> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. #### Collapsible | Name | Description | Type | Required | Platform | HarmonyOS Support | | ---- | ----------- | ---- | -------- | -------- | ------------------ | @@ -135,10 +135,10 @@ const CONTENT = [ | **`containerStyle`** | Optional styling for the Accordion container. | object | no | All | yes | | **`renderAsFlatList`** | Optional rendering as FlatList (defaults to false). | boolean | no | All | yes | -## 遗留问题 +## Known Issues -## 其他 +## Others -## 开源协议 +## License -本项目基于 [The MIT License (MIT)](https://github.com/oblador/react-native-collapsible/blob/master/LICENSE) ,请自由地享受和参与开源。 \ No newline at end of file +This project is licensed under [The MIT License (MIT)](https://github.com/oblador/react-native-collapsible/blob/master/LICENSE). \ No newline at end of file diff --git a/en/react-native-create-thumbnail.md b/en/react-native-create-thumbnail.md index 151140e137a48f38a03f47d363d2210f0fd1ea22..d4f2ff3c9306a232dc109c9d890b35131c01a000 100644 --- a/en/react-native-create-thumbnail.md +++ b/en/react-native-create-thumbnail.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.0 +> Template version: v0.2.0

react-native-create-thumbnail

@@ -14,13 +14,13 @@

-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-create-thumbnail) +> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-create-thumbnail) -## 安装与使用 +## Installation and Usage Find the matching version information in the release address of a third-party library:[@react-native-oh-tpl/react-native-create-thumbnail Releases](https://github.com/react-native-oh-library/react-native-create-thumbnail/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -40,16 +40,15 @@ yarn add @react-native-oh-tpl/react-native-create-thumbnail -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: ->[!WARNING] 使用时 import 的库名不变。 +>[!WARNING] The name of the imported repository remains unchanged. ```js import React, {useState } from 'react'; import { StyleSheet, Text, Button ,ScrollView,View} from 'react-native'; import { createThumbnail } from 'react-native-create-thumbnail'; -// 导出组件 export default function CreateThumbnailDemo() { const [text, setText] = useState(''); @@ -76,7 +75,7 @@ export default function CreateThumbnailDemo() { createThumbnail - + @@ -144,11 +143,11 @@ const styles = StyleSheet.create({ ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking. -首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` +Open the `harmony` directory of the HarmonyOS project in DevEco Studio. -### 1.在工程根目录的 `oh-package.json5` 添加 overrides 字段 +### 1. Adding the overrides Field to oh-package.json5 File in the Root Directory of the Project ```json { @@ -159,18 +158,15 @@ const styles = StyleSheet.create({ } ``` -### 2.引入原生端代码 +### 2. Introducing Native Code -目前有两种方法: +Currently, two methods are available: -1. 通过 har 包引入(在 IDE 完善相关功能后该方法会被遗弃,目前首选此方法); -2. 直接链接源码。 +Method 1 (recommended): Use the HAR file. -方法一:通过 har 包引入 +> [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library. -> [!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。 - -打开 `entry/oh-package.json5`,添加以下依赖 +Open `entry/oh-package.json5` file and add the following dependencies: ```json "dependencies": { @@ -179,20 +175,20 @@ const styles = StyleSheet.create({ } ``` -点击右上角的 `sync` 按钮 +Click the `sync` button in the upper right corner. -或者在终端执行: +Alternatively, run the following instruction on the terminal: ```bash cd entry ohpm install ``` -方法二:直接链接源码 +Method 2: Directly link to the source code. -> [!TIP] 源码位于三方库安装路径的 `harmony` 文件夹下。 +> [!TIP] The source code is located in the harmony folder within the installation path of the third-party library. -打开 `entry/oh-package.json5`,添加以下依赖 +Open `entry/oh-package.json5` file and add the following dependencies: ```json "dependencies": { @@ -201,16 +197,16 @@ ohpm install } ``` -打开终端,执行: +run the following instruction on the terminal: ```bash cd entry ohpm install --no-link ``` -### 3.在 ArkTs 侧引入 BlobUtilPackage +### 3. Introducing BlobUtilPackage to ArkTS -打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加: +Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code: ```diff ... @@ -224,43 +220,43 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 4.运行 +### 4. Running -点击右上角的 `sync` 按钮 +Click the `sync` button in the upper right corner. -或者在终端执行: +Alternatively, run the following instruction on the terminal: ```bash cd entry ohpm install ``` -然后编译、运行即可。 +Then build and run the code. -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-create-thumbnail Releases](https://github.com/react-native-oh-library/react-native-create-thumbnail/releases) +Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-create-thumbnail Releases](https://github.com/react-native-oh-library/react-native-create-thumbnail/releases) ## API -> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 +> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. #### **createThumbnail** | Name | Description | Type | Required | HarmonyOS Support | | ---- | ---- | ---- | -------- | -------- | | createThumbnail | thumbnail generator with storage/cache management and support for both local and remote videos | function | NO | yes | -## 属性 +## Properties -> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 +> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | type | Required | Platform | HarmonyOS Support | | :-----------------: | :----------: | :------: | :------: | :---------------: | :---------------: | @@ -270,11 +266,11 @@ ohpm install | dirSize | Maximum size of the cache directory (in megabytes). When this directory is full, the previously generated thumbnails will be deleted to clear about half of it's size. | Number | NO | Android/ios | yes | | headers | Headers to load the video with. e.g. { Authorization: 'someAuthToken' } | Object | NO | Android/ios | yes | | cacheName | Cache name for this thumbnail to avoid duplicate generation. If specified, and a thumbnail already exists with the same cache name, it will be returned instead of generating a new one. | String | NO | Android/ios | yes | -## 返回值 +## Return Value -> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 +> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | type | Required | Platform | HarmonyOS Support | | :-----------------: | :----------: | :------: | :------: | :---------------: | :---------------: | @@ -286,10 +282,10 @@ ohpm install -## 遗留问题 +## Known Issues -## 其他 +## Others -## 开源协议 +## License -本项目基于 [The MIT License (MIT)](https://github.com/souvik-ghosh/react-native-create-thumbnail/blob/master/LICENSE) ,请自由地享受和参与开源。 +This project is licensed under [The MIT License (MIT)](https://github.com/souvik-ghosh/react-native-create-thumbnail/blob/master/LICENSE). diff --git a/en/react-native-credit-card-input.md b/en/react-native-credit-card-input.md index 05e8163d7acc2dc70783e27486e5f97997701485..877f6748399752ce3ab49f39e23ba55c9f6408eb 100644 --- a/en/react-native-credit-card-input.md +++ b/en/react-native-credit-card-input.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-credit-card-input

@@ -12,13 +12,13 @@

-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-credit-card-input) +> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-credit-card-input) -## 安装与使用 +## Installation and Usage Find the matching version information in the release address of a third-party library:[@react-native-oh-tpl/react-native-credit-card-input Releases](https://github.com/react-native-oh-library/react-native-credit-card-input/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -38,7 +38,7 @@ yarn add @react-native-oh-tpl/react-native-credit-card-input -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: ```js import React, { Component } from "react"; @@ -117,21 +117,21 @@ export default class Example extends Component { } ``` -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -本文档内容基于以下版本验证通过: +This document is verified based on the following versions: 1.RNOH: 0.72.27; SDK:HarmonyOS-Next-DB1 5.0.0.25; IDE:DevEco Studio 5.0.3.400SP7; ROM:3.0.0.25; -## 属性 +## Properties ->[!tip] "Platform"列表示该属性在原三方库上支持的平台。 +>[!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. ->[!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +>[!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. -详情见[react-native-credit-card-input](https://github.com/sbycrosz/react-native-credit-card-input) +For details, see [react-native-credit-card-input](https://github.com/sbycrosz/react-native-credit-card-input) ### LiteCreditCardInput @@ -191,10 +191,10 @@ export default class Example extends Component { | imageBack | Image for the credit-card | PropTypes.number | no | Android/iOS | yes | | customIcons | brand icons for CardView. see ./src/Icons.js for details | PropTypes.object | no | Android/iOS | yes | -## 遗留问题 +## Known Issues -## 其他 +## Others -## 开源协议 +## License -本项目基于 [The MIT License (MIT)](https://github.com/sbycrosz/react-native-credit-card-input/blob/master/LICENSE) ,请自由地享受和参与开源。 \ No newline at end of file +This project is licensed under [The MIT License (MIT)](https://github.com/sbycrosz/react-native-credit-card-input/blob/master/LICENSE). \ No newline at end of file diff --git a/en/react-native-crypto.md b/en/react-native-crypto.md index 613f20a70a5dfd05f4cb8c8e63697284fd903b26..29893413fd0906d9115e66e3e59527379514490d 100644 --- a/en/react-native-crypto.md +++ b/en/react-native-crypto.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-crypto

@@ -12,12 +12,11 @@

-> [!TIP] [Github 地址](https://github.com/tradle/react-native-crypto) +> [!TIP] [GitHub address](https://github.com/tradle/react-native-crypto) +## Installation and Usage -## 安装与使用 - -[!TIP]本库依赖[@react-native-oh-tpl/react-native-randombytes](./zh-cn/react-native-randombytes) +[!TIP]This repository depends on [@react-native-oh-tpl/react-native-randombytes](./zh-cn/react-native-randombytes) @@ -32,11 +31,13 @@ npm install react-native-crypto@2.2.0 ```bash yarn add react-native-crypto@2.2.0 ``` + -#### 安装适配 Node.js 核心模块的模拟库 +#### Install a mock library that adapts to Node.js core modules. 1. Install + ```bash # install latest rn-nodeify npm i --save-dev rn-nodeify @@ -44,17 +45,19 @@ npm i --save-dev rn-nodeify # in ./node_modules to add/update the "browser"/"react-native" field with relevant mappings ./node_modules/.bin/rn-nodeify --hack --install ``` + 2. `rn-nodeify` will create a `shim.js` in the project root directory + ```js -// make sure you use `import` and not require! -import './shim.js' -import crypto from 'react-native-crypto' +// make sure you use `import` and not require! +import "./shim.js"; +import crypto from "react-native-crypto"; // ...the rest of your code ``` -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: -> [!WARNING] 使用时 import 的库名不变。 +> [!WARNING] The name of the imported repository remains unchanged. ```js import './shim.js' @@ -73,7 +76,7 @@ const TestCrypto = () => { setRandomBytesResult(bytes.toJSON().data.join('-')); }); } - + function handleInputChange(text: any) { const intValue = parseInt(text); if (!isNaN(text)) { @@ -84,7 +87,7 @@ const TestCrypto = () => { setIntValue(0); } }; - + function handleButtonPress() { handleRandom(intValue); }; @@ -92,12 +95,12 @@ const TestCrypto = () => { return ( + @@ -196,24 +194,24 @@ const styles = StyleSheet.create({ ``` -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-material-textfield Releases](https://github.com/react-native-oh-library/react-native-material-textfield/releases) +Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-material-textfield Releases](https://github.com/react-native-oh-library/react-native-material-textfield/releases) -在下述版本验证通过: +This document is verified based on the following versions: RNOH:0.72.20; SDK:HarmonyOS NEXT Developer Beta1; IDE:DevEco Studio 5.0.3.200; ROM:3.0.0.18; -## 属性 +## Properties -### 此组件有以下属性: ->[!tip] "Platform"列表示该属性在原三方库上支持的平台。 +### This component has the following properties: +>[!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. ->[!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +>[!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | |:-----------------------:| :-----------------------------------------------: | :------------------------------------------------------: | :------: | :---------: | :---------------: | @@ -253,9 +251,9 @@ RNOH:0.72.20; SDK:HarmonyOS NEXT Developer Beta1; IDE:DevEco Studio 5.0.3. | **onBlur** | Blur callback | Function | No | iOS/Android | Yes | ## **API(TextField)** ->[!tip] "Platform"列表示该属性在原三方库上支持的平台。 +>[!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. ->[!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +>[!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | |:-----------------------:| :-----------------------------------------------: | :------------------------------------------------------: | :------: | :---------: | :---------------: | @@ -270,10 +268,10 @@ RNOH:0.72.20; SDK:HarmonyOS NEXT Developer Beta1; IDE:DevEco Studio 5.0.3. | **isPlaceholderVisible()** | Get placeholder visibility | Boolean | No | iOS/Android | Yes | | **setValue()** | Set current value | | No | iOS/Android | Yes | -## 遗留问题 +## Known Issues -## 其他 +## Others -## 开源协议 +## License -本项目基于 [BSD License](https://github.com/n4kz/react-native-material-textfield/blob/master/license.txt) ,请自由地享受和参与开源。 \ No newline at end of file +This project is licensed under [BSD License](https://github.com/n4kz/react-native-material-textfield/blob/master/license.txt). \ No newline at end of file diff --git a/en/react-native-modal.md b/en/react-native-modal.md index b021889d76b4f1fb208af1937f378d78c27fe231..d17ceaa2973550143a8e99b4d95bcda2ee1614f0 100644 --- a/en/react-native-modal.md +++ b/en/react-native-modal.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-modal

@@ -12,13 +12,13 @@

-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-modal) +> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-modal) -## 安装与使用 +## Installation and Usage Find the matching version information in the release address of a third-party library:[@react-native-oh-tpl/react-native-modal Releases](https://github.com/react-native-oh-library/react-native-modal/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -37,9 +37,9 @@ yarn add @react-native-oh-tpl/react-native-modal -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: -> [!WARNING] 使用时 import 的库名不变。 +> [!WARNING] The name of the imported repository remains unchanged. ```ts import React, { Component } from "react"; @@ -121,19 +121,19 @@ const styles = StyleSheet.create({ export default DefaultModal; ``` -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-modal Releases](https://github.com/react-native-oh-library/react-native-modal/releases) +Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-modal Releases](https://github.com/react-native-oh-library/react-native-modal/releases) -## 属性 +## Properties -> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 +> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Default | Required | Platform | HarmonyOS Support | | --- | --- | --- | --- | --- | --- | --- | @@ -176,11 +176,11 @@ export default DefaultModal; | propagateSwipe | Allows swipe events to propagate to children components (eg a ScrollView inside a modal) | `bool` or `func` | false | no | all | yes | | style | Style applied to the modal | `any` | null | no | all | yes | -## 遗留问题 +## Known Issues -## 其他 +## Others -## 开源协议 +## License -本项目基于 [The MIT License (MIT)](https://github.com/react-native-modal/react-native-modal/blob/master/LICENSE.md) ,请自由地享受和参与开源。 +This project is licensed under [The MIT License (MIT)](https://github.com/react-native-modal/react-native-modal/blob/master/LICENSE.md). diff --git a/en/react-native-multiple-select.md b/en/react-native-multiple-select.md index 38b289a74950c138fdbf3797e0eda109d65ede50..fe028c28b07d229719f20644850d5f1c54e5efc9 100644 --- a/en/react-native-multiple-select.md +++ b/en/react-native-multiple-select.md @@ -128,11 +128,11 @@ export {MultiSelectExample} ## Constraints -### 注意事项 +### Precautions -本库 HarmonyOS 侧需要引入字体包,如下所示。如已引用,则无需再次引入,可跳过本章节步骤,直接使用。 +On the HarmonyOS side of this library, a font package needs to be introduced as shown below. If it has already been referenced, there is no need to introduce it again. You can skip the steps in this section and use it directly. -在 HarmonyOS 工程中的 entry/src/main/ets/pages/index.ets 中添加如下代码: +Open `entry/src/main/ets/pages/index.ets` and add the following code: ```diff ... diff --git a/en/react-native-neomorph-shadows.md b/en/react-native-neomorph-shadows.md index 8022648da52c286b165cff8e38e8772548cc1115..90930fb210f53e429debad906dd92523224c0dae 100644 --- a/en/react-native-neomorph-shadows.md +++ b/en/react-native-neomorph-shadows.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-neomorph-shadows

@@ -13,13 +13,13 @@

-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-neomorph-shadows) +> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-neomorph-shadows) -## 安装与使用 +## Installation and Usage Find the matching version information in the release address of a third-party library:[@react-native-oh-tpl/react-native-neomorph-shadows Releases](https://github.com/react-native-oh-library/react-native-neomorph-shadows/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -38,7 +38,7 @@ yarn add @react-native-oh-tpl/react-native-neomorph-shadows -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: ```tsx import React from 'react'; @@ -53,8 +53,8 @@ export default function () { // shadowOffset: { width: 0, height: 5 }, fillOpacity: 0.6, // borderRadius: 25, - stopColor:"#f0f0f0",//渐变结束的颜色 - startColor:"#FF3A3A",//渐变开始的颜色 + stopColor:"#f0f0f0", + startColor:"#FF3A3A", width: 110, height: 110, alignItems: "center", @@ -75,7 +75,7 @@ export default function () { // }, // shadowOpacity: 1, // shadowRadius: 3.84, - // elevation: 5 // 添加阴影效果 + // elevation: 5 }}> - 登录/注册 + Login/Register
@@ -105,25 +105,25 @@ const styles = StyleSheet.create({ ``` ## Link -本库 HarmonyOS 侧实现依赖@react-native-oh-tpl/react-native-svg 的原生端代码,如已在 HarmonyOS 工程中引入过该库,则无需再次引入,可跳过本章节步骤,直接使用。 +The HarmonyOS implementation of this library depends on the native code from @react-native-oh-tpl/react-native-svg. If this library is included into your HarmonyOS application, there is no need to include it again; you can skip the steps in this section and use it directly. -如未引入请参照[@react-native-oh-tpl/react-native-svg 文档](/zh-cn/react-native-svg-capi.md)进行引入 +If it is not included, follow the guide provided in @react-native-oh-tpl/react-native-svg to add it to your project. -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-neomorph-shadows Releases](https://github.com/react-native-oh-library/react-native-neomorph-shadows/releases) +Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-neomorph-shadows Releases](https://github.com/react-native-oh-library/react-native-neomorph-shadows/releases) -## 属性 +## Properties -### 此组件有以下属性: +### This component has the following properties: ## **API(Shadow)** ->[!tip] "Platform"列表示该属性在原三方库上支持的平台。 +>[!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. ->[!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +>[!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | |:-----------------------:| :-----------------------------------------------: | :------------------------------------------------------: | :------: | :---------: | :---------------: | @@ -133,12 +133,12 @@ const styles = StyleSheet.create({ | **startColor** | Shadow Gradient Start Color | String | No | iOS/Android | Yes | -## 遗留问题 +## Known Issues -目前仅设计Shadow组件阴影效果。Neomorph组件暂未涉及。[issue#5](https://github.com/react-native-oh-library/react-native-neomorph-shadows/issues/5) +Currently, only the shadow effect for the Shadow component is designed. The Neomorph component is not yet involved.[issue#5](https://github.com/react-native-oh-library/react-native-neomorph-shadows/issues/5) -## 其他 +## Others -## 开源协议 +## License -本项目基于 [MIT License](https://github.com/tokkozhin/react-native-neomorph-shadows/blob/master/LICENSE) ,请自由地享受和参与开源。 \ No newline at end of file +This project is licensed under [MIT License](https://github.com/tokkozhin/react-native-neomorph-shadows/blob/master/LICENSE). \ No newline at end of file diff --git a/en/react-native-network-info.md b/en/react-native-network-info.md index cff44c3947ab286c2f89aa4d85f60978fea39a61..bda56ebaf6902b41251d0e5e4388898ad68ba71c 100644 --- a/en/react-native-network-info.md +++ b/en/react-native-network-info.md @@ -173,7 +173,7 @@ Open the `harmony` directory of the HarmonyOS project in DevEco Studio. } ``` -### 2. Introducing Native Code +### 2. Introducing Native Code Currently, two methods are available: @@ -243,7 +243,7 @@ Check the release version information in the release address of the third-party ### Permission Requirements -在 entry 目录下的 module.json5 中添加 wifi 和网络信息权限 +Add permissions for WiFi and network information in the module.json5 file under the entry directory. Open the `entry/src/main/module.json5` file and add the following code: diff --git a/en/react-native-offline.md b/en/react-native-offline.md index 7759c445bd829005ddaa25afc152e7e0e59de6bc..4e568d6036a94ae17f0883192596225483517767 100644 --- a/en/react-native-offline.md +++ b/en/react-native-offline.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-offline

@@ -12,11 +12,11 @@

-> [!TIP] [Github 地址](https://github.com/rgommezz/react-native-offline) +> [!TIP] [GitHub address](https://github.com/rgommezz/react-native-offline) -## 安装与使用 +## Installation and Usage -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -34,9 +34,9 @@ yarn add react-native-offline@6.0.2 -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: -> [!WARNING] 使用时 import 的库名不变。 +> [!WARNING] The name of the imported repository remains unchanged. ```js import React from 'react'; @@ -102,24 +102,24 @@ export const offlineDemoTest = () => { ## Link -本库 HarmonyOS 侧实现依赖@react-native-community/netinfo 的原生端代码,如已在 HarmonyOS 工程中引入过该库,则无需再次引入,可跳过本章节步骤,直接使用。 +The HarmonyOS implementation of this library depends on the native code from @react-native-community/netinfo. If this library is included into your HarmonyOS application, there is no need to include it again; you can skip the steps in this section and use it directly. -如未引入请参照[@react-native-community/netinfo文档的 Link 章节](/zh-cn/react-native-community-netinfo.md#link)进行引入 +If it is not included, follow the guide provided in @react-native-community/netinfo to add it to your project. -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -本文档内容基于以下版本验证通过: +This document is verified based on the following versions: 1. RNOH: 0.72.27; SDK:HarmonyOS-Next-DB1 5.0.0.25; IDE:DevEco Studio 5.0.3.400; ROM:3.0.0.25; 2. RNOH:0.72.33; SDK:OpenHarmony 5.0.0.71(API Version 12 Release); IDE:DevEco Studio 5.0.3.900; ROM:NEXT.0.0.71; -## 属性 +## Properties -> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 +> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | | --------------------- | ------------------------------------------------------------ | ----------- | -------- | --------------------- | ----------------- | @@ -139,11 +139,11 @@ export const offlineDemoTest = () => { | url | remote server to ping to. Defaults to https://www.google.com/ since it's probably one the most stable servers out there, but you can provide your own if needed. Warning: www.google.com is a blocked domain in China, so if you need your app to be accessible from there, you MUST use another domain. | string | no | Android、iOS、Windows | yes | | method | http method used to ping the server. Supports HEAD or OPTIONS. Defaults to HEAD. | HTTPMethod | no | Android、iOS、Windows | yes | -## 静态方法 +## Static Methods -> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 +> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | | ----------------------- | ------------------------------------------------------------ | ---- | -------- | --------------------- | ----------------- | @@ -155,10 +155,10 @@ export const offlineDemoTest = () => { | createNetworkMiddleware | Function that returns a Redux middleware which listens to specific actions targeting API calls in online/offline mode. | func | no | Android、iOS、Windows | yes | | OfflineQueue | A queue system to store actions that failed due to lack of connectivity. It works for both plain object actions and thunks. | func | no | Android、iOS、Windows | yes | -## 遗留问题 +## Known Issues -## 其他 +## Others -## 开源协议 +## License -本项目基于 [The MIT License (MIT)](https://github.com/rgommezz/react-native-offline/blob/master/LICENSE) ,请自由地享受和参与开源 +This project is licensed under [The MIT License (MIT)](https://github.com/rgommezz/react-native-offline/blob/master/LICENSE) ,请自由地享受和参与开源 diff --git a/en/react-native-picker-select.md b/en/react-native-picker-select.md index b19ebd0a1e15f27205106fefe970d5c28e1a8eb5..e7de8d1edff4f9bf73149d96171b0b07d8394a52 100644 --- a/en/react-native-picker-select.md +++ b/en/react-native-picker-select.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-picker-select

@@ -12,13 +12,13 @@

-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-picker-select) +> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-picker-select) -## 安装与使用 +## Installation and Usage Find the matching version information in the release address of a third-party library:[@react-native-oh-tpl/react-native-picker-select Releases](https://github.com/react-native-oh-library/react-native-picker-select/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -36,9 +36,9 @@ yarn add @react-native-oh-tpl/react-native-picker-select -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: -> [!WARNING] 使用时 import 的库名不变。 +> [!WARNING] The name of the imported repository remains unchanged. ```js import React, { useRef, useState } from 'react'; @@ -181,23 +181,24 @@ const styles = StyleSheet.create({ ## Link -本库依赖@react-native-oh-tpl/@react-native-picker/picker,如已在鸿蒙工程中引入过该库,则无需再次引入。 +The HarmonyOS implementation of this library depends on the native code from@react-native-oh-tpl/@react-native-picker/picker. If this library is included into your HarmonyOS application, there is no need to include it again; you can skip the steps in this section and use it directly. -如未引入请参照[@react-native-oh-tpl/@react-native-picker/picker 文档]()进行引入。 +If it is not included, follow the guide provided in @react-native-oh-tpl/@react-native-picker/picker to add it to your project. -## 约束与限制 -### 兼容性 +## Constraints -要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 +### Compatibility -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-picker-select Releases](https://github.com/react-native-oh-library/react-native-picker-select/releases) +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -## 属性 +Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-picker-select Releases](https://github.com/react-native-oh-library/react-native-picker-select/releases) -> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 +## Properties -> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. + +> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Default | Required | Platform | HarmonyOS Support | | --- | --- | --- | --- | --- | --- | --- | @@ -224,13 +225,13 @@ const styles = StyleSheet.create({ | modalProps | Additional props to pass to the Modal (some props are used in core functionality so use this carefully). | function | null | no | iOS | yes | | touchableDoneProps | Additional props to pass to the Done touchable (some props are used in core functionality so use this carefully). | function | null | no | iOS | yes | -## 遗留问题 +## Known Issues -- [ ] 属性useNativeAndroidPickerStyle在HarmonyOS中暂不支持 [issue#3](https://github.com/react-native-oh-library/react-native-picker-select/issues/3) -- [ ] 属性fixAndroidTouchableBug在HarmonyOS中暂不支持 [issue#4](https://github.com/react-native-oh-library/react-native-picker-select/issues/4) +- [ ] The property useNativeAndroidPickerStyle is currently not supported in HarmonyOS. [issue#3](https://github.com/react-native-oh-library/react-native-picker-select/issues/3) +- [ ] The property fixAndroidTouchableBug is currently not supported in HarmonyOS. [issue#4](https://github.com/react-native-oh-library/react-native-picker-select/issues/4) -## 其他 +## Others -## 开源协议 +## License -本项目基于 [The MIT License (MIT)](https://github.com/lawnstarter/react-native-picker-select/blob/master/LICENSE) ,请自由地享受和参与开源。 +This project is licensed under [The MIT License (MIT)](https://github.com/lawnstarter/react-native-picker-select/blob/master/LICENSE). diff --git a/en/react-native-qr-decode-image-camera.md b/en/react-native-qr-decode-image-camera.md index b975c45eb81e2f4d17c472ff21e8cc259da14a2d..f9af7f4729b2a62f6c07bb4bc15b57db3d42647c 100644 --- a/en/react-native-qr-decode-image-camera.md +++ b/en/react-native-qr-decode-image-camera.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-qr-decode-image-camera

@@ -13,13 +13,13 @@

-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-qr-decode-image-camera) +> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-qr-decode-image-camera) -## 安装与使用 +## Installation and Usage Find the matching version information in the release address of a third-party library:[@react-native-oh-tpl/react-native-qr-decode-image-camera Releases](https://github.com/react-native-oh-library/react-native-qr-decode-image-camera/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -38,11 +38,11 @@ yarn add @react-native-oh-tpl/react-native-qr-decode-image-camera -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: -> [!WARNING] 使用时 import 的库名不变。 +> [!WARNING] The name of the imported repository remains unchanged. -> 示例中:launchImageLibrary 方法需引入 Harmony OS 的 react-native-image-picker 库,跳转 [react-native-image-picker](/zh-cn/react-native-image-picker.md)查看使用方法。 +> In the example: The launchImageLibrary method requires the introduction of the react-native-image-picker library for Harmony OS,Navigate to [react-native-image-picker](/zh-cn/react-native-image-picker.md)to view the usage instructions. QRreader @@ -73,7 +73,7 @@ export const qrExample = () => { } }); }} - title="点击选择二维码照片 " + title="Click to select a QR code photo" /> {reader} @@ -139,17 +139,17 @@ const styles = StyleSheet.create({ }); ``` -## 使用 Codegen +## Use Codegen -本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。 +If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/en/codegen.md). ## Link -本库鸿蒙侧实现依赖@react-native-oh-tpl/react-native-vision-camera 的原生端代码,如已在鸿蒙工程中引入过该库,则无需再次引入,可跳过本章节步骤,直接使用。 +The HarmonyOS implementation of this library depends on the native code from @react-native-oh-tpl/react-native-vision-camera. If this library is included into your HarmonyOS application, there is no need to include it again; you can skip the steps in this section and use it directly. -如未引入请参照[@react-native-oh-tpl/react-native-vision-camera](/zh-cn/react-native-vision-camera.md)进行引入 +If it is not included, follow the guide provided in @react-native-oh-tpl/react-native-vision-camera to add it to your project. -## 1.在工程根目录的 `oh-package.json5` 添加 overrides 字段 +## 1. Adding the overrides Field to oh-package.json5 File in the Root Directory of the Project ```json { @@ -160,18 +160,17 @@ const styles = StyleSheet.create({ } ``` -### 2.引入原生端代码 +### 2. Introducing Native Code -目前有两种方法: +Currently, two methods are available: -1. 通过 har 包引入(在 IDE 完善相关功能后该方法会被遗弃,目前首选此方法); -2. 直接链接源码。 + -方法一:通过 har 包引入 +Method 1 (recommended): Use the HAR file. -> [!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。 +> [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library. -打开 `entry/oh-package.json5`,添加以下依赖 +Open `entry/oh-package.json5` file and add the following dependencies: ```json "dependencies": { @@ -180,22 +179,22 @@ const styles = StyleSheet.create({ } ``` -点击右上角的 `sync` 按钮 +Click the `sync` button in the upper right corner. -或者在终端执行: +Alternatively, run the following instruction on the terminal: ```bash cd entry ohpm install ``` -方法二:直接链接源码 +Method 2: Directly link to the source code. -> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md) +> [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md). -### 3.在 ArkTs 侧引入 RNQrDecodeImageCameraPackage +### 3. Introducing RNQrDecodeImageCameraPackage to ArkTS -打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加: +Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code: ```diff @@ -210,9 +209,9 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 4.在 ArkTs 侧引入 Fabric 组件 +### 4. Introducing NativeScan Component to ArkTS -找到 function buildCustomRNComponent(),一般位于 entry/src/main/ets/pages/index.ets 或 entry/src/main/ets/rn/LoadBundle.ets,添加: +Find `function buildCustomRNComponent()`, which is usually located in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets`, and add the following code: ```diff ... @@ -232,45 +231,45 @@ export function buildCustomRNComponent(ctx: ComponentBuilderContext) { ... ``` -### 5.运行 +### 5. Running -点击右上角的 `sync` 按钮 +Click the `sync` button in the upper right corner. -或者在终端执行: +Alternatively, run the following instruction on the terminal: ```bash cd entry ohpm install ``` -然后编译、运行即可。 +Then build and run the code. -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-qr-decode-image-camera](https://github.com/react-native-oh-library/react-native-qr-decode-image-camera/releases) +Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-qr-decode-image-camera](https://github.com/react-native-oh-library/react-native-qr-decode-image-camera/releases) -## 静态方法 +## Static Methods -> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 +> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | | ----------------------------- | ---------------------------------------------------- | ------- | -------- | ----------- | ----------------- | | QRreader | Invoke this method to invoke the gallery, select the QR code image for image decoding, and asynchronously return the result. | funtion | no | iOS/Android | yes | -## 属性 +## Properties ### QRscanner -> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 +> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | | ------------------ | ------------------------------------------------ | ------- | -------- | ----------- | ----------------- | @@ -305,10 +304,10 @@ ohpm install | topViewStyle | render top container style | object | no | iOS/Android | yes | | bottomViewStyle | render bottom container style | object | no | iOS/Android | yes | -## 遗留问题 +## Known Issues -## 其他 +## Others -## 开源协议 +## License -本项目基于 [The MIT License (MIT)](https://github.com/deepanrajkumar/react-native-qr-decode-image-camera/blob/master/LICENSE) ,请自由地享受和参与开源。 +This project is licensed under [The MIT License (MIT)](https://github.com/deepanrajkumar/react-native-qr-decode-image-camera/blob/master/LICENSE). diff --git a/en/react-native-randombytes.md b/en/react-native-randombytes.md index 86206616dba6d3081ddcd41bb5761a4ab6ba3707..98bfb93d88881fa8888f949bd87009569a0b3cf6 100644 --- a/en/react-native-randombytes.md +++ b/en/react-native-randombytes.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-randombytes

@@ -15,13 +15,13 @@ -> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-randombytes) +> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-randombytes) -## 安装与使用 +## Installation and Usage Find the matching version information in the release address of a third-party library:[@react-native-oh-library/react-native-randombytes Releases](https://github.com/react-native-oh-library/react-native-randombytes/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -41,9 +41,9 @@ yarn add @react-native-oh-tpl/react-native-randombytes -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: ->[!WARNING] 使用时 import 的库名不变。 +>[!WARNING] The name of the imported repository remains unchanged. ```tsx @@ -56,7 +56,6 @@ export default function randomBytesDemo(): JSX.Element { const [bytesString, setBytesString] = useState(''); const [size, setSize] = useState('30'); - // 调用原生 randomBytes, 传入一个回调函数 const nativeRandom = () => { randomBytes(Number(size), (err: any, bytes: any) => { setBytesString(JSON.stringify(bytes)) @@ -64,7 +63,6 @@ export default function randomBytesDemo(): JSX.Element { }) } - // 不传回调函数,调用js randomBytes const jsRandom = () => { const bytes = randomBytes(Number(size)) setBytesString(JSON.stringify(bytes)) @@ -101,17 +99,17 @@ const styles = StyleSheet.create({ ``` -## 使用 Codegen(如本库已适配了 Codegen ) +## Use Codegen -本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。 +If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/en/codegen.md). ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking. -首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` +Open the `harmony` directory of the HarmonyOS project in DevEco Studio. -### 1.在工程根目录的 `oh-package.json5` 添加 overrides字段 +### 1. Adding the overrides Field to oh-package.json5 File in the Root Directory of the Project ```json { @@ -122,18 +120,15 @@ const styles = StyleSheet.create({ } ``` -### 2.引入原生端代码 +### 2. Introducing Native Code -目前有两种方法: +Currently, two methods are available: -1. 通过 har 包引入(在 IDE 完善相关功能后该方法会被遗弃,目前首选此方法); -2. 直接链接源码。 +Method 1 (recommended): Use the HAR file. -方法一:通过 har 包引入 +> [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library. -> [!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。 - -打开 `entry/oh-package.json5`,添加以下依赖 +Open `entry/oh-package.json5` file and add the following dependencies: ```json "dependencies": { @@ -142,22 +137,22 @@ const styles = StyleSheet.create({ } ``` -点击右上角的 `sync` 按钮 +Click the `sync` button in the upper right corner. -或者在终端执行: +Alternatively, run the following instruction on the terminal: ```bash cd entry ohpm install ``` -方法二:直接链接源码 +Method 2: Directly link to the source code. -> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md) +> [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md). -### 3.在 ArkTs 侧引入 RandomBytesPackage +### 3. Introducing RandomBytesPackage to ArkTS -打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加: +Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code: ```diff ... @@ -171,37 +166,37 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 4.运行 +### 4. Running -点击右上角的 `sync` 按钮 +Click the `sync` button in the upper right corner. -或者在终端执行: +Alternatively, run the following instruction on the terminal: ```bash cd entry ohpm install ``` -然后编译、运行即可。 +Then build and run the code. -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-library/react-native-randombytes Releases](https://github.com/react-native-oh-library/react-native-randombytes/releases) +Check the release version information in the release address of the third-party library: [@react-native-oh-library/react-native-randombytes Releases](https://github.com/react-native-oh-library/react-native-randombytes/releases) -本文档内容基于以下版本验证通过: +This document is verified based on the following versions: 1. RNOH: 0.72.20-CAPI; SDK: HarmonyOS NEXT Developer Beta1; IDE: DevEco Studio 5.0.3.200; ROM: 3.0.0.18; ## API -> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 +> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. -详情请见[react-native-randombytes](https://github.com/react-native-oh-library/react-native-randombytes) +For details, see [react-native-randombytes](https://github.com/react-native-oh-library/react-native-randombytes) | Name | Description | Type | Required | Platform | HarmonyOS Support | |----------------|-------------------------------| -- | -------- | ----------- | ----------------- | @@ -209,9 +204,9 @@ ohpm install | seedSJCL | Add entropy to the pools. | function | No | IOS/Android | yes | -## 其他 +## Others -## 开源协议 +## License -本项目基于 [The MIT License (MIT)](https://github.com/mvayngrib/react-native-randombytes/blob/master/LICENSE) ,请自由地享受和参与开源。 +This project is licensed under [The MIT License (MIT)](https://github.com/mvayngrib/react-native-randombytes/blob/master/LICENSE). diff --git a/en/react-native-restart.md b/en/react-native-restart.md index f23ad4e68bb36c202c831827eea02c10a4f3a3b8..20a554c58ead8cf5b31019ff00020bae696c4379 100644 --- a/en/react-native-restart.md +++ b/en/react-native-restart.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-restart

@@ -13,13 +13,13 @@

-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-restart) +> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-restart) -## 安装与使用 +## Installation and Usage Find the matching version information in the release address of a third-party library:[@react-native-oh-tpl/react-native-restart Releases](https://github.com/react-native-oh-library/react-native-restart/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -38,9 +38,9 @@ yarn add @react-native-oh-tpl/react-native-restart -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: -> [!WARNING] 使用时 import 的库名不变。 +> [!WARNING] The name of the imported repository remains unchanged. ```js import {Text, View, StyleSheet} from 'react-native'; @@ -49,15 +49,15 @@ import RNRestart from 'react-native-restart'; export default function RestartDemo() { return ( - 重启restart + restart RNRestart.restart()}> - 重启(restart) + restart - 重启Restart + Restart RNRestart.Restart()}> - 重启(Restart) + Restart - 上次restart的原因(getReason) + The reason for the last restart(getReason) RNRestart.getReason()}> getReason @@ -77,16 +77,16 @@ const styles = StyleSheet.create({ ``` -## 使用 Codegen +## Use Codegen -本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。 +If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/en/codegen.md). ## Link -目前HarmonyOS暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking. -首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` -### 1.在工程根目录的 `oh-package.json5` 添加 overrides字段 +Open the `harmony` directory of the HarmonyOS project in DevEco Studio. +### 1.Open `entry/oh-package.json5` file and add the following dependencies: ```json { @@ -97,18 +97,17 @@ const styles = StyleSheet.create({ } ``` -### 2.引入原生端代码 +### 2. Introducing Native Code -目前有两种方法: +Currently, two methods are available: -1. 通过 har 包引入(在 IDE 完善相关功能后该方法会被遗弃,目前首选此方法); -2. 直接链接源码。 + -方法一:通过 har 包引入(推荐) +Method 1 (recommended): Use the HAR file. -> [!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。 +> [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library. -打开 `entry/oh-package.json5`,添加以下依赖 +Open `entry/oh-package.json5` file and add the following dependencies: ```json "dependencies": { @@ -117,22 +116,22 @@ const styles = StyleSheet.create({ } ``` -点击右上角的 `sync` 按钮 +Click the `sync` button in the upper right corner. -或者在终端执行: +Alternatively, run the following instruction on the terminal: ```bash cd entry ohpm install ``` -方法二:直接链接源码 +Method 2: Directly link to the source code. -> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/link-source-code.md) +> [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md). -### 3.在 ArkTs 侧引入 RNRestartPackage +### 3. Introducing RNRestartPackage to ArkTS -打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加: +Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code: ```diff import type { RNPackageContext, RNPackage } from "rnoh/ts"; @@ -147,29 +146,29 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-restart Releases](https://github.com/react-native-oh-library/react-native-restart/releases) +Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-restart Releases](https://github.com/react-native-oh-library/react-native-restart/releases) -## 静态方法 +## Static Methods -> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 +> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | | --------- | --------------------------------- | -------- | -------- | -------- | ----------------- | | restart | restart your react native project | Function | no | All | yes | | Restart | restart your react native project | Function | no | All | yes | | getReason | get the cause of the last restart | Function | no | All | yes | -## 遗留问题 +## Known Issues -## 其他 +## Others -## 开源协议 +## License -本项目基于 [The MIT License (MIT)](https://github.com/avishayil/react-native-restart/blob/master/LICENSE),请自由地享受和参与开源。 \ No newline at end of file +This project is licensed under [The MIT License (MIT)](https://github.com/avishayil/react-native-restart/blob/master/LICENSE),请自由地享受和参与开源。 \ No newline at end of file diff --git a/en/react-native-securerandom.md b/en/react-native-securerandom.md index 045c2651ea0dc5aa2e673709bf072ea6ca7dc65b..d189115fdfc55a54a594fb2523b0f836f0a7ff64 100644 --- a/en/react-native-securerandom.md +++ b/en/react-native-securerandom.md @@ -130,7 +130,7 @@ Open the `harmony` directory of the HarmonyOS project in DevEco Studio. } ``` -### 2. Introducing Native Code +### 2. Introducing Native Code Currently, two methods are available: diff --git a/en/react-native-shadow-2.md b/en/react-native-shadow-2.md index 419c6e20d343f5ce9ae9e6896255f4ca81aa1940..7041a360fc33d3ca871ff6e7d0e49293ac25ed74 100644 --- a/en/react-native-shadow-2.md +++ b/en/react-native-shadow-2.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-shadow-2

@@ -13,11 +13,11 @@

-> [!TIP] [Github 地址](https://github.com/SrBrahma/react-native-shadow-2) +> [!TIP] [GitHub address](https://github.com/SrBrahma/react-native-shadow-2) -## 安装与使用 +## Installation and Usage -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -35,9 +35,9 @@ yarn add react-native-shadow-2@7.0.8 -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: -> [!WARNING] 使用时 import 的库名不变。 +> [!WARNING] The name of the imported repository remains unchanged. ```tsx import {Text, ScrollView, View, StyleSheet} from 'react-native'; @@ -47,7 +47,7 @@ export function Shadow2Demo() { return ( - shadow2测试 + shadow2 base @@ -172,23 +172,23 @@ const styles = StyleSheet.create({ ## Link -本库HarmonyOS侧实现依赖@react-native-oh-tpl/react-native-svg 的原生端代码,如已在HarmonyOS工程中引入过该库,则无需再次引入,可跳过本章节步骤,直接使用。 +The HarmonyOS implementation of this library depends on the native code from @react-native-oh-tpl/react-native-svg. If this library is included into your HarmonyOS application, there is no need to include it again; you can skip the steps in this section and use it directly. -如未引入请参照[@react-native-oh-tpl/react-native-svg 文档](/zh-cn/react-native-svg-capi.md#link)进行引入 +If it is not included, follow the guide provided in @react-native-oh-tpl/react-native-svg to add it to your project. -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -本文档内容基于以下版本验证通过: +This document is verified based on the following versions: 1. RNOH:0.72.27; SDK:HarmonyOS NEXT Developer Beta1 5.0.0.25 (API Version 12 Canary4); IDE:DevEco Studio 5.0.3.400SP7; ROM:3.0.0.25; -## 属性 +## Properties -> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 +> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | | -------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -------- | -------- | ----------------- | @@ -205,14 +205,14 @@ const styles = StyleSheet.create({ | safeRender | Won't use the relative sizing and positioning on the 1st render but on the following renders with the exact onLayout sizes. Useful if dealing with radii greater than the sides sizes (like a circle) to avoid visual artifacts on the 1st render. | boolean | no | All | yes | | disabled | Disables the Shadow. Useful for easily reusing components as sometimes shadows are not desired. containerStyle and style are still applied. | boolean | no | All | yes | -## 遗留问题 +## Known Issues -目前可使用的属性,具体见上面已列出。 +The currently available properties are specifically listed above. -- [x] 由于react-native-shadow-2强依赖[`react-native-svg`](https://react-native-oh-library.gitee.io/usage-docs/#/zh-cn/react-native-svg)库,但react-native-svg目前仅实现少部分属性,其余还未实现HarmonyOS化, 导致属性offset、paintInside、corners不可用问题: [issue#5](https://github.com/react-native-oh-library/react-native-svg/issues/5) +- [x] Due to the strong dependency of react-native-shadow-2 on the [`react-native-svg`](https://react-native-oh-library.gitee.io/usage-docs/#/zh-cn/react-native-svg)library,and the current limited implementation of react-native-svg on HarmonyOS, only a small number of properties are available, Consequently, properties such as offset, paintInside, and corners are not yet supported, leading to issues as documented in: [issue#5](https://github.com/react-native-oh-library/react-native-svg/issues/5) -## 其他 +## Others -## 开源协议 +## License -本项目基于 [The MIT License (MIT)](https://github.com/SrBrahma/react-native-shadow-2/blob/main/LICENSE) ,请自由地享受和参与开源。 +This project is licensed under [The MIT License (MIT)](https://github.com/SrBrahma/react-native-shadow-2/blob/main/LICENSE). diff --git a/en/react-native-shimmer-placeholder.md b/en/react-native-shimmer-placeholder.md index dc8520ae1fe5c18599399708535ed6a52a5ff951..dfec8fb828313b11af7ee97a6d91ff203eaa854f 100644 --- a/en/react-native-shimmer-placeholder.md +++ b/en/react-native-shimmer-placeholder.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-shimmer-placeholder

@@ -12,11 +12,11 @@

-> [!TIP] [Github 地址](https://github.com/tomzaku/react-native-shimmer-placeholder) +> [!TIP] [GitHub address](https://github.com/tomzaku/react-native-shimmer-placeholder) -## 安装与使用 +## Installation and Usage -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -34,9 +34,9 @@ yarn add react-native-shimmer-placeholder@2.0.9 -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: -> [!WARNING] 使用时 import 的库名不变。 +> [!WARNING] The name of the imported repository remains unchanged. ```js import React, { Component } from "react"; @@ -77,25 +77,25 @@ export class ShimmerPlaceholderTest extends Component { ## Link -> [!TIP] 本库依赖的@react-native-oh-tpl/react-native-linear-gradient 使用的版本为 3.0.0-0.4.5 +> [!TIP] The version of @react-native-oh-tpl/react-native-linear-gradient that this library depends on is 3.0.0-0.4.5. -本库 HarmonyOS 侧实现依赖@react-native-oh-tpl/react-native-linear-gradient 的原生端代码,如已在 HarmonyOS 工程中引入过该库,则无需再次引入,可跳过本章节步骤,直接使用。 +The HarmonyOS implementation of this library depends on the native code from @react-native-oh-tpl/react-native-linear-gradient. If this library is included into your HarmonyOS application, there is no need to include it again; you can skip the steps in this section and use it directly. -如未引入请参照[@react-native-oh-tpl/react-native-linear-gradient 文档](/zh-cn/react-native-linear-gradient.md)进行引入 +If it is not included, follow the guide provided in @react-native-oh-tpl/react-native-linear-gradient to add it to your project. -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -本文档内容基于以下版本验证通过: +This document is verified based on the following versions: 1. RNOH: 0.72.27; SDK: HarmonyOS-Next-DB1 5.0.0.25; IDE: DevEco Studio 5.0.3.400SP7; ROM: 3.0.0.25; -## 属性 +## Properties -> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 +> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Required | Type | Platform | HarmonyOS Support | | -------------------------- | ------------------------------------------------------------------------------------------------------ | -------- | --------- | -------- | ----------------- | @@ -117,20 +117,20 @@ export class ShimmerPlaceholderTest extends Component { | **shimmerContainerProps** | Props passed to the View which contains the loading animation | no | ViewProps | ALL | yes | | **childrenContainerProps** | Props passed to the View which contains the children | no | ViewProps | ALL | yes | -## 静态方法 +## Static Methods -> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 +> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Method | Description | Type | **Required** | Platform | HarmonyOS Support | | --------------- | --------------------------- | -------- | ------------ | -------- | ----------------- | | **getAnimated** | get Animated of Placeholder | Animated | no | ALL | yes | -## 遗留问题 +## Known Issues -## 其他 +## Others -## 开源协议 +## License -本项目基于 [The MIT License (MIT)](https://github.com/tomzaku/react-native-shimmer-placeholder/blob/master/LICENSE) ,请自由地享受和参与开源。 +This project is licensed under [The MIT License (MIT)](https://github.com/tomzaku/react-native-shimmer-placeholder/blob/master/LICENSE). diff --git a/en/react-native-signature-capture.md b/en/react-native-signature-capture.md index a2ca929be1f59e9a9ffe22c540fff182d69ef6e7..f369434d925dfa47eb869bb66f52e7e791854daa 100644 --- a/en/react-native-signature-capture.md +++ b/en/react-native-signature-capture.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-signature-capture

@@ -15,13 +15,13 @@ -> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-signature-capture) +> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-signature-capture) -## 安装与使用 +## Installation and Usage Find the matching version information in the release address of a third-party library:[@react-native-oh-library/react-native-signature-capture Releases](https://github.com/react-native-oh-library/react-native-signature-capture/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -41,9 +41,9 @@ yarn add @react-native-oh-tpl/react-native-signature-capture -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: ->[!WARNING] 使用时 import 的库名不变。 +>[!WARNING] The name of the imported repository remains unchanged. ```tsx var React = require('react'); @@ -133,17 +133,17 @@ AppRegistry.registerComponent('RNSignatureExample', () => RNSignatureExample); ``` -## 使用 Codegen +## Use Codegen -本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。 +If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/en/codegen.md). ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking. -首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` +Open the `harmony` directory of the HarmonyOS project in DevEco Studio. -### 1.在工程根目录的 `oh-package.json5` 添加 overrides字段 +### 1.Open `entry/oh-package.json5` file and add the following dependencies: ```json { @@ -154,18 +154,17 @@ AppRegistry.registerComponent('RNSignatureExample', () => RNSignatureExample); } ``` -### 2.引入原生端代码 +### 2. Introducing Native Code -目前有两种方法: +Currently, two methods are available: -1. 通过 har 包引入(在 IDE 完善相关功能后该方法会被遗弃,目前首选此方法); -2. 直接链接源码。 + -方法一:通过 har 包引入 (推荐) +Method 1 (recommended): Use the HAR file. -> [!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。 +> [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library. -打开 `entry/oh-package.json5`,添加以下依赖 +Open `entry/oh-package.json5` file and add the following dependencies: ```json "dependencies": { @@ -174,22 +173,22 @@ AppRegistry.registerComponent('RNSignatureExample', () => RNSignatureExample); } ``` -点击右上角的 `sync` 按钮 +Click the `sync` button in the upper right corner. -或者在终端执行: +Alternatively, run the following instruction on the terminal: ```bash cd entry ohpm install ``` -方法二:直接链接源码 +Method 2: Directly link to the source code. -> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md) +> [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md). -### 3.在 ArkTs 侧引入 SignatureCaptureArkView 组件 +### 3. Introducing SignatureCaptureArkView Component to ArkTS -找到 `function buildCustomRNComponent()`,一般位于 `entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets`,添加: +Find `function buildCustomRNComponent()`, which is usually located in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets`, and add the following code: ```diff ... @@ -209,9 +208,9 @@ export function buildCustomRNComponent(ctx: ComponentBuilderContext) { ... ``` -> [!TIP] 本库使用了混合方案,需要添加组件名。 +> [!TIP] If the repository uses a mixed solution, the component name needs to be added. -在`entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets` 找到常量 `arkTsComponentNames` 在其数组里添加组件名 +Find the constant `arkTsComponentNames` in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets` and add the component name to the array. ```diff const arkTsComponentNames: Array = [ @@ -222,9 +221,9 @@ const arkTsComponentNames: Array = [ ]; ``` -### 4.在 ArkTs 侧引入 SignatureCapturePackage +### 4. Introducing SignatureCapturePackage to ArkTS -打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加: +Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code: ```diff ... @@ -238,33 +237,33 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 5.运行 +### 5. Running -点击右上角的 `sync` 按钮 +Click the `sync` button in the upper right corner. -或者在终端执行: +Alternatively, run the following instruction on the terminal: ```bash cd entry ohpm install ``` -然后编译、运行即可。 +Then build and run the code. -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-library/react-native-signature-capture Releases](https://github.com/react-native-oh-library/react-native-signature-capture/releases) +Check the release version information in the release address of the third-party library: [@react-native-oh-library/react-native-signature-capture Releases](https://github.com/react-native-oh-library/react-native-signature-capture/releases) -## 属性 +## Properties -> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 +> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | @@ -282,11 +281,11 @@ ohpm install | onSaveEvent: (event: {pathName: string, encoded: string}) => void | Triggered when saveImage() is called, which return Base64 Encoded String and image file path. | function | no | iOS/Android | yes | | onDragEvent: (event: boolean) => void | Triggered when user marks his signature on the canvas. This will not be called when the user does not perform any action on canvas. | function | no | iOS/Android | yes | -## 静态方法 +## Static Methods -> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 +> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | @@ -295,11 +294,11 @@ ohpm install | resetImage | when called it will clear the image on the canvas | function | no | iOS/Android | yes | -## 遗留问题 +## Known Issues -## 其他 +## Others -## 开源协议 +## License -本项目基于 [The MIT License (MIT)](https://github.com/RepairShopr/react-native-signature-capture/blob/master/LICENSE) ,请自由地享受和参与开源。 +This project is licensed under [The MIT License (MIT)](https://github.com/RepairShopr/react-native-signature-capture/blob/master/LICENSE). diff --git a/en/react-native-sortable-list.md b/en/react-native-sortable-list.md index ffefcab9e801e4580dbd7abdcbb8f4272053f3b4..324ddaa944a12d0b3e442a91500319b753caf0d5 100644 --- a/en/react-native-sortable-list.md +++ b/en/react-native-sortable-list.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-sortable-list

@@ -13,13 +13,13 @@

-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-sortable-list) +> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-sortable-list) -## 安装与使用 +## Installation and Usage Find the matching version information in the release address of a third-party library:[@react-native-oh-tpl/react-native-sortabel-list Releases](https://github.com/react-native-oh-library/react-native-sortable-list/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -38,9 +38,9 @@ yarn add @react-native-oh-tpl/react-native-sortable-list -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: -> [!WARNING] 使用时 import 的库名不变。 +> [!WARNING] The name of the imported repository remains unchanged. ```jsx /** @@ -228,19 +228,19 @@ const styles = StyleSheet.create({ }); ``` -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-sortabel-list Releases](https://github.com/react-native-oh-library/react-native-sortable-list/releases) +Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-sortabel-list Releases](https://github.com/react-native-oh-library/react-native-sortable-list/releases) -## 属性 +## Properties -> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 +> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | **Type** | Required | Platform | HarmonyOS Support | | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------- | -------- | -------- | ----------------- | @@ -267,11 +267,11 @@ const styles = StyleSheet.create({ | onReleaseRow | Called when the active row was released. Returns the key and the new list order. | function | no | All | Yes | | onPressRow | Called when a row was pressed. | function | no | All | Yes | -## 静态方法 +## Static Methods -> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 +> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | **Type** | Required | Platform | HarmonyOS Support | | -------------- | --------------------------------------------------------------------------- | -------------- | -------- | -------- | ----------------- | @@ -279,10 +279,10 @@ const styles = StyleSheet.create({ | scrollTo | scrolls to a given y offset, either immediately or with a smooth animation. | y?, animated? | no | All | Yes | | scrollToRowKey | scrolls to a given row key, either immediately or with a smooth animation. | key, animated? | no | All | Yes | -## 遗留问题 +## Known Issues -## 其他 +## Others -## 开源协议 +## License -本项目基于 [MIT License](https://github.com/react-native-oh-library/react-native-sortable-list/blob/sig/LICENSE) ,请自由地享受和参与开源。 +This project is licensed under [MIT License](https://github.com/react-native-oh-library/react-native-sortable-list/blob/sig/LICENSE). diff --git a/en/react-native-spinkit.md b/en/react-native-spinkit.md index b7ca427fa4899b4137f8da875fcc01e2012c003c..8f14cddfbdb7363776e788fbb65deeb2f09defef 100644 --- a/en/react-native-spinkit.md +++ b/en/react-native-spinkit.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-spinkit

@@ -15,14 +15,14 @@ -> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-spinkit) +> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-spinkit) -## 安装与使用 +## Installation and Usage Find the matching version information in the release address of a third-party library:[@react-native-oh-tpl/react-native-spinkit Releases](https://github.com/react-native-oh-library/react-native-spinkit/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -41,9 +41,9 @@ yarn add @react-native-oh-tpl/react-native-spinkit -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: -> [!WARNING] 使用时 import 的库名不变。 +> [!WARNING] The name of the imported repository remains unchanged. ```js import React from 'react'; @@ -64,17 +64,17 @@ const SpinKitDemo: React.FC = (): JSX.Element => { export default SpinKit; ``` -## 使用 Codegen +## Use Codegen -本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。 +If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/en/codegen.md). ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking. -首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` +Open the `harmony` directory of the HarmonyOS project in DevEco Studio. -### 1.在工程根目录的 `oh-package.json5` 添加 overrides 字段 +### 1. Adding the overrides Field to oh-package.json5 File in the Root Directory of the Project ```json { @@ -85,18 +85,17 @@ export default SpinKit; } ``` -### 2.引入原生端代码 +### 2. Introducing Native Code -目前有两种方法: +Currently, two methods are available: -1. 通过 har 包引入(在 IDE 完善相关功能后该方法会被遗弃,目前首选此方法); -2. 直接链接源码。 + -方法一:通过 har 包引入(推荐) +Method 1 (recommended): Use the HAR file. -> [!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。 +> [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library. -打开 `entry/oh-package.json5`,添加以下依赖 +Open `entry/oh-package.json5` file and add the following dependencies: ```json "dependencies": { @@ -105,23 +104,23 @@ export default SpinKit; } ``` -点击右上角的 `sync` 按钮 +Click the `sync` button in the upper right corner. -或者在终端执行: +Alternatively, run the following instruction on the terminal: ```bash cd entry ohpm install ``` -方法二:直接链接源码 +Method 2: Directly link to the source code. -> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md) +> [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md). -### 3.在 ArkTs 侧引入 SpinKitView 组件 +### 3. Introducing SpinKitView Component to ArkTS -找到 **function buildCustomComponent()**,一般位于 `entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets`,添加: +Find `function buildCustomRNComponent()`, which is usually located in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets`, and add the following code: ```diff ... @@ -140,9 +139,9 @@ export function buildCustomRNComponent(ctx: ComponentBuilderContext) { } ``` -> [!TIP] 本库使用了混合方案,需要添加组件名。 +> [!TIP] If the repository uses a mixed solution, the component name needs to be added. -在`entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets` 找到常量 `arkTsComponentNames` 在其数组里添加组件名 +Find the constant `arkTsComponentNames` in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets` and add the component name to the array. ```diff const arkTsComponentNames: Array = [ @@ -152,9 +151,9 @@ const arkTsComponentNames: Array = [ + SpinKitView.NAME ]; ``` -### 4.在 ArkTs 侧引入 SpinKitPackage Package +### 4. Introducing SpinKitPackage to ArkTS -打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加: +Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code: ```diff ... @@ -168,11 +167,11 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 5.运行 +### 5. Running -点击右上角的 `sync` 按钮 +Click the `sync` button in the upper right corner. -或者在终端执行: +Alternatively, run the following instruction on the terminal: ```bash cd entry @@ -180,22 +179,22 @@ ohpm install ``` -然后编译、运行即可。 +Then build and run the code. -### 兼容性 +### Compatibility -要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-spinkit Releases](https://github.com/react-native-oh-library/react-native-spinkit/releases) +Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-spinkit Releases](https://github.com/react-native-oh-library/react-native-spinkit/releases) -## 属性 +## Properties -> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 +> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. -**SpinKit**:加载动画渲染组件,接收所有 [View](https://reactnative.dev/docs/view#props) 的props。 +**SpinKit**:Loading Animation Rendering Component, Accepts All Parameters [View](https://reactnative.dev/docs/view#props) 的props。 | props | Description | Type | Required | Platform | HarmonyOS Support | | ---- | ----------- | ---- | -------- | ---- | ------------ | @@ -220,10 +219,10 @@ ohpm install | size | Visibility of the spinner | number | No | All | Yes | -## 遗留问题 +## Known Issues -## 其他 +## Others -## 开源协议 +## License -本项目基于 [The MIT License (MIT)](https://github.com/maxs15/react-native-spinkit/blob/master/LICENSE) ,请自由地享受和参与开源。 +This project is licensed under [The MIT License (MIT)](https://github.com/maxs15/react-native-spinkit/blob/master/LICENSE). diff --git a/en/react-native-svg-charts.md b/en/react-native-svg-charts.md index 6d0b8ba049ede31f042383dc068e4a66a0f91c9e..e1a80be774e5d8e0d13eb681e42d40a7ce353bef 100644 --- a/en/react-native-svg-charts.md +++ b/en/react-native-svg-charts.md @@ -540,7 +540,7 @@ details[react-native-svg-charts](https://github.com/JesperLekland/react-native-s | data | the same data array provided to the chart, use this to map over your data points if you want decorators on each point | array | YES | ALL | YES | | ticks | if numberOfTicks has been provided to the chart this array will include the calculated tick values (useful for grids) | array | YES | ALL | YES | -### 组件特有 Properties +### Unique Properties of the Component #### Area diff --git a/en/react-native-swipeable-list.md b/en/react-native-swipeable-list.md index c507fc43d640e6b5552c3d83d10118d20bb68091..01904ed495ae53865d7bc5e9c3357b2bd16b0675 100644 --- a/en/react-native-swipeable-list.md +++ b/en/react-native-swipeable-list.md @@ -430,7 +430,7 @@ This document is verified based on the following versions: ## Properties -SwipeableFlatList 组件接收所有[React Native FlatList](https://facebook.github.io/react-native/docs/flatlist)组件的 Props. +The SwipeableFlatList component accepts all the props of the [React Native FlatList](https://facebook.github.io/react-native/docs/flatlist)component. > [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. diff --git a/en/react-native-switch-selector.md b/en/react-native-switch-selector.md index aaeecef7aa904e0930e9788b52de8e2af054eb66..7bb2d95dbbcd268067299ad2a27f8a68aafb39af 100644 --- a/en/react-native-switch-selector.md +++ b/en/react-native-switch-selector.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-switch-selector

@@ -15,11 +15,11 @@ -> [!TIP] [Github 地址](https://github.com/App2Sales/react-native-switch-selector) +> [!TIP] [GitHub address](https://github.com/App2Sales/react-native-switch-selector) -## 安装与使用 +## Installation and Usage -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -37,9 +37,9 @@ yarn add react-native-switch-selector@2.3.0 -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: -> [!WARNING] 使用时 import 的库名不变。 +> [!WARNING] The name of the imported repository remains unchanged. ```jsx import SwitchSelector from "react-native-switch-selector"; @@ -48,9 +48,9 @@ import { ScrollView } from 'react-native'; const SwitchSelectorDemo = () => { const options = [ - { label: "电影", value: "movie" }, - { label: "地图", value: "map" }, - { label: "地铁", value: "metro" } + { label: "movie", value: "movie" }, + { label: "map", value: "map" }, + { label: "subway", value: "metro" } ]; return ( @@ -65,20 +65,20 @@ const SwitchSelectorDemo = () => { export default SwitchSelectorDemo; ``` -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -本文档内容基于以下版本验证通过: +This document is verified based on the following versions: 1. RNOH:0.72.20; SDK:HarmonyOS NEXT Developer Beta1; IDE:DevEco Studio 5.0.3.200; ROM:3.0.0.18; 1. RNOH:0.72.33; SDK:OpenHarmony 5.0.0.71(API Version 12 Release); IDE:DevEco Studio 5.0.3.900; ROM:NEXT.0.0.71; -## 属性 +## Properties -> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 +> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | | ---------------------------- | ------------------------------------------------------------ | ------------------------ | -------- | ----------- | ----------------- | @@ -119,10 +119,10 @@ export default SwitchSelectorDemo; | testID | Test ID used for testing (e.g. with Appium) | string | No | Android/IOS | Yes | | accessibilityLabel | Accessibility Label used for testing (e.g. with Appium) | string | No | Android/IOS | Yes | -## 遗留问题 +## Known Issues -## 其他 +## Others -## 开源协议 +## License -本项目基于 [The MIT License (MIT)](https://github.com/App2Sales/react-native-switch-selector/blob/master/LICENSE),请自由地享受和参与开源。 \ No newline at end of file +This project is licensed under [The MIT License (MIT)](https://github.com/App2Sales/react-native-switch-selector/blob/master/LICENSE),请自由地享受和参与开源。 \ No newline at end of file diff --git a/en/react-native-touch-id.md b/en/react-native-touch-id.md index 784489d0d626907487ed7876e35448846fdcc650..19e888f1d81c30f64df7d65b9d71fceba9d37104 100644 --- a/en/react-native-touch-id.md +++ b/en/react-native-touch-id.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-touch-id

@@ -12,14 +12,14 @@

-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-touch-id) +> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-touch-id) -## 安装与使用 +## Installation and Usage Find the matching version information in the release address of a third-party library:[@react-native-oh-tpl/react-native-touch-id Releases](https://github.com/react-native-oh-library/react-native-touch-id/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -38,9 +38,9 @@ yarn add @react-native-oh-tpl/react-native-touch-id -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: -> [!WARNING] 使用时 import 的库名不变。 +> [!WARNING] The name of the imported repository remains unchanged. ```js import React, { Component, useState } from 'react'; @@ -52,7 +52,7 @@ const App = () => { return ( {result} - - +
); @@ -93,11 +93,11 @@ export default function VisionCameraDemo() { ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking. -首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` +Open the `harmony` directory of the HarmonyOS project in DevEco Studio. -### 1.在工程根目录的 `oh-package.json5` 添加 overrides 字段 +### 1. Adding the overrides Field to oh-package.json5 File in the Root Directory of the Project ```json { @@ -108,18 +108,17 @@ export default function VisionCameraDemo() { } ``` -### 2.引入原生端代码 +### 2. Introducing Native Code -目前有两种方法: +Currently, two methods are available: -1. 通过 har 包引入(在 IDE 完善相关功能后该方法会被遗弃,目前首选此方法); -2. 直接链接源码。 + -方法一:通过 har 包引入(推荐) +Method 1 (recommended): Use the HAR file. -> [!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。 +> [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library. -打开 `entry/oh-package.json5`,添加以下依赖 +Open `entry/oh-package.json5` file and add the following dependencies: ```json "dependencies": { @@ -128,22 +127,22 @@ export default function VisionCameraDemo() { } ``` -点击右上角的 `sync` 按钮 +Click the `sync` button in the upper right corner. -或者在终端执行: +Alternatively, run the following instruction on the terminal: ```bash cd entry ohpm install ``` -方法二:直接链接源码 +Method 2: Directly link to the source code. -> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md) +> [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md). -### 3.配置 CMakeLists 和引入 xxxPackge +### 3. Configuring CMakeLists and Introducing VisionCameraPackage -打开 `entry/src/main/cpp/CMakeLists.txt`,添加: +Open `entry/src/main/cpp/CMakeLists.txt` and add the following code: ```diff project(rnapp) @@ -183,7 +182,7 @@ target_link_libraries(rnoh_app PUBLIC rnoh_sample_package) # RNOH_END: manual_package_linking_2 ``` -打开 `entry/src/main/cpp/PackageProvider.cpp`,添加: +Open `entry/src/main/cpp/PackageProvider.cpp` and add the following code: ```diff #include "RNOH/PackageProvider.h" @@ -202,9 +201,9 @@ std::vector> PackageProvider::getPackages(Package::Cont } ``` -### 4.在 ArkTs 侧引入 VisionCameraView 组件 +### 4. Introducing VisionCameraView Component to ArkTS -找到 `function buildCustomRNComponent()`,一般位于 `entry/src/main/ets/pages/index.ets` 或 `entry/src/main/ets/rn/LoadBundle.ets`,添加: +Find `function buildCustomRNComponent()`, which is usually located in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets`, and add the following code: ```diff ... @@ -223,7 +222,7 @@ export function buildCustomRNComponent(ctx: ComponentBuilderContext) { } ... ``` -在`entry/src/main/ets/pages/index.ets`中,如果当前文件中存在`arkTsComponentNames`数组(后续版本新增内容),则需要在其中追加:`VisionCameraView.NAME`; +In `entry/src/main/ets/pages/index. ets`, if there is an `arkTsWidgetNames` array in the current file (which will be added in later versions), it is necessary to append `VisionCameraView` to it NAME`; ```ts ... @@ -231,11 +230,9 @@ export function buildCustomRNComponent(ctx: ComponentBuilderContext) { ... ``` +### 5. Introducing VisionCameraModulePackage to ArkTS - -### 5.在 ArkTs 侧引入 VisionCameraModulePackage - -打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加: +Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code: ```diff ... @@ -249,34 +246,34 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 6.运行 +### 6. Running -点击右上角的 `sync` 按钮 +Click the `sync` button in the upper right corner. -或者在终端执行: +Alternatively, run the following instruction on the terminal: ```bash cd entry ohpm install ``` -然后编译、运行即可。 +Then build and run the code. -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-vision-camera Releases](https://github.com/react-native-oh-library/react-native-vision-camera/releases) +Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-vision-camera Releases](https://github.com/react-native-oh-library/react-native-vision-camera/releases) -### 权限要求 +### Permission Requirements -以下权限中有`system_basic` 权限,而默认的应用权限是 `normal` ,只能使用 `normal` 等级的权限,所以可能会在安装hap包时报错**9568289**,请参考 [文档](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/bm-tool-V5#ZH-CN_TOPIC_0000001884757326__%E5%AE%89%E8%A3%85hap%E6%97%B6%E6%8F%90%E7%A4%BAcode9568289-error-install-failed-due-to-grant-request-permissions-failed) 修改应用等级为 `system_basic` +Among the following permissions, there is the system_basic permission, while the default application permission is normal. Only normal level permissions can be used, so you may encounter an error 9568289 when installing the hap package. Please refer to the [document](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/bm-tool-V5#ZH-CN_TOPIC_0000001884757326__%E5%AE%89%E8%A3%85hap%E6%97%B6%E6%8F%90%E7%A4%BAcode9568289-error-install-failed-due-to-grant-request-permissions-failed) to modify the application level to system_basic. -#### 在 entry 目录下的module.json5中添加权限 +#### Include applicable permissions in the module.json5 file within the entry directory. -打开 `entry/src/main/module.json5`,添加: +Open `entry/src/main/module.json5` and add the following code: ```diff ... @@ -314,9 +311,9 @@ ohpm install ] ``` -#### 在 entry 目录下添加申请以上权限的原因 +#### Apply the reasons for applicable permission in the entry directory. -打开 `entry/src/main/resources/base/element/string.json`,添加: +Open `entry/src/main/resources/base/element/string.json` and add the following code: ```diff ... @@ -324,25 +321,25 @@ ohpm install "string": [ + { + "name": "camera_reason", -+ "value": "使用相机" ++ "value": "use camera" + }, + { + "name": "location_reason", -+ "value": "获取当前位置" ++ "value": "Get current location" + }, + { + "name": "microphone_reason", -+ "value": "使用麦克风" ++ "value": "Use microphone" + }, ] } ``` -## 属性 +## Properties -> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 +> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | | ---------------------------------- | ------------------------------------------------------------ | -------- | -------- | ----------------- | ------------------ | @@ -377,11 +374,11 @@ ohpm install | onShutter | Called just before a photo or snapshot is captured. | function | no | All | yes | | codeScanner | A CodeScanner that can detect QR-Codes or Barcodes using platform-native APIs | object | no | All | yes | -## 静态方法 +## Static Methods -> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 +> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | | ------------------------------- | ------------------------------------------------------------ | -------- | -------- | ----------- | ----------------- | @@ -404,9 +401,9 @@ ohpm install ## API -> [!tip] "Platform"列表示该属性在原三方库上支持的平台。 +> [!tip] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!tip] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!tip] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | Name | Description | Type | Required | Platform | HarmonyOS Support | | ----------------------- | ------------------------------------------------------------ | ---- | -------- | -------- | ----------------- | @@ -419,32 +416,32 @@ ohpm install | useCodeScanner | create a `CodeScanner` instance and pass it to the `` | hook | no | All | yes | | useFrameProcessor | Returns a memoized Frame Processor function wich you can pass to the ``. | hook | no | All | no | -## 遗留问题 - -- [ ] 不支持拍照HDR [issue#1](https://github.com/react-native-oh-library/react-native-vision-camera/issues/1) -- [ ] 不支持有损缓冲压缩 [issue#2](https://github.com/react-native-oh-library/react-native-vision-camera/issues/2) -- [ ] 没有夜景模式 [issue#3](https://github.com/react-native-oh-library/react-native-vision-camera/issues/3) -- [ ] 没有实现深度数据能力 [issue#4](https://github.com/react-native-oh-library/react-native-vision-camera/issues/4) -- [ ] 依赖三方库skia未 HarmonyOS 化 [issue#5](https://github.com/react-native-oh-library/react-native-vision-camera/issues/5) -- [ ] 不支持内容失真校正 [issue#6](https://github.com/react-native-oh-library/react-native-vision-camera/issues/6) -- [ ] 不支持消除红眼 [issue#7](https://github.com/react-native-oh-library/react-native-vision-camera/issues/7) -- [ ] 快门声音无法独立控制 [issue#8](https://github.com/react-native-oh-library/react-native-vision-camera/issues/8) -- [ ] 不支持查询传感器旋转角度 [issue#9](https://github.com/react-native-oh-library/react-native-vision-camera/issues/9) -- [ ] 不支持查询硬件级别 [issue#10](https://github.com/react-native-oh-library/react-native-vision-camera/issues/10) -- [ ] 不支持查询设备正确对焦的最小距离 [issue#11](https://github.com/react-native-oh-library/react-native-vision-camera/issues/11) -- [ ] 不支持查询设备名称 [issue#12](https://github.com/react-native-oh-library/react-native-vision-camera/issues/12) -- [ ] 查询的CameraType一直是相机类型未指定 [issue#13](https://github.com/react-native-oh-library/react-native-vision-camera/issues/13) -- [ ] 不支持查询传感器旋转角度 [issue#14](https://github.com/react-native-oh-library/react-native-vision-camera/issues/14) -- [ ] 不支持查询是否支持弱光增强 [issue#15](https://github.com/react-native-oh-library/react-native-vision-camera/issues/15) -- [ ] HarmonyOS 侧相机无法获取视频视野 [issue#16](https://github.com/react-native-oh-library/react-native-vision-camera/issues/16) -- [ ] 不支持查询maxISO和minISO [issue#17](https://github.com/react-native-oh-library/react-native-vision-camera/issues/17) -- [ ] 不支持保存快照 [issue#18](https://github.com/react-native-oh-library/react-native-vision-camera/issues/18) -- [ ] 视频录制取消时无法删除临时文件 [issue#19](https://github.com/react-native-oh-library/react-native-vision-camera/issues/19) -- [ ] 无法监听相机设备变更 [issue#20](https://github.com/react-native-oh-library/react-native-vision-camera/issues/20) - -## 其他 - -## 开源协议 - -本项目基于 [The MIT License (MIT)](https://github.com/mrousavy/react-native-vision-camera/blob/main/LICENSE) ,请自由地享受和参与开源。 +## Known Issues + +- [ ] HDR photography not supported [issue#1](https://github.com/react-native-oh-library/react-native-vision-camera/issues/1) +- [ ] Lossy buffer compression not supported [issue#2](https://github.com/react-native-oh-library/react-native-vision-camera/issues/2) +- [ ] Night mode not available [issue#3](https://github.com/react-native-oh-library/react-native-vision-camera/issues/3) +- [ ] Depth data capabilities not implemented [issue#4](https://github.com/react-native-oh-library/react-native-vision-camera/issues/4) +- [ ] Third-party library skia is not HarmonyOS-compatible [issue#5](https://github.com/react-native-oh-library/react-native-vision-camera/issues/5) +- [ ] Content distortion correction not supported [issue#6](https://github.com/react-native-oh-library/react-native-vision-camera/issues/6) +- [ ] Red-eye removal not supported [issue#7](https://github.com/react-native-oh-library/react-native-vision-camera/issues/7) +- [ ] Shutter sound cannot be independently controlled [issue#8](https://github.com/react-native-oh-library/react-native-vision-camera/issues/8) +- [ ] Querying sensor rotation angle not supported [issue#9](https://github.com/react-native-oh-library/react-native-vision-camera/issues/9) +- [ ] Querying hardware level not supported [issue#10](https://github.com/react-native-oh-library/react-native-vision-camera/issues/10) +- [ ] Querying the minimum distance for proper device focusing not supported [issue#11](https://github.com/react-native-oh-library/react-native-vision-camera/issues/11) +- [ ] Querying device name not supported [issue#12](https://github.com/react-native-oh-library/react-native-vision-camera/issues/12) +- [ ] Queried CameraType always shows as unspecified camera type [issue#13](https://github.com/react-native-oh-library/react-native-vision-camera/issues/13) +- [ ] Querying sensor rotation angle not supported (Duplicate) [issue#14](https://github.com/react-native-oh-library/react-native-vision-camera/issues/14) +- [ ] Querying support for low-light enhancement not supported [issue#15](https://github.com/react-native-oh-library/react-native-vision-camera/issues/15) +- [ ] Camera on HarmonyOS side cannot obtain video field of view [issue#16](https://github.com/react-native-oh-library/react-native-vision-camera/issues/16) +- [ ] Querying maxISO and minISO not supported [issue#17](https://github.com/react-native-oh-library/react-native-vision-camera/issues/17) +- [ ] Saving snapshots not supported [issue#18](https://github.com/react-native-oh-library/react-native-vision-camera/issues/18) +- [ ] Temporary files cannot be deleted when video recording is canceled [issue#19](https://github.com/react-native-oh-library/react-native-vision-camera/issues/19) +- [ ] Camera device changes cannot be monitored [issue#20](https://github.com/react-native-oh-library/react-native-vision-camera/issues/20) + +## Others + +## License + +This project is licensed under [The MIT License (MIT)](https://github.com/mrousavy/react-native-vision-camera/blob/main/LICENSE). diff --git a/en/react-native-worklets-core.md b/en/react-native-worklets-core.md index 8f01078e74575b5de865ff39cf0bca8c3182a286..b166e637fd3852f7890dc60be51f48d0a0b0d68b 100644 --- a/en/react-native-worklets-core.md +++ b/en/react-native-worklets-core.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-worklets-core

@@ -12,13 +12,13 @@

-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-worklets-core) +> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-worklets-core) -## 安装与使用 +## Installation and Usage Find the matching version information in the release address of a third-party library:[@react-native-oh-tpl/react-native-worklets-core Releases](https://github.com/react-native-oh-library/react-native-worklets-core/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -35,7 +35,7 @@ npm i @react-native-oh-tpl/react-native-worklets-core yarn add @react-native-oh-tpl/react-native-worklets-core ``` -在项目根目录下的 `babel.config.js` 中添加 `babel` 插件 +Add babel plugins in the babel.config.js file located at the root directory of the project. ```js module.exports = { @@ -47,7 +47,7 @@ module.exports = { }; ``` -重置缓存重启项目 +Reset cache and restart the project. ```bash yarn start --reset-cache @@ -55,9 +55,9 @@ yarn start --reset-cache -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: -> [!WARNING] 使用时 import 的库名不变。 +> [!WARNING] The name of the imported repository remains unchanged. ```jsx import { useState } from "react"; @@ -65,13 +65,10 @@ import { Button, Text, View } from "react-native"; import { useRunOnJS, useWorklet } from "react-native-worklets-core"; const App = () => { - // 计数器 const [count, setCount] = useState(0); - // 定义一个useRunJS方法 const setCountRunInJS = useRunOnJS(() => { setCount(Math.random()); }, [count]); - // 在worklets线程使用RunInJS方法 const countInWorkLet = useWorklet( "default", () => { @@ -96,11 +93,11 @@ export default App; ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking. -首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` +Open the `harmony` directory of the HarmonyOS project in DevEco Studio. -### 1.在工程根目录的 `oh-package.json5` 添加 overrides 字段 +### 1. Adding the overrides Field to oh-package.json5 File in the Root Directory of the Project ```json { @@ -111,18 +108,17 @@ export default App; } ``` -### 2.引入原生端代码 +### 2. Introducing Native Code -目前有两种方法: +Currently, two methods are available: -1. 通过 har 包引入(在 IDE 完善相关功能后该方法会被遗弃,目前首选此方法); -2. 直接链接源码。 + -方法一:通过 har 包引入(推荐) +Method 1 (recommended): Use the HAR file. -> [!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。 +> [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library. -打开 `entry/oh-package.json5`,添加以下依赖 +Open `entry/oh-package.json5` file and add the following dependencies: ```json "dependencies": { @@ -131,22 +127,22 @@ export default App; } ``` -点击右上角的 `sync` 按钮 +Click the `sync` button in the upper right corner. -或者在终端执行: +Alternatively, run the following instruction on the terminal: ```shell cd entry ohpm install ``` -方法二:直接链接源码 +Method 2: Directly link to the source code. -> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md) +> [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md). -### 3.配置 CMakeLists 和引入 Worklets +### 3. Configuring CMakeLists and Introducing Worklets Package -打开 `entry/src/main/cpp/CMakeLists.txt`,添加: +Open `entry/src/main/cpp/CMakeLists.txt` and add the following code: ```diff project(rnapp) @@ -180,7 +176,7 @@ target_link_libraries(rnoh_app PUBLIC rnoh_sample_package) + target_link_libraries(rnoh_app PUBLIC rnoh_worklets) ``` -打开 `entry/src/main/cpp/PackageProvider.cpp`,添加: +Open `entry/src/main/cpp/PackageProvider.cpp` and add the following code: ```diff #include "RNOH/PackageProvider.h" @@ -199,9 +195,9 @@ std::vector> PackageProvider::getPackages(Package::Cont } ``` -### 4.在 ArkTs 侧引入 WorkletsPackage +### 4. Introducing WorkletsPackage to ArkTS -打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加: +Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code: ```diff ... @@ -215,32 +211,32 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] { } ``` -### 5.运行 +### 5. Running -点击右上角的 `sync` 按钮 +Click the `sync` button in the upper right corner. -或者在终端执行: +Alternatively, run the following instruction on the terminal: ```shell cd entry ohpm install ``` -然后编译、运行即可。 +Then build and run the code. -## 约束与限制 +## Constraints -### 兼容性 +### Compatibility -要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 +To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-library/react-native-worklets-core Releases](https://github.com/react-native-oh-library/react-native-worklets-core/releases) +Check the release version information in the release address of the third-party library: [@react-native-oh-library/react-native-worklets-core Releases](https://github.com/react-native-oh-library/react-native-worklets-core/releases) ### API -> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。 +> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library. -> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。 +> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android. | NAME | Description | Type | Required | Platform | HarmonyOS Support | | ---------------------- | ------------------------------------------------------------ | --------- | -------- | -------- | ----------------- | @@ -263,10 +259,10 @@ ohpm install | worklet | Ensures the given function is a Worklet, and throws an error if not. | function | no | All | yes | | getWorkletDependencies | Get the dependencies of the given worklet. | function | no | All | yes | -## 遗留问题 +## Known Issues -## 其他 +## Others -## 开源协议 +## License -本项目基于 [The MIT License (MIT)](https://github.com/margelo/react-native-worklets-core/blob/main/LICENSE) ,请自由地享受和参与开源。 +This project is licensed under [The MIT License (MIT)](https://github.com/margelo/react-native-worklets-core/blob/main/LICENSE). diff --git a/en/react-native-zip-archive.md b/en/react-native-zip-archive.md index e3a364d413ea9ed9af380465fdb6315a7fea9884..e743232738363b289907e99a239e0db8aee8d9f0 100644 --- a/en/react-native-zip-archive.md +++ b/en/react-native-zip-archive.md @@ -1,4 +1,4 @@ -> 模板版本:v0.2.2 +> Template version: v0.2.2

react-native-zip-archive

@@ -13,13 +13,13 @@

-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-zip-archive) +> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-zip-archive) -## 安装与使用 +## Installation and Usage Find the matching version information in the release address of a third-party library:[@react-native-oh-tpl/react-native-zip-archive Releases](https://github.com/react-native-oh-library/react-native-zip-archive/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. -进入到工程目录并输入以下命令: +Go to the project directory and execute the following instruction: @@ -38,9 +38,9 @@ yarn add @react-native-oh-tpl/react-native-zip-archive -下面的代码展示了这个库的基本使用场景: +The following code shows the basic use scenario of the repository: -> [!WARNING] 使用时 import 的库名不变。 +> [!WARNING] The name of the imported repository remains unchanged. ```js import React, { useState, useEffect } from 'react'; @@ -68,31 +68,29 @@ export default function ZipArchiveDemo() { let unzipPassword: string = ''; let needPassword: boolean = false; - // 存储设置的密码 const setUnzipPassword = (value: string) => { console.log(`setUnzipPassword: ${value}`); unzipPassword = value; } useEffect(() => { - let filesDir = pathParameters(); // 获取 HarmonyOS 应用文件路径 + let filesDir = pathParameters(); let newZipPath: any = filesDir + '.zip'; let newSourcePath: any = filesDir; - let newFolder: any = filesDir + 'Out';//解压时新建个文件夹 + let newFolder: any = filesDir + 'Out'; - setNewZipPath(newZipPath);//存储压缩包 - setNewSourcePath(newSourcePath);//原文件路径 - setNewFolder(newFolder);//解压时新建个文件夹 + setNewZipPath(newZipPath); + setNewSourcePath(newSourcePath); + setNewFolder(newFolder); if (!showInput) { - setPassword(''); // 隐藏输入框时清空密码 + setPassword(''); } }, [showInput]); - // 创建文件 const createFile = () => { if (!fileName || !fileContent) { - Alert.alert('文件名和内容不能为空'); + Alert.alert('The file name and content cannot be empty.'); return; } const filePath = `${newSourcePath}/${fileName}.txt`; @@ -101,72 +99,69 @@ export default function ZipArchiveDemo() { creteFile(filePath, fileContent) .then(() => { setCreatedFilePath(filePath); - Alert.alert('文件创建成功') + Alert.alert('File created successfully') setTimeout(() => { setFileName(''); setFileContent(''); }, 100); }) .catch((error) => { - console.log('文件创建失败:', error); + console.log('File creation failed:', error); }); } else { - Alert.alert('请输入文件名和内容'); + Alert.alert('Please enter the file name and content'); } }; - // 密码压缩 const handleZipPress = () => { if (password === '') { - Alert.alert('错误', '请输入密码'); + Alert.alert('error', 'Please input a password'); return; } if (createdFilePath) { - handleProgress();//进度条 + handleProgress(); zipWithPassword(newSourcePath, newZipPath, password) .then(() => { console.log(`password--11:${password}`) setZipPassword(password); setCompressedFilePath(newZipPath) - Alert.alert('成功', '已使用密码创建压缩'); + Alert.alert('successful', 'Created compression using password'); }) .catch(error => { - Alert.alert('错误', `创建压缩文件失败: ${error}`); + Alert.alert('error', `Failed to create compressed file: ${error}`); }); } else { - Alert.alert('无文件可供压缩'); + Alert.alert('No files available for compression'); } }; - // 解压时是否需要密码 const isUnzipWithPassword = () => { if (unzipPassword) { if (zipPassword === '') { - Alert.alert('错误', '请先进行压缩并设置密码'); + Alert.alert('error', 'Please compress and set a password first'); return; } if (unzipPassword === zipPassword) { handleGetUncompressedSize(); - handleProgress();//进度条 + handleProgress(); unzipWithPassword(newZipPath,newFolder, unzipPassword) .then(() => { - Alert.alert('成功', '已使用密码解压文件'); + Alert.alert('success', 'The password has been used to decompress the file'); }) .catch(error => { - Alert.alert('错误', `解压文件失败: ${error}`); + Alert.alert('error', `Failed to decompress file: ${error}`); }); } else { - Alert.alert('密码输入错误'); + Alert.alert('Password input error'); } } else { - Alert.alert('错误', '请先输入密码'); + Alert.alert('error', 'Please enter your password first'); } } - // 密码解压&解压 const handleUnzipPress = () => { if (this.needPassword) { isUnzipWithPassword(); @@ -182,19 +177,19 @@ export default function ZipArchiveDemo() { if (compressedFilePath) { if (needPassword === false) { handleGetUncompressedSize(); - handleProgress();//进度条 + handleProgress(); unzip(newZipPath, newFolder,'UTF-8') .then(() => { console.log(`unzip success`) - Alert.alert('成功', '已解压'); + Alert.alert('success', 'Decompressed'); }) .catch(error => { - Alert.alert('错误', '解压失败'); + Alert.alert('error', 'Decompression failed'); console.log(`unzip error: ${error}`); }) } } else { - Alert.alert('无压缩文件可供解压'); + Alert.alert('No compressed files available for decompression'); } } }) @@ -203,10 +198,9 @@ export default function ZipArchiveDemo() { }) } - // 进度条 const handleProgress = () => { setIsProgressPing(true); - setProgress(0); //重置进度条 + setProgress(0); interface data { progress: number, filePath: string @@ -219,7 +213,7 @@ export default function ZipArchiveDemo() { setProgress(currentProgress); console.log(`current progress: ${currentProgress}%`); } else { - clearInterval(interval); // 达到最大值后清除 interval + clearInterval(interval); setIsProgressPing(false); } }, 1000); @@ -243,26 +237,24 @@ export default function ZipArchiveDemo() { }) } - // unzipAssets const handleUnzipAssets = async () => { setLoading(true); let filesDir = pathParameters(); - //解压files.zip文件到系统中的 destinationFolder 目录中 let assetPath = filesDir + '.zip'; let targetPath = filesDir + 'destinationFolder'; if (compressedFilePath) { try { await unzipAssets(assetPath, targetPath); - setUnzipStatus('解压完成'); + setUnzipStatus('Decompression completed'); console.log(`unzipAssets success`); } catch (err) { - setUnzipStatus(`解压失败:${err}`); + setUnzipStatus(`Decompression failed:${err}`); console.log(`unzipAssets err: ${err}`); } finally { setLoading(false); } } else { - Alert.alert('无压缩文件可供解压'); + Alert.alert('No compressed files available for decompression'); } } @@ -282,7 +274,7 @@ export default function ZipArchiveDemo() { - 解压缩后的大小:{uncompressSize ? uncompressSize : '0'}字节 + Size after decompression:{uncompressSize ? uncompressSize : '0'}byte @@ -293,7 +285,7 @@ export default function ZipArchiveDemo() { setFileContent(text)} value={fileContent} - placeholder="文件内容" + placeholder="file content" multiline={true} /> -