Go to file
openharmony_ci e0cb4d57d3
!703 修复GetPluralRulesAndSelect稳定性问题
Merge pull request !703 from liduo/fix_plural_crash
2024-10-05 07:27:36 +00:00
dfx/hisysevent_adapter "修改部分日志减少日志超限" 2024-07-19 11:09:42 +08:00
frameworks/resmgr fix multi-thread crash in GetPluralRulesAndSelect function 2024-10-04 16:32:04 +08:00
interfaces bundleName为空时,获取当前应用的bundleName 2024-09-20 19:41:50 +08:00
test other_icons下图标支持缓存 2024-08-22 15:51:31 +08:00
.gitattributes update OpenHarmony 2.0 Canary 2021-06-02 02:18:47 +08:00
bundle.json broker整改 2024-08-08 11:35:07 +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 broker整改 2024-08-08 11:35:07 +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