global_resource_management:基于OpenHarmony的资源管理组件项目

Providing resource loading| parsing| and reading capabilities | 提供资源加载、解析、读取的能力

分支291Tags57
文件最后提交记录最后更新时间
1 个月前
4 天前
8 天前
1 个月前
5 年前
4 年前
4 年前
4 年前
4 年前
15 天前
3 年前
2 个月前

资源管理组件

简介

资源管理组件为应用提供加载多语言界面资源的能力,如不同语言下提供不同的应用名称或图标等。

目录

资源管理组件源代码目录结构如下所示:

/base/global/
├── resource_management     # 资源管理代码仓
│   ├── frameworks          # 资源管理核心代码
│   │   ├── resmgr          # 资源解析核心代码
│   │   │   ├── include     # 资源管理头文件
│   │   │   ├── src         # 资源管理实现代码
│   │   │   └── test        # 资源管理测试代码
│   ├── interfaces          # 资源管理接口
│   │   ├── inner_api       # 资源管理对子系统间接口
│   │   └── js              # 资源管理JavaScript接口

约束

语言限制:JavaScript语言

说明

调用 **getString **接口获取应用的资源信息 。

import resmgr from '@ohos.resmgr'
.....
    resmgr.getResourceManager((error,mgr) => {
        // callback
        mgr.getString(0x1000000, (error, value) => {
            if (error != null) {
                console.log(error);
            } else {
                console.log(value);
            }
        });

        // promise
        mgr.getString(0x1000000).then(value => {
            console.log(value);
        }).catch(error => {
            console.log("getstring promise " + error);
        });
    });

相关仓

全球化子系统

global_i18n_standard

global_resmgr_standard

项目介绍

Providing resource loading| parsing| and reading capabilities | 提供资源加载、解析、读取的能力

定制我的领域