dpa99c / phonegap-launch-navigator

Phonegap/Cordova plugin which launches native route navigation apps for Android, iOS and Windows
369 stars 129 forks source link

localize LOCATION_USAGE_DESCRIPTION in config.xml possible? #259

Closed capc0 closed 3 years ago

capc0 commented 3 years ago

Documentation issue

I see that the usage description is set within https://github.com/dpa99c/phonegap-launch-navigator/blob/master/plugin.xml#L119 and was wondering if there is any way to localize this description?

I know I can overwrite it in my config.xml via

<plugin name="uk.co.workingedge.phonegap.plugin.launchnavigator" spec="~5.0.4">
        <variable name="LOCATION_USAGE_DESCRIPTION" value="GPS needed for XYZ..." />
    </plugin>

but how do achieve this when mutliple languages are supported?

Everything else I can handle fine within the app code (https://github.com/dpa99c/phonegap-launch-navigator/issues/167)

faugusztin commented 3 years ago

The LOCATION_USAGE_DESCRIPTION sets the default value of NSLocationWhenInUseUsageDescription on iOS. To provide localizations, you should use a plugin which creates the localization string files, adds them to project files etc, like the cordova-plugin-localization-strings plugin (unsure if it still works, in my project i based my scripts on the ones in that plugin, but you should get the idea).

You can localize any iOS access right message from any other plugin that way.