openharmony_ci 577315ae2c !123 update system resource path
Merge pull request !123 from VictoriaGuo/master
2022-03-16 11:01:23 +00:00
2022-03-14 15:04:48 +08:00
2022-03-12 16:06:24 +08:00
2021-06-02 02:18:47 +08:00
2022-03-10 15:08:48 +08:00
2022-03-12 16:06:24 +08:00
2022-03-12 16:06:24 +08:00
2022-03-12 16:06:24 +08:00
2022-03-12 16:06:24 +08:00
2022-03-08 18:00:30 +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/
├── resmgr_standard         # Code repository for the Resmgr module
│   ├── frameworks          # Core code
│   │   ├── resmgr          # Resource parsing code
│   │   │   ├── include     # Header files
│   │   │   ├── src         # Implementation code
│   │   │   └── test        # Test code
│   ├── interfaces          # APIs
│   │   ├── innerkits       # 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

S
Description
No description provided
Readme 1.2 MiB
Languages
C++ 96.5%
C 3.5%