如何在 iOS 中更改 cordova-camera-plugin 语言? [英] How to change cordova-camera-plugin language in iOS?

查看:16
本文介绍了如何在 iOS 中更改 cordova-camera-plugin 语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改 cordova-camera-plugin 语言.显然它依赖于各种各样的东西.我的开发环境是 Visual Studio 2015 中的 Cordova 工具.这不太重要,但我在我的应用程序中使用 Ionic 框架.我们在运行 Xcode 7 的 MacBook Pro 笔记本电脑上构建 iOS 应用程序.我正在测试的设备是运行 iOS 9.1 的 Ipad,第一语言为荷兰语,第二语言为英语.

I wish to change the cordova-camera-plugin language. Apparently it is dependent on a variety of things. My development environment is Tools for Cordova in Visual Studio 2015. It is unlikely that it matters but I am using the Ionic framework in my app. We build our app for iOS on a MacBook Pro laptop running Xcode 7. The device I am testing on is an Ipad running iOS 9.1 with Dutch as first language and english as second.

在我的应用中,当您打开相机时,您有几个选项,例如 CancelUse PhotoRetake Photo.

In my app when you open the camera you have a few options such as Cancel, Use Photo and Retake Photo.

我为尝试将插件本地化为荷兰语所做的工作如下.

The things I have done to try and make the plugin localized to the Dutch language are the following.

config.xml 中我已将以下行更改为

In config.xml I have changed the following line to

<widget xmlns:cdv="http://cordova.apache.org/ns/1.0" 
xmlns:vs="http://schemas.microsoft.com/appx/2014/htmlapps" 
id="hop.test1" 
version="1.0.1" 
xmlns="http://www.w3.org/ns/widgets" 
defaultlocale="nl-NL">

在我的 /platforms/ios/projectname/projectname-Info.plist 我添加了以下几行:

<plist version="1.0">
  <dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>nl</string>
    <key>CFBundleLocalizations</key>
    <array>
      <string>nl</string>
    </array>
  <!-- other values omitted !-->
  </dict>
</plist>

根据我在 google 和 stackoverflow 上的搜索结果,

nl 似乎是正确的荷兰语本地化符号.

nl appears to be the correct localization notation for dutch based on my search results around google and stackoverflow.

问题是当我构建我的应用程序并测试相机时,相机按钮仍然是用英文写的.我是否实现了错误,我是否在某处遗漏了一些值,或者这是在cordova中本地化插件的错误方法?

The problem is that when I build my app and test the camera, the camera buttons are still written in english. Have I implemented something wrong, am I missing some values somewhere or is this the wrong way to go about localizing a plugin in cordova?

推荐答案

记录在案,现在(2020年):

For the records, it is working now (year 2020) :

设置config.xml的<widget defaultlocale="fr">成功更新xcode项目的CFBundleDevelopmentRegion.

Setting the <widget defaultlocale="fr"> of the config.xml successfully update the CFBundleDevelopmentRegion of the xcode project.

因此相机中正确使用了预期的语言环境(fr).

And therefore the expected locale (fr) is correctly used in the camera.

这篇关于如何在 iOS 中更改 cordova-camera-plugin 语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆