Skip to content

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

License

Notifications You must be signed in to change notification settings

openharmony/global_resource_management

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 12