Go to file
mengjingzhimo 4cb687fa21 Signed-off-by: mengjingzhimo <luoboming@huawei.com>
Changes to be committed:
	modified:   frameworks/resmgr/src/resource_manager_impl.cpp
2022-08-22 15:03:41 +08:00
dfx/hisysevent_adapter 全球化子系统DFX 打点 2022-06-29 19:30:20 +08:00
frameworks/resmgr Signed-off-by: mengjingzhimo <luoboming@huawei.com> 2022-08-22 15:03:41 +08:00
interfaces !186 修改头文件 2022-07-28 08:19:11 +00:00
test/resource add inputDevice determiner 2022-07-14 10:39:34 +08:00
.gitattributes update OpenHarmony 2.0 Canary 2021-06-02 02:18:47 +08:00
bundle.json 全球化子系统DFX 打点 2022-06-29 19:30:20 +08:00
hisysevent.yaml 全球化子系统DFX 打点 2022-06-29 19:30:20 +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 base目录aafwk外部依赖 2022-05-25 15:57:29 +08: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