diff --git a/LocalizationKit/entry/src/main/ets/pages/ConvertAppIconToPixelMap.ets b/LocalizationKit/entry/src/main/ets/pages/ConvertAppIconToPixelMap.ets index d2fb46528db2b488335abbef13684ddba08fd403..c001b29c8ca2e9e38855a01e7f47f6c640ab248d 100644 --- a/LocalizationKit/entry/src/main/ets/pages/ConvertAppIconToPixelMap.ets +++ b/LocalizationKit/entry/src/main/ets/pages/ConvertAppIconToPixelMap.ets @@ -17,7 +17,7 @@ * FAQ:如何将app.media.app_icon,转换为PixelMap */ -// DocsCode 1 +// [Start ConvertAppIconToPixelMap] import { image } from '@kit.ImageKit'; @Entry @@ -27,7 +27,7 @@ struct Index { convert() { try { - // 媒体文件字节数组 + // Byte array of media files this.getUIContext().getHostContext()!.resourceManager.getMediaContent($r('app.media.startIcon').id, (error, value: ArrayBuffer) => { let opts: image.InitializationOptions = { editable: true, @@ -37,7 +37,7 @@ struct Index { let uint8Array: Uint8Array = new Uint8Array(value); let buffer: ArrayBuffer = uint8Array.buffer.slice(0); - // 创建PixelMap + // Create PixelMap image.createPixelMap(buffer, opts).then((pixelMap) => { // ... this.text = JSON.stringify(pixelMap); @@ -50,7 +50,7 @@ struct Index { build() { Column() { - Button('点击转换') + Button('Click to convert') .onClick(() => { this.convert(); }) @@ -60,4 +60,4 @@ struct Index { .padding(16) } } -// DocsCode 1 \ No newline at end of file +// [End ConvertAppIconToPixelMap] \ No newline at end of file diff --git a/LocalizationKit/entry/src/main/ets/pages/RawXmlFileToStringParser.ets b/LocalizationKit/entry/src/main/ets/pages/RawXmlFileToStringParser.ets index 9402569b28898b449d12b159eb2e5297f2e1ceff..3b013e4a569197d62fd613090740219ca65943c1 100644 --- a/LocalizationKit/entry/src/main/ets/pages/RawXmlFileToStringParser.ets +++ b/LocalizationKit/entry/src/main/ets/pages/RawXmlFileToStringParser.ets @@ -17,11 +17,11 @@ * FAQ:如何读取rawfile中的xml文件并转化为String类型 */ -// DocsCode 1 +// [Start RawXmlFileToStringParser] import { BusinessError } from '@kit.BasicServicesKit'; import { util } from '@kit.ArkTS'; -// 工具类中:在EntryAbility中获取Context后保存至AppStorage,然后在工具类中使用AppStorage获取 +// In the utility class, retrieve the Context from the Entry Ability and save it to AppStore, then use AppStore to retrieve it in the utility class let context = AppStorage.get("context") as UIContext; try { @@ -39,4 +39,4 @@ try { let message = (error as BusinessError).message; console.error(`callback getRawFileContent failed, error code: ${code}, message: ${message}.`); } -// DocsCode 1 \ No newline at end of file +// [End RawXmlFileToStringParser] \ No newline at end of file