global_global_cangjie_wrapper:基于 OpenHarmony 的全球化仓颉接口项目

全局化子系统仓颉封装层

Branch6Tags0
FilesLast commitLast update
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago

global_cangjie_wrapper

Introduction

The global_cangjie_wrapper is a Cangjie API encapsulated on OpenHarmony based on the capabilities of the global Subsystem. If OpenHarmony systems or applications need to be used globally, they must meet the requirements of users in different regions on languages and cultures. The Globalization subsystem provides the multi-language and multi-cultural capabilities for global use, including:

  • Resource management

    The module loads, parses, and initializes system and application resources based on device types and system configurations, and provides APIs for obtaining resources such as character strings and media files.

  • Internationalization (i18n)

    The subsystem provides the bottom-layer resource backtracking capabilities, with a wide array of i18n APIs for implementing functions such as calendar.

The currently open Ability Cangjie api only supports standard devices.

Architecture

Figure 1 Architecture of Cangjie Global

Architecture of Cangjie Global

As shown in the architecture:

  • Calendar: Provides the capability to obtain and set calendar properties, such as time, time zone, etc.
  • ResourceManager: Provides the capability for application resource acquisition.
  • System: Provides the capability to obtain the application's preferred language.
  • Cangjie Global FFI interface: Based on cross-language interoperability via C interfaces to implement global Cangjie API.
  • i18n: Responsible for providing basic internationalization functions, and encapsulates C interfaces for Cangjie to conduct interoperation.
  • resource_management: Responsible for providing basic resource management functions, and encapsulates C interfaces for Cangjie to conduct interoperation.

Directory Structure

base/global/global_cangjie_wrapper
├── figures                 # architecture pictures
├── kit                     # Cangjie LocalizationKit kit code
│   └── LocalizationKit
├── ohos                    # Cangjie Global code
│   ├── BUILD.gn
│   ├── i18n
│   ├── raw_file_descriptor
│   ├── resource
│   └── resource_manager
└── test                    # Cangjie Global test cases

Usage Guidelines

The following features are provided:

  • Calendar provides the capability to obtain and set calendar properties, such as time, time zone, etc.
  • ResourceManager provides the capability for application resource acquisition.
  • System provides the capability to obtain the application's preferred language.

The following features are not provided yet:

  • Date formatting, number formatting, and sorting.
  • Functions such as region management, phone number processing, text processing, time zone and holiday management.
  • Cross-thread transmission of resource objects.

For Global-related APIs, please refer to

  1. ohos.i18n
  2. ohos.resource_manager

For relevant guidance, please refer to Internationalization Development Guide

Repositories Involved

global_i18n

global_resource_management

arkcompiler_cangjie_ark_interop

Code Contribution

Developers are welcome to contribute code, documentation, etc. For specific contribution processes and methods, please refer to Code Contribution.

Introduction

全局化子系统仓颉封装层

Customize your domain