HarmonyOS NEXT应用元服务开发多语种场景

鸿蒙时代
发布于 2024-10-21 14:47
浏览
0收藏

当对朗读内容进行标注时,须对标注字符串进行多语种翻译,具体支持的语种和应用本身界面支持的语种保持一致。若采用多个字符串进行朗读内容的拼接,需考虑多语种的情况,避免拼接后朗读错误,例如阿拉伯语从右到左。

@Component
export struct Rule_2_1_16 {
  title: string = 'Rule 2.1.16'
  private multilingual: string = 'It is convenient: 屏幕朗读已开启 and use'

  build() {
    NavDestination() {
      Column() {
        Flex({
          direction: FlexDirection.Column,
          alignItems: ItemAlign.Center,
          justifyContent: FlexAlign.Center,
        }) {
          Row() {
            Text(this.multilingual)
              .fontSize(30)
              .fontColor(Color.Blue)
          }
          .width('80%')
        }
        .width('100%')
        .height('100%')
        .backgroundColor(Color.White)
      }
    }.title(this.title)
  }
}

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.

本文主要引用官方文档材料基API 12 Release

分类
收藏
回复
举报
回复
    相关推荐