I am new to HTML5 development and I am building a simple cordova app. In IOS when you click a text and press long press you will see the following options.
Copy
Select All
Define
Share...
Is there a way to translate this words.
I changed the language of the phone but the above options are not translating.
Can anyone help me. Thank you.
You can add other languages to your project adding this on the info.plit (with a plugin or a hook)
<key>CFBundleLocalizations</key>
<array>
<string>es</string>
<string>fr</string>
<string>...</string>
</array>
or if you just support one language, you can just change English here for another language
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
There is an existing plugin to write on the info.plist
https://www.npmjs.com/package/cordova-custom-config
You can use it or use your own plugin that just a config-file tag to add that lines
http://cordova.apache.org/docs/en/latest/plugin_ref/spec.html#config-file
Related
I implemented two Custom Intents with Sirikit in my iOS app. When I was developing them I had iOS 13.3 installed in my iphone and one of my intents has a Siri Dialog prompt asking for the value of one parameter. All the app is translated to english and spanish and the custom intent worked nicely in both languages.
When I updated my iphone to iOS 13.4.1 my custom intent started to have the following issues (I saw both issues depending on the installation/test/device):
Siri asking for the parameter value as if I wouldn't put any custom dialog with the standard phrase "What value do you want for param?" (more or less)
Siri asking the Siri dialog prompt in english and not in spanish even when the rest of the phrases and Siri responses of the rest of the Intent and the app are correctly translated into spanish. The only translation that is not working is the Siri Dialog prompt.
I find this issue very strange and annoying. I tried to recreate the translation files for Intent.intentdefinition: Intent.strings (Base), Intent.strings (English), Intent.strings (Spanish) and I even tried to recreate the whole Custom Intent definition and I'm still having the issue.
I also tried to change the iOS language and Siri language on my phone, restart, reinstall the app, intents, etc...
This is the Info.plist of my Sirikit extension:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>InventorySearchIntent</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>IntentsRestrictedWhileLocked</key>
<array/>
<key>IntentsRestrictedWhileProtectedDataUnavailable</key>
<array/>
<key>IntentsSupported</key>
<array>
<string>NumTotalItemsIntent</string>
<string>SearchItemIntent</string>
</array>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.intents-service</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).IntentHandler</string>
</dict>
</dict>
</plist>
Any solution for this? Is it a bug from iOS 13.4? Siri integration is very important for the app that I'm developing and this is a blocker for me.
Thanks in advance!
In my own experience, this issue is fixed in iOS 13.5 beta 4. I just tested it in an iPhone 6s Plus with Xcode 11.5 beta 2 (11N605f).
However, there are other issues still. For example, in Shortcuts, all operation strings in my test project are shown in English, not the localized language.
Also, INStringResolutionResult.confirmationRequired(with:) doesn't work as expected.
I have a function gets the words user says and looks them up in database then uses INStringResolutionResult.confirmationRequired(with:) to check with the user. SiriKit currently only uses the words the user says, not the result that I check with the user, which leads the final code crashes.
UPDATES
I just got the reply from Apple's bug report team. Here are the conclusions I make for now.
When switching languages, Siri some times, if not all the times, has an issue of using the default sentences to replace the sentences that a developer provides.
Installing Siri profile and reboot may fixed above issue on Siri of current setting. But if you change the language of Siri, the issue is still there.
There were regressions on APIs of INStringResolutionResult. For single result, both open class func disambiguation(with stringsToDisambiguate: [String]) -> Self and open class func confirmationRequired(with stringToConfirm: String?) -> Self wouldn't work on iOS later than iOS 13.3. Siri used a placeholder called "name" instead of the actual value.
iOS 14 Update
I am still seeing the following behaviour (as reported by Owen Zhao) with iOS 14:
When switching languages, Siri some times, if not all the times, has an issue of using the default sentences to replace the sentences that a developer provides.
I observed that rebooting the iOS device after language change is (still) fixing the issue.
Localize your intent definition file to all languages that your app supports
Ensure that your Xcode project identifies localizations by the ISO 639-1 language identifier scheme (additional information on the schemes). Older Xcode projects may use a different language identification scheme and should be updated.
If your app has not yet been localized, ensure that the selected Siri language in Settings matches the CFBundleDevelopmentRegion of your Xcode project, and the value of this key is in ISO 639-1 format
Hope this works for you
The language system language of my application is displaying in english, for exemple when IOS ask me the autorization for geolocalisation, it's in english. Or the button "Done" on the right side of the keyboard is in english too. Problem is, it should be in French since this is my IOS language. It's only in IOS.
I know there is a way to translate them because I have an another Ionic application where this works, but I don't have the source code.
I guess it's somewhere in the xCode settings ?
The answers was in How to change cordova-camera-plugin language in iOS?
I needed to change the language here:
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>fr</string>
<key>CFBundleLocalizations</key>
<array>
<string>nl</string>
</array>
<!-- other values omitted !-->
</dict>
</plist>
But Im sure there is another way to do it, because this solution is not very good. It's only temporary, because if we delete the platform the change will be lost.
I have a problem when I try to set the language of the IPA.
My App is in French but only English is added in the generated IPA. I do not kwnow how to change this.
I use visual studio with Cordova tools.
I have tried to add a locales folder but it changes nothing...
Do you have an idea of what I need to do in order to add French to the IPA?
Thanks for your help.
You would need to specify that in your Info.plist file. You are able to supply a custom Info.plist with your build.
In your .plist file you will then be able to specify the localization as follows:
<key>CFBundleLocalizations</key>
<array>
<string>English</string>
<string>French</string>
</array>
To find out more adding custom configuration files, please have a look at MSDN's Platform-specific configuration files
Is there a way to localise the NSLocationWhenInUseUsageDescription in Info.plist in the Xamarin Studio?
Or any possibility to localise the complete Info.plist would be a solution as well.
I tried the following steps as it looks analogue to the
How to localise a string inside the iOS info.plist file? but it does not work for me.
So these are the steps:
In both en.proj and de.proj:
I added an empty file InfoPlist.strings
In Info.plist:
I have set the key of the "NSLocationWhenInUseUsageDescription" to "NSLocationWhenInUseUsageDescriptionMessage".
In InfoPlist.strings:
I added the "NSLocationWhenInUseUsageDescriptionMessage" as key in the strings files and the corresponding transitions in each, but it seems not to work -> the raw string "NSLocationWhenInUseUsageDescriptionMessage" is shown when the user is asked for the permission.
I had similar problem (only I used "Always" instead of "WhenInUse". Here's what worked:
In both en.lproj and de.lproj add the file InfoPlist.strings. Each of the files contains only one line:
"NSLocationAlwaysUsageDescription" = "Your location needed, because...";
In Info.plist, the string doesn't matter anymore, because it will be taken from the InfoPlist.string file. The relevant lines in Info.plist look like this:
<key>NSLocationAlwaysUsageDescription</key>
<string>No text needed here.</string>
Maybe you forgot the semicolon in the strings-files? Or your two folders were named *.proj instead of *.lproj?
We faced a similar issue for the localization of NSLocationWhenInUseUsageDescription. The translation was shown on the iOS simulator but never on real devices. After we fixed our CFBundleLocalizations array from upper case language codes to lower case in the Info.plist the permission description was translated correctly for all languages.
Not correct:
<key>CFBundleLocalizations</key>
<array>
<string>EN</string>
<string>DE</string>
<string>BG</string>
<string>PL</string>
<string>FR</string>
<string>CS</string>
</array>
Correct:
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>de</string>
<string>bg</string>
<string>pl</string>
<string>fr</string>
<string>cs</string>
</array>
I am submitting my app to the app store which uses location services (GPS dot) and MKPinAnnotations and doesn't use anything else for a map, and it looks from what I have researched that the Routing Coverage File is used for overlays?
I dont think I need a Routing Coverage File, but when I go to publish, xcode errors out saying it is missing in the Itunes Connect.
The category for the app is Utilities. It was also navigation but I unticked this hoping it would solve the issue and it didn't.
How can I get around this?
I had the exact same issue earlier today when trying to publish an application that uses the MapKit but does not offer routing capabilities. I resolved it by deselecting all supported routing modes under '{Target} --> Capabilities --> Maps'. If you are just looking at the Info.plist file then you can remove the the MKDirectionsApplicationSupportedModes key and the CFBundleTypeName key that equals MKDirectionsRequest.
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<!--Remove both of these key/value pairs -->
<key>CFBundleTypeName</key>
<string>MKDirectionsRequest</string>
<key>LSItemContentTypes</key>
<array>
<string>com.apple.maps.directionsrequest</string>
</array>
</dict>
</array>
and
<key>MKDirectionsApplicationSupportedModes</key>
<array>
<string>MKDirectionsModeBike</string>
<string>MKDirectionsModeBus</string>
<string>MKDirectionsModeCar</string>
<string>MKDirectionsModeFerry</string>
<string>MKDirectionsModeOther</string>
<string>MKDirectionsModePedestrian</string>
<string>MKDirectionsModePlane</string>
<string>MKDirectionsModeStreetCar</string>
<string>MKDirectionsModeSubway</string>
<string>MKDirectionsModeTaxi</string>
<string>MKDirectionsModeTrain</string>
</array>
turn off map capability solved my problem,
xcode - next to general tap, you should see capability tab,
scroll down to maps section, turn it off,
general tab, change you build and version different from last time,
re-upload to app store.
This time it would not ask for routing profile coverage file,
Done.
This took me a long time to figure out, but the problem was with my scheme. It was the routing app coverage file location. I just change it to "None". Go to your scheme -> Edit Scheme -> Run -> Options -> Routing App Coverage File, change it to None.
see here