国际键盘定制?

发布于 2024-09-04 21:15:26 字数 178 浏览 6 评论 0原文

在iphone sdk 3.0中,他们提供了国际键盘的选项。用户可以选择他想要的键盘。但我们如何本地化我们的应用程序。 例如,如果用户选择了法语键盘,我们应该用法语与他交互。像警报和其他东西应该以法语显示。

我们如何以编程方式做到这一点?他们有任何选项可以让我们将字符串从英语转换为用户选择的语言吗?

请帮助我

in iphone sdk 3.0 they have given option of international keyboards.user can choose the keyboard that he want. but how can we localize our application.
for e.g if user have chosen a French language keyboard we should interact with him in french. like alerts and other things should get display in french language.

how can we do this programatically?Is their any option by which we can convert string from english to user's chosen language?

kindly help me

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

辞取 2024-09-11 21:15:26

查看国际化编程主题在 iPhone 开发中心。

Have a look at the Internationalization Programming Topics on the iPhone Dev Center.

醉生梦死 2024-09-11 21:15:26

在 iOS 4.2 及更高版本中,您可以使用 UITextInputMode 类来确定当前用于文本输入的主要语​​言。

[UITextInputMode currentInputMode].primaryLanguage 将为您提供一个表示 BCP 47 语言代码的 NSString,例如“es”、“en-US”或“fr-CA”。

您可以注册UITextInputCurrentInputModeDidChangeNotification,以便在当前输入模式更改时收到警报。

正如 Thomas Müller 所说,国际化编程主题是一个好的起点。

您可能还对“让您的应用程序为中国和其他热门新产品做好准备”感兴趣市场” WWDC 会议。

In iOS 4.2 and later, you can use the UITextInputMode class to determine the primary language currently being used for text input.

[UITextInputMode currentInputMode].primaryLanguage will give you an NSString representing the BCP 47 language code such as “es”, “en-US”, or “fr-CA”.

You can register for the UITextInputCurrentInputModeDidChangeNotification to be alerted when the current input mode changes.

As Thomas Müller said, Internationalization Programming Topics is a good place to start.

You might also be interested in the "Getting Your Apps Ready for China and other Hot New Markets" WWDC session.

可可 2024-09-11 21:15:26

没有记录的方法可以知道键盘何时更改,也没有记录的方法来获取当前的键盘模式。


通过未记录 API,您可以监听 UIKeyboardCurrentInputModeDidChangeNotification 本地通知。

当前的输入模式可以从 com.apple.Preferences 首选项中找到,使用

return CFPreferencesCopyAppValue(CFSTR("KeyboardLastUsed"),
        CFSTR("/var/mobile/Library/Preferences/com.apple.Preferences"));

(注意:要在模拟器上测试,您需要将 /var/mobile/ 替换为 /Users/<用户名>/Library/Application Support/iPhone Simulator//。)

There is no documented way to know when keyboard changes, nor a documented way to get the current keyboard mode.


With undocumented APIs, you can listen to the UIKeyboardCurrentInputModeDidChangeNotification local notification.

The current input mode can be found from the com.apple.Preferences preferences, using

return CFPreferencesCopyAppValue(CFSTR("KeyboardLastUsed"),
        CFSTR("/var/mobile/Library/Preferences/com.apple.Preferences"));

(Note: to test on simulator you need to replace /var/mobile/ by /Users/<user-name>/Library/Application Support/iPhone Simulator/<sdk-version>/.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文