Go to file
kangchongtao 9172b62094 部件编译整改
Signed-off-by: kangchongtao <kangchongtao@huawei.com>
Change-Id: Iac014092a9fd027c505b074ad648beff8c41a13b
2024-06-03 00:44:33 +08:00
dfx/hisysevent_adapter dfx质量需求,解决字典覆盖率不达100%问题,降低日志重复率和日志超限次数 2024-05-24 16:49:49 +08:00
frameworks/resmgr 部件编译整改 2024-06-03 00:44:33 +08:00
interfaces 部件编译整改 2024-06-03 00:44:33 +08:00
test fuzz模块名和看板上保持一致 2024-04-10 16:37:26 +08:00
.gitattributes update OpenHarmony 2.0 Canary 2021-06-02 02:18:47 +08:00
bundle.json 新增CAPI接口 2024-05-19 16:09:40 +08:00
hisysevent.yaml hisysevent参数描述修改 2022-12-26 10:37:03 +08:00
LICENSE Optimize code 2022-03-12 16:06:24 +08:00
OAT.xml Optimize code 2022-03-12 16:06:24 +08:00
README_zh.md 将innerkits修改为inner_api 2022-05-07 11:50:26 +08:00
README.md 将innerkits修改为inner_api 2022-05-07 11:50:26 +08:00
resmgr.gni 部件整改 2023-04-21 02:22:20 +00:00

Resmgr

Introduction

The resource management module, namely, Resmgr, provides the function of loading multi-language GUI resources for applications, for example, displaying the application names or icons specific to a certain language.

Directory Structure

The directory structure of the Resmgr module is as follows:

/base/global/
├── resource_management     # Code repository for the Resmgr module
│   ├── frameworks          # Core code
│   │   ├── resmgr          # Resource parsing code
│   │   │   ├── include     # Header files
│   │   │   ├── src         # Implementation code
│   │   │   └── test        # Test code
│   ├── interfaces          # APIs
│   │   ├── inner_api       # APIs for internal subsystems
│   │   └── js              # JavaScript APIs

Constraints

Development language: JavaScript

Usage

Call the getString API to obtain the resource information of the application.

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);
        });
    });

Repositories Involved

Globalization subsystem

global_i18n_standard

global_resmgr_standard