1e41f4b71Sopenharmony_ci
2e41f4b71Sopenharmony_ci# Globalization Changelog
3e41f4b71Sopenharmony_ci
4e41f4b71Sopenharmony_ci## cl.global.1 Change in the Resource Matching Logic
5e41f4b71Sopenharmony_ci
6e41f4b71Sopenharmony_ci**Access Level**
7e41f4b71Sopenharmony_ci
8e41f4b71Sopenharmony_ciPublic API
9e41f4b71Sopenharmony_ci
10e41f4b71Sopenharmony_ci**Reason for Change**
11e41f4b71Sopenharmony_ci
12e41f4b71Sopenharmony_ciThe resources in the mcc directory cannot be obtained properly when the SIM card is inserted, affecting resource customization.
13e41f4b71Sopenharmony_ci
14e41f4b71Sopenharmony_ci**Change Impact**
15e41f4b71Sopenharmony_ci
16e41f4b71Sopenharmony_ciThis change is a non-compatible change.
17e41f4b71Sopenharmony_ci
18e41f4b71Sopenharmony_ciBefore change: Differentiated resources such as the mcc directory are configured for an application. However, when a SIM card is inserted, resources in the default language directory are displayed. When no SIM card is inserted, resources in the mcc directory are displayed.
19e41f4b71Sopenharmony_ci
20e41f4b71Sopenharmony_ciFor example, **Wi-Fi** is displayed when a SIM card is inserted, and **WLAN** is displayed when no SIM card is inserted.
21e41f4b71Sopenharmony_ci
22e41f4b71Sopenharmony_ciAfter change: When a SIM card is inserted, resources in the mcc directory are displayed. If no SIM card is inserted, resources in the default language directory are displayed.
23e41f4b71Sopenharmony_ci
24e41f4b71Sopenharmony_ciFor example, **WLAN** is displayed when a SIM card is inserted, and **Wi-Fi** is displayed when no SIM card is inserted.
25e41f4b71Sopenharmony_ci
26e41f4b71Sopenharmony_ci**Start API Level**
27e41f4b71Sopenharmony_ci
28e41f4b71Sopenharmony_ci9
29e41f4b71Sopenharmony_ci
30e41f4b71Sopenharmony_ci**Change Since**
31e41f4b71Sopenharmony_ci
32e41f4b71Sopenharmony_ciOpenHarmony SDK 5.0.0.33
33e41f4b71Sopenharmony_ci
34e41f4b71Sopenharmony_ci**Key API/Component Changes**
35e41f4b71Sopenharmony_ci
36e41f4b71Sopenharmony_ci**SystemCapability.Global.ResourceManager** provides APIs for resource management.
37e41f4b71Sopenharmony_ciFor details about the APIs, see [API Reference](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-localization-kit/js-apis-resource-manager.md).
38e41f4b71Sopenharmony_ci
39e41f4b71Sopenharmony_ci**Adaptation Guide**
40e41f4b71Sopenharmony_ci
41e41f4b71Sopenharmony_ciBefore the change, if the string **WLAN** is configured in the default language directory and the string **Wi-Fi** is configured in the mcc directory, you need to configure the string **WLAN** in the mcc directory and the string **Wi-Fi** in the default language directory.
42e41f4b71Sopenharmony_ci
43e41f4b71Sopenharmony_ci## cl.LocalizationKit.2 Change in the raw_file Header File
44e41f4b71Sopenharmony_ci
45e41f4b71Sopenharmony_ci**Access Level**
46e41f4b71Sopenharmony_ci
47e41f4b71Sopenharmony_ciPublic API
48e41f4b71Sopenharmony_ci
49e41f4b71Sopenharmony_ci**Reason for Change**
50e41f4b71Sopenharmony_ci
51e41f4b71Sopenharmony_ciThe raw_file module references the string header file, which is a C++ standard library file. As a result, the raw_file module cannot be used in the C language environment.
52e41f4b71Sopenharmony_ci
53e41f4b71Sopenharmony_ci**Change Impact**
54e41f4b71Sopenharmony_ci
55e41f4b71Sopenharmony_ciThis change is a non-compatible change.
56e41f4b71Sopenharmony_ci
57e41f4b71Sopenharmony_ciBefore change:
58e41f4b71Sopenharmony_ci
59e41f4b71Sopenharmony_ciIn the C++ environment, if you use the **raw_file.h** header file but do not reference the string header file, the compilation is successful when you call string library functions such as **std::string**.
60e41f4b71Sopenharmony_ci
61e41f4b71Sopenharmony_ci```cpp
62e41f4b71Sopenharmony_ci#include <rawfile/raw_file_manager.h>
63e41f4b71Sopenharmony_ci#include <rawfile/raw_file.h>
64e41f4b71Sopenharmony_ci
65e41f4b71Sopenharmony_cistatic napi_value GetRawFileContent(napi_env env, napi_callback_info info) {
66e41f4b71Sopenharmony_ci    size_t argc = 2;
67e41f4b71Sopenharmony_ci    napi_value argv[2] = {NULL};
68e41f4b71Sopenharmony_ci    napi_get_cb_info(env, info, &argc, argv, NULL, NULL);
69e41f4b71Sopenharmony_ci    napi_valuetype valueType;
70e41f4b71Sopenharmony_ci    napi_typeof(env, argv[0], &valueType);
71e41f4b71Sopenharmony_ci    NativeResourceManager *mNativeResMgr = OH_ResourceManager_InitNativeResourceManager(env, argv[0]);
72e41f4b71Sopenharmony_ci    size_t strSize;
73e41f4b71Sopenharmony_ci    char strBuf[256];
74e41f4b71Sopenharmony_ci    napi_get_value_string_utf8(env, argv[1], strBuf, sizeof(strBuf), &strSize);
75e41f4b71Sopenharmony_ci    std::string filename(strBuf, strSize);   // Compilation is successful.
76e41f4b71Sopenharmony_ci    RawFile *rawFile = OH_ResourceManager_OpenRawFile(mNativeResMgr, filename.c_str());
77e41f4b71Sopenharmony_ci}
78e41f4b71Sopenharmony_ci```
79e41f4b71Sopenharmony_ci
80e41f4b71Sopenharmony_ciAfter change:
81e41f4b71Sopenharmony_ci
82e41f4b71Sopenharmony_ciIn the C++ environment, if you use the **raw_file.h** header file but do not reference the string header file, the compilation fails when you call string library functions such as **std::string**.
83e41f4b71Sopenharmony_ci
84e41f4b71Sopenharmony_ci```cpp
85e41f4b71Sopenharmony_ci#include <rawfile/raw_file_manager.h>
86e41f4b71Sopenharmony_ci#include <rawfile/raw_file.h>
87e41f4b71Sopenharmony_ci
88e41f4b71Sopenharmony_cistatic napi_value GetRawFileContent(napi_env env, napi_callback_info info) {
89e41f4b71Sopenharmony_ci    size_t argc = 2;
90e41f4b71Sopenharmony_ci    napi_value argv[2] = {NULL};
91e41f4b71Sopenharmony_ci    napi_get_cb_info(env, info, &argc, argv, NULL, NULL);
92e41f4b71Sopenharmony_ci    napi_valuetype valueType;
93e41f4b71Sopenharmony_ci    napi_typeof(env, argv[0], &valueType);
94e41f4b71Sopenharmony_ci    NativeResourceManager *mNativeResMgr = OH_ResourceManager_InitNativeResourceManager(env, argv[0]);
95e41f4b71Sopenharmony_ci    size_t strSize;
96e41f4b71Sopenharmony_ci    char strBuf[256];
97e41f4b71Sopenharmony_ci    napi_get_value_string_utf8(env, argv[1], strBuf, sizeof(strBuf), &strSize);
98e41f4b71Sopenharmony_ci    std::string filename(strBuf, strSize);   // Compilation fails.
99e41f4b71Sopenharmony_ci    RawFile *rawFile = OH_ResourceManager_OpenRawFile(mNativeResMgr, filename.c_str());
100e41f4b71Sopenharmony_ci}
101e41f4b71Sopenharmony_ci```
102e41f4b71Sopenharmony_ci
103e41f4b71Sopenharmony_ci**Start API Level**
104e41f4b71Sopenharmony_ci
105e41f4b71Sopenharmony_ciAPI 8
106e41f4b71Sopenharmony_ci
107e41f4b71Sopenharmony_ci**Change Since**
108e41f4b71Sopenharmony_ci
109e41f4b71Sopenharmony_ciOpenHarmony SDK 5.0.0.33
110e41f4b71Sopenharmony_ci
111e41f4b71Sopenharmony_ci**Key API/Component Changes**
112e41f4b71Sopenharmony_ci
113e41f4b71Sopenharmony_ci| Before Change                     | After Change                                                         |
114e41f4b71Sopenharmony_ci|----------------------------|--------------------------------------------------------------|
115e41f4b71Sopenharmony_ci| `#include <string>`| #include <stddef.h><br>#include <stdint.h><br>#include <stdbool.h> |
116e41f4b71Sopenharmony_ci
117e41f4b71Sopenharmony_ci**Adaptation Guide**
118e41f4b71Sopenharmony_ci
119e41f4b71Sopenharmony_ciIn the C++ environment, if you use the **raw_file.h** header file but do not reference the string header file, you need to include the string header file so that the compilation is successful when you call string library functions such as **std::string**.
120e41f4b71Sopenharmony_ci
121e41f4b71Sopenharmony_ci```cpp
122e41f4b71Sopenharmony_ci#include <rawfile/raw_file_manager.h>
123e41f4b71Sopenharmony_ci#include <rawfile/raw_file.h>
124e41f4b71Sopenharmony_ci#include <string>           // Manually reference the string header file.
125e41f4b71Sopenharmony_ci
126e41f4b71Sopenharmony_cistatic napi_value GetRawFileContent(napi_env env, napi_callback_info info) {
127e41f4b71Sopenharmony_ci    size_t argc = 2;
128e41f4b71Sopenharmony_ci    napi_value argv[2] = {NULL};
129e41f4b71Sopenharmony_ci    napi_get_cb_info(env, info, &argc, argv, NULL, NULL);
130e41f4b71Sopenharmony_ci    napi_valuetype valueType;
131e41f4b71Sopenharmony_ci    napi_typeof(env, argv[0], &valueType);
132e41f4b71Sopenharmony_ci    NativeResourceManager *mNativeResMgr = OH_ResourceManager_InitNativeResourceManager(env, argv[0]);
133e41f4b71Sopenharmony_ci    size_t strSize;
134e41f4b71Sopenharmony_ci    char strBuf[256];
135e41f4b71Sopenharmony_ci    napi_get_value_string_utf8(env, argv[1], strBuf, sizeof(strBuf), &strSize);
136e41f4b71Sopenharmony_ci    std::string filename(strBuf, strSize);   // Compilation is successful.
137e41f4b71Sopenharmony_ci    RawFile *rawFile = OH_ResourceManager_OpenRawFile(mNativeResMgr, filename.c_str());
138e41f4b71Sopenharmony_ci}
139e41f4b71Sopenharmony_ci```
140e41f4b71Sopenharmony_ci
141e41f4b71Sopenharmony_ci## cl.global.3 raw_file API Deprecated
142e41f4b71Sopenharmony_ci
143e41f4b71Sopenharmony_ci**Access Level**
144e41f4b71Sopenharmony_ci
145e41f4b71Sopenharmony_ciPublic API
146e41f4b71Sopenharmony_ci
147e41f4b71Sopenharmony_ci**Reason for Change**
148e41f4b71Sopenharmony_ci
149e41f4b71Sopenharmony_ciReference parameters are used in **OH_ResourceManager_GetRawFileDescriptor** and **OH_ResourceManager_ReleaseRawFileDescriptor**, which affects normal use of the APIs in the C environment.
150e41f4b71Sopenharmony_ci
151e41f4b71Sopenharmony_ci**Change Impact**
152e41f4b71Sopenharmony_ci
153e41f4b71Sopenharmony_ciThis change is a compatible change.
154e41f4b71Sopenharmony_ci
155e41f4b71Sopenharmony_ciAfter the change, you need to use the substitute APIs for **OH_ResourceManager_GetRawFileDescriptor** and **OH_ResourceManager_ReleaseRawFileDescriptor**.
156e41f4b71Sopenharmony_ci
157e41f4b71Sopenharmony_ci**Change Since**
158e41f4b71Sopenharmony_ci
159e41f4b71Sopenharmony_ciOpenHarmony SDK 5.0.0.33
160e41f4b71Sopenharmony_ci
161e41f4b71Sopenharmony_ci**Deprecated APIs/Components**
162e41f4b71Sopenharmony_ci
163e41f4b71Sopenharmony_ci| API                                                                                               | Description   | Substitute API                                                                                                   |
164e41f4b71Sopenharmony_ci|-----------------------------------------------------------------------------------------------------|---------|---------------------------------------------------------------------------------------------------------|
165e41f4b71Sopenharmony_ci| bool OH_ResourceManager_GetRawFileDescriptor(const RawFile \*rawFile, RawFileDescriptor &descriptor) | Obtains the rawfile file descriptor.| bool OH_ResourceManager_GetRawFileDescriptorData(const RawFile \*rawFile, RawFileDescriptor \*descriptor) |
166e41f4b71Sopenharmony_ci| bool OH_ResourceManager_ReleaseRawFileDescriptor(const RawFileDescriptor &descriptor)               | Releases the rawfile file descriptor.| bool OH_ResourceManager_ReleaseRawFileDescriptorData(const RawFileDescriptor \*descriptor)               |
167e41f4b71Sopenharmony_ci
168e41f4b71Sopenharmony_ci
169e41f4b71Sopenharmony_ci**Adaptation Guide**
170e41f4b71Sopenharmony_ci
171e41f4b71Sopenharmony_ciAfter the change, you need to call **OH_ResourceManager_GetRawFileDescriptorData** to obtain the rawfile descriptor to read the rawfile content, and call **OH_ResourceManager_ReleaseRawFileDescriptorData** to release the obtained rawfile descriptor.
172e41f4b71Sopenharmony_ci
173e41f4b71Sopenharmony_ci## cl.global.4 ohresmgr API Deprecated
174e41f4b71Sopenharmony_ci
175e41f4b71Sopenharmony_ci**Access Level**
176e41f4b71Sopenharmony_ci
177e41f4b71Sopenharmony_ciPublic API
178e41f4b71Sopenharmony_ci
179e41f4b71Sopenharmony_ci**Reason for Change**
180e41f4b71Sopenharmony_ci
181e41f4b71Sopenharmony_ciOptional parameters are used in certain ohresmgr APIs, which affects normal use of these APIs in the C environment.
182e41f4b71Sopenharmony_ci
183e41f4b71Sopenharmony_ci**Change Impact**
184e41f4b71Sopenharmony_ci
185e41f4b71Sopenharmony_ciThis change is a compatible change.
186e41f4b71Sopenharmony_ci
187e41f4b71Sopenharmony_ciThe ohresmgr APIs that use optional parameters are deprecated and you are advised to use the substitute APIs.
188e41f4b71Sopenharmony_ci
189e41f4b71Sopenharmony_ci**Change Since**
190e41f4b71Sopenharmony_ci
191e41f4b71Sopenharmony_ciOpenHarmony SDK 5.0.0.33
192e41f4b71Sopenharmony_ci
193e41f4b71Sopenharmony_ci**Deprecated APIs/Components**
194e41f4b71Sopenharmony_ci
195e41f4b71Sopenharmony_ci| API                                                                                                                                                                                                                       | Description   | Substitute API                                                                                                                                                                                                                   |
196e41f4b71Sopenharmony_ci|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
197e41f4b71Sopenharmony_ci| ResourceManager_ErrorCode OH_ResourceManager_GetMediaBase64(const NativeResourceManager \*mgr, uint32_t resId,     char \*\*resultValue, uint64_t \*resultLen, uint32_t density = 0)                                            | Obtains the Base64 code of a media file based on the resource ID.| ResourceManager_ErrorCode OH_ResourceManager_GetMediaBase64Data(const NativeResourceManager \*mgr, uint32_t resId,     char \*\*resultValue, uint64_t \*resultLen, uint32_t density)                                        |
198e41f4b71Sopenharmony_ci| ResourceManager_ErrorCode OH_ResourceManager_GetMediaBase64ByName(const NativeResourceManager \*mgr,     const char \*resName, char \*\*resultValue, uint64_t \*resultLen, uint32_t density = 0)                                 | Obtains the Base64 code of a media file based on the resource name.| ResourceManager_ErrorCode OH_ResourceManager_GetMediaBase64DataByName(const NativeResourceManager \*mgr,     const char \*resName, char \*\*resultValue, uint64_t \*resultLen, uint32_t density)                             |
199e41f4b71Sopenharmony_ci| ResourceManager_ErrorCode OH_ResourceManager_GetMedia(const NativeResourceManager \*mgr, uint32_t resId,     uint8_t \*\*resultValue, uint64_t \*resultLen, uint32_t density = 0)                                               | Obtains the content of a media file based on the resource ID.| ResourceManager_ErrorCode OH_ResourceManager_GetMediaData(const NativeResourceManager \*mgr, uint32_t resId,     uint8_t \*\*resultValue, uint64_t \*resultLen, uint32_t density)                                           |
200e41f4b71Sopenharmony_ci| ResourceManager_ErrorCode OH_ResourceManager_GetMediaByName(const NativeResourceManager \*mgr, const char \*resName,     uint8_t \*\*resultValue, uint64_t \*resultLen, uint32_t density = 0)                                    | Obtains the content of a media file based on the resource name.| ResourceManager_ErrorCode OH_ResourceManager_GetMediaDataByName(const NativeResourceManager \*mgr, const char \*resName,     uint8_t \*\*resultValue, uint64_t \*resultLen, uint32_t density)                                |
201e41f4b71Sopenharmony_ci| ResourceManager_ErrorCode OH_ResourceManager_GetDrawableDescriptor(const NativeResourceManager \*mgr,     uint32_t resId, ArkUI_DrawableDescriptor \*\*drawableDescriptor, uint32_t density = 0, uint32_t type = 0)            | Obtains the file descriptor or an image based on the resource ID.| ResourceManager_ErrorCode OH_ResourceManager_GetDrawableDescriptorData(const NativeResourceManager \*mgr,     uint32_t resId, ArkUI_DrawableDescriptor \*\*drawableDescriptor, uint32_t density, uint32_t type)            |
202e41f4b71Sopenharmony_ci| ResourceManager_ErrorCode OH_ResourceManager_GetDrawableDescriptorByName(const NativeResourceManager \*mgr,     const char \*resName, ArkUI_DrawableDescriptor \*\*drawableDescriptor, uint32_t density = 0, uint32_t type = 0) | Obtains the file descriptor or an image based on the resource name.| ResourceManager_ErrorCode OH_ResourceManager_GetDrawableDescriptorDataByName(const NativeResourceManager \*mgr,     const char \*resName, ArkUI_DrawableDescriptor \*\*drawableDescriptor, uint32_t density, uint32_t type) |
203e41f4b71Sopenharmony_ci| ResourceManager_ErrorCode OH_ResourceManager_GetLocales(const NativeResourceManager \*mgr, char \*\*\*resultValue,     uint32_t \*resultLen, bool includeSystem = false)                                                         | Obtains the current language and locale.| ResourceManager_ErrorCode OH_ResourceManager_GetLocalesData(const NativeResourceManager \*mgr, char \*\*\*resultValue,     uint32_t \*resultLen, bool includeSystem)                                                         |
204e41f4b71Sopenharmony_ci
205e41f4b71Sopenharmony_ci
206e41f4b71Sopenharmony_ci**Adaptation Guide**
207e41f4b71Sopenharmony_ci
208e41f4b71Sopenharmony_ciSubstitute APIs that use optional parameters with new APIs.
209e41f4b71Sopenharmony_ci
210e41f4b71Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetMediaBase64Data(const NativeResourceManager \*mgr, uint32_t resId,
211e41f4b71Sopenharmony_ci    char \*\*resultValue, uint64_t \*resultLen, uint32_t density);
212e41f4b71Sopenharmony_ci
213e41f4b71Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetMediaBase64DataByName(const NativeResourceManager \*mgr,
214e41f4b71Sopenharmony_ci    const char \*resName, char \*\*resultValue, uint64_t \*resultLen, uint32_t density);
215e41f4b71Sopenharmony_ci
216e41f4b71Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetMediaData(const NativeResourceManager \*mgr, uint32_t resId,
217e41f4b71Sopenharmony_ci    uint8_t \*\*resultValue, uint64_t \*resultLen, uint32_t density);
218e41f4b71Sopenharmony_ci
219e41f4b71Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetMediaDataByName(const NativeResourceManager \*mgr, const char \*resName,
220e41f4b71Sopenharmony_ci    uint8_t \*\*resultValue, uint64_t \*resultLen, uint32_t density);
221e41f4b71Sopenharmony_ci
222e41f4b71Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetDrawableDescriptorData(const NativeResourceManager \*mgr,
223e41f4b71Sopenharmony_ci    uint32_t resId, ArkUI_DrawableDescriptor \*\*drawableDescriptor, uint32_t density, uint32_t type);
224e41f4b71Sopenharmony_ci
225e41f4b71Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetDrawableDescriptorDataByName(const NativeResourceManager \*mgr,
226e41f4b71Sopenharmony_ci    const char \*resName, ArkUI_DrawableDescriptor \*\*drawableDescriptor, uint32_t density, uint32_t type);
227e41f4b71Sopenharmony_ci
228e41f4b71Sopenharmony_ciResourceManager_ErrorCode OH_ResourceManager_GetLocalesData(const NativeResourceManager \*mgr, char \*\*\*resultValue,
229e41f4b71Sopenharmony_ci    uint32_t \*resultLen, bool includeSystem);
230