1. 本地语言国际化
    如下图文件结构所示,在项目创建时,工程目录便已为我们创建了对应的文件结构。

entry/src/main/resources/base/element/string.json 此处为默认语言文字。like this picture,you can add the json list to it if you need.

And ,you can save the different language with the en_US or zh_CN ...

  1. How can I use it?

Yes, you can use it like this , Text($r('app.string.pendingTask'))

Logo

讨论HarmonyOS开发技术,专注于API与组件、DevEco Studio、测试、元服务和应用上架分发等。

更多推荐