Closed ir2pid closed 3 months ago
Something like this will help you set localization for NSCameraUsageDescription
:
In config.xml you will have the following defined.
<!-- setup your NSCameraUsageDescription message for the default language. (English) -->
<edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
<string>need camera access to take pictures</string>
</edit-config>
<!-- enable the supporting languages CFBundleLocalizations (e.g. English & Japanese) -->
<config-file parent="CFBundleLocalizations" target="*-Info.plist" mode="overwrite">
<array>
<string>en</string>
<string>ja</string>
</array>
</config-file>
<!-- copy the Japanese localization file InfoPlist.strings file -->
<resource-file src="resource/ios/InfoPlist.strings" target="ja.lproj/InfoPlist.strings" />
Create the InfoPlist.strings
file and place it in a resource directory. This file will be the development file. When you run cordova prepare
it will be copied into your iOS project. The copying is handled by the resource-file
tag in config.xml
.
Content of InfoPlist.strings
"NSCameraUsageDescription" = "写真撮影のためのアクセス";
One important note is that if a third-party plugins also creates the InfoPlist.strings
file for the same locale, this change might overwrite its content. In this case you might need to manually manage the InfoPlist.strings
or use a hook script to search for the file and update.
I can add the permission request explanation by adding the information in config.xml
But how can I localise the
Take pictures of ID
for other languages.