![6***@qq.com](https://img-cdn-tc.dcloud.net.cn/account/identicon/09cef63e9f6f2cdc9530dd3f570fbb6e.png)
- 发布:2024-03-04 11:01
- 更新:2024-03-04 11:01
- 阅读:201
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: Windows 10
HBuilderX类型: 正式
HBuilderX版本号: 3.8.12
手机系统: 全部
页面类型: vue
vue版本: vue3
打包方式: 离线
项目创建方式: HBuilderX
测试过的手机:
示例代码:
{
"name": "XXXXXX",
"appid": "__UNI__XXXXXX",
"description": "",
"versionName": "1.0.0",
"versionCode": 100,
"transformPx": false,
"fallbackLocale": "en",
"app-plus": {
"locales": {
"en": {
"name": "XXXXXX",
"android": {
"strings": {
"dcloud_gallery_library_name": "test_string",
"dcloud_gallery_all_dir_name": "test_string",
"dcloud_gallery_all_video": "test_string",
"dcloud_gallery_all_image": "test_string",
"dcloud_gallery_select_title": "test_string",
"dcloud_gallery_select_video_title": "test_string",
"dcloud_gallery_select_image_title": "test_string",
"dcloud_gallery_video_dir_name": "test_string",
"dcloud_gallery_msg_amount_limit": "test_string",
"dcloud_gallery_msg_size_limit": "test_string",
"dcloud_gallery_select_null": "test_string",
"dcloud_gallery_done": "test_string",
"dcloud_gallery_count_string": "test_string",
"dcloud_gallery_preview": "test_string",
"dcloud_gallery_select": "test_string",
"dcloud_gallery_video": "test_string",
"dcloud_gallery_cant_play_video": "test_string",
"dcloud_gallery_read_external_storage": "test_string"
}
},
"ios": {
"privacyDescription": {
"NSPhotoLibraryUsageDescription": "test",
},
"infoPlist": {
"dcloud_gallery_library_name": "test_string",
"dcloud_gallery_all_dir_name": "test_string",
"dcloud_gallery_all_video": "test_string",
"dcloud_gallery_all_image": "test_string",
"dcloud_gallery_select_title": "test_string",
"dcloud_gallery_select_video_title": "test_string",
"dcloud_gallery_select_image_title": "test_string",
"dcloud_gallery_video_dir_name": "test_string",
"dcloud_gallery_msg_amount_limit": "test_string",
"dcloud_gallery_msg_size_limit": "test_string",
"dcloud_gallery_select_null": "test_string",
"dcloud_gallery_done": "test_string",
"dcloud_gallery_count_string": "test_string",
"dcloud_gallery_preview": "test_string",
"dcloud_gallery_select": "test_string",
"dcloud_gallery_video": "test_string",
"dcloud_gallery_cant_play_video": "test_string",
"dcloud_gallery_read_external_storage": "test_string"
}
}
},
"zh": {
"name": "XXXXXX",
"android": {
"strings": {
"dcloud_gallery_library_name": "test_string",
"dcloud_gallery_all_dir_name": "test_string",
"dcloud_gallery_all_video": "test_string",
"dcloud_gallery_all_image": "test_string",
"dcloud_gallery_select_title": "test_string",
"dcloud_gallery_select_video_title": "test_string",
"dcloud_gallery_select_image_title": "test_string",
"dcloud_gallery_video_dir_name": "test_string",
"dcloud_gallery_msg_amount_limit": "test_string",
"dcloud_gallery_msg_size_limit": "test_string",
"dcloud_gallery_select_null": "test_string",
"dcloud_gallery_done": "test_string",
"dcloud_gallery_count_string": "test_string",
"dcloud_gallery_preview": "test_string",
"dcloud_gallery_select": "test_string",
"dcloud_gallery_video": "test_string",
"dcloud_gallery_cant_play_video": "test_string",
"dcloud_gallery_read_external_storage": "test_string"
}
},
"ios": {
"privacyDescription": {
"NSPhotoLibraryUsageDescription": "test",
},
"infoPlist": {
"dcloud_gallery_library_name": "test_string",
"dcloud_gallery_all_dir_name": "test_string",
"dcloud_gallery_all_video": "test_string",
"dcloud_gallery_all_image": "test_string",
"dcloud_gallery_select_title": "test_string",
"dcloud_gallery_select_video_title": "test_string",
"dcloud_gallery_select_image_title": "test_string",
"dcloud_gallery_video_dir_name": "test_string",
"dcloud_gallery_msg_amount_limit": "test_string",
"dcloud_gallery_msg_size_limit": "test_string",
"dcloud_gallery_select_null": "test_string",
"dcloud_gallery_done": "test_string",
"dcloud_gallery_count_string": "test_string",
"dcloud_gallery_preview": "test_string",
"dcloud_gallery_select": "test_string",
"dcloud_gallery_video": "test_string",
"dcloud_gallery_cant_play_video": "test_string",
"dcloud_gallery_read_external_storage": "test_string"
}
}
}
},
"compilerVersion": 3,
"compatible": {
"ignoreVersion": true
},
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
"modules": {},
"distribute": {
"android": {
"permissions": [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
"ios": {},
"sdkConfigs": {},
"screenOrientation": [
"portrait-primary"
]
}
},
"uniStatistics": {
"enable": false
},
"vueVersion": "3"
}
{
"name": "XXXXXX",
"appid": "__UNI__XXXXXX",
"description": "",
"versionName": "1.0.0",
"versionCode": 100,
"transformPx": false,
"fallbackLocale": "en",
"app-plus": {
"locales": {
"en": {
"name": "XXXXXX",
"android": {
"strings": {
"dcloud_gallery_library_name": "test_string",
"dcloud_gallery_all_dir_name": "test_string",
"dcloud_gallery_all_video": "test_string",
"dcloud_gallery_all_image": "test_string",
"dcloud_gallery_select_title": "test_string",
"dcloud_gallery_select_video_title": "test_string",
"dcloud_gallery_select_image_title": "test_string",
"dcloud_gallery_video_dir_name": "test_string",
"dcloud_gallery_msg_amount_limit": "test_string",
"dcloud_gallery_msg_size_limit": "test_string",
"dcloud_gallery_select_null": "test_string",
"dcloud_gallery_done": "test_string",
"dcloud_gallery_count_string": "test_string",
"dcloud_gallery_preview": "test_string",
"dcloud_gallery_select": "test_string",
"dcloud_gallery_video": "test_string",
"dcloud_gallery_cant_play_video": "test_string",
"dcloud_gallery_read_external_storage": "test_string"
}
},
"ios": {
"privacyDescription": {
"NSPhotoLibraryUsageDescription": "test",
},
"infoPlist": {
"dcloud_gallery_library_name": "test_string",
"dcloud_gallery_all_dir_name": "test_string",
"dcloud_gallery_all_video": "test_string",
"dcloud_gallery_all_image": "test_string",
"dcloud_gallery_select_title": "test_string",
"dcloud_gallery_select_video_title": "test_string",
"dcloud_gallery_select_image_title": "test_string",
"dcloud_gallery_video_dir_name": "test_string",
"dcloud_gallery_msg_amount_limit": "test_string",
"dcloud_gallery_msg_size_limit": "test_string",
"dcloud_gallery_select_null": "test_string",
"dcloud_gallery_done": "test_string",
"dcloud_gallery_count_string": "test_string",
"dcloud_gallery_preview": "test_string",
"dcloud_gallery_select": "test_string",
"dcloud_gallery_video": "test_string",
"dcloud_gallery_cant_play_video": "test_string",
"dcloud_gallery_read_external_storage": "test_string"
}
}
},
"zh": {
"name": "XXXXXX",
"android": {
"strings": {
"dcloud_gallery_library_name": "test_string",
"dcloud_gallery_all_dir_name": "test_string",
"dcloud_gallery_all_video": "test_string",
"dcloud_gallery_all_image": "test_string",
"dcloud_gallery_select_title": "test_string",
"dcloud_gallery_select_video_title": "test_string",
"dcloud_gallery_select_image_title": "test_string",
"dcloud_gallery_video_dir_name": "test_string",
"dcloud_gallery_msg_amount_limit": "test_string",
"dcloud_gallery_msg_size_limit": "test_string",
"dcloud_gallery_select_null": "test_string",
"dcloud_gallery_done": "test_string",
"dcloud_gallery_count_string": "test_string",
"dcloud_gallery_preview": "test_string",
"dcloud_gallery_select": "test_string",
"dcloud_gallery_video": "test_string",
"dcloud_gallery_cant_play_video": "test_string",
"dcloud_gallery_read_external_storage": "test_string"
}
},
"ios": {
"privacyDescription": {
"NSPhotoLibraryUsageDescription": "test",
},
"infoPlist": {
"dcloud_gallery_library_name": "test_string",
"dcloud_gallery_all_dir_name": "test_string",
"dcloud_gallery_all_video": "test_string",
"dcloud_gallery_all_image": "test_string",
"dcloud_gallery_select_title": "test_string",
"dcloud_gallery_select_video_title": "test_string",
"dcloud_gallery_select_image_title": "test_string",
"dcloud_gallery_video_dir_name": "test_string",
"dcloud_gallery_msg_amount_limit": "test_string",
"dcloud_gallery_msg_size_limit": "test_string",
"dcloud_gallery_select_null": "test_string",
"dcloud_gallery_done": "test_string",
"dcloud_gallery_count_string": "test_string",
"dcloud_gallery_preview": "test_string",
"dcloud_gallery_select": "test_string",
"dcloud_gallery_video": "test_string",
"dcloud_gallery_cant_play_video": "test_string",
"dcloud_gallery_read_external_storage": "test_string"
}
}
}
},
"compilerVersion": 3,
"compatible": {
"ignoreVersion": true
},
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
"modules": {},
"distribute": {
"android": {
"permissions": [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
"ios": {},
"sdkConfigs": {},
"screenOrientation": [
"portrait-primary"
]
}
},
"uniStatistics": {
"enable": false
},
"vueVersion": "3"
}
操作步骤:
在HbuilderX中或cli中新建项目,使用本文中代码作为manifest.json,index.vue中使用下面的代码,打包为WGT:
<template>
<button @click="handleClick">Test</button>
</template>
<script setup lang="ts">
const handleClick = () => {
// plus.gallery.pick(() => {}, () => {}, {
// filter: "image",
// multiple: true,
// maximum: 6,
// system: false,
// });
uni.chooseImage({
count: 6,
sizeType: ['original', 'compressed'],
sourceType: ['album'],
success: function (res) {
console.log(JSON.stringify(res.tempFilePaths));
}
});
}
</script>
在HbuilderX中或cli中新建项目,使用本文中代码作为manifest.json,index.vue中使用下面的代码,打包为WGT:
<template>
<button @click="handleClick">Test</button>
</template>
<script setup lang="ts">
const handleClick = () => {
// plus.gallery.pick(() => {}, () => {}, {
// filter: "image",
// multiple: true,
// maximum: 6,
// system: false,
// });
uni.chooseImage({
count: 6,
sizeType: ['original', 'compressed'],
sourceType: ['album'],
success: function (res) {
console.log(JSON.stringify(res.tempFilePaths));
}
});
}
</script>
预期结果:
相册选择界面的文字因国际化配置而改变
相册选择界面的文字因国际化配置而改变
实际结果:
弹出的相册界面文字没有被改变
弹出的相册界面文字没有被改变
bug描述:
https://ask.dcloud.net.cn/article/35860
按此文档的描述,打包成apk包和ipa包的可以对相册进行国际化。但我们在打包成wgt包时发现并不管用。
现在WGT本地打包是否支持相册国际化?最近会支持吗?
![](http://img-cdn-tc.dcloud.net.cn/uploads/questions/20240304/f632f691bec2ea2bb187211bc90f76de.png)