如何修复UITableView易访问性说错误的语言而滚动吗? - How to fix UITableView Accessibility speak in wrong languge while scrolling?

- 此内容更新于:2015-12-13
主题:

我创建一个应用程序在波兰(波兰被设置在iPhone设置)。画外音文本都说波兰(按钮、数字等)。但是当我滚动UITableView用三根手指用英语说:“16行1到10”在波兰(1、10和16)。如何修复它吗?编辑:它说“行%d%d%d”用英语与波兰口音。有趣的是,在系统的应用,比如康泰克,而滚动,它说“行%d%d%d”在整个波兰。

原文:

I'm creating an app in Polish (Polish is set in iPhone settings). All VoiceOver text are said in Polish (like button, numbers etc.).

But when I scroll UITableView with three fingers it say in English: "Rows 1 to 10 of 16" (1, 10 and 16 in Polish).

How to fix it?


EDIT:

It speaks "Rows %d to %d of %d" in English with Polish accent.

What is interesting is that, in system's apps like Contacs, while scrolling, it says "Rows %d to %d of %d" in whole Polish.

网友:有趣的案例,UITableView使用一个定制的可访问性实现,并可能使用api的一个通知告诉画外音读出字符串响应滚动:这听起来好像是使用模板字符串(“行%d%d%d”)这本身没有被本地化。语音合成器它最好把字符串当作波兰,所以读取文本数字正确,“10”会变成相应的波兰词——但可能最终只是发音按原样——换句话说,也许有点波兰口音吗?不知道有什么方法来验证这个……

(原文:Interesting case; UITableView uses a custom accessibility implementation, and likely uses one of the notification APIs to tell VoiceOver to read out that string in response to scrolling: it sounds as though it's using a template string ("Rows %d to %d of %d") that hasn't itself been localized. The speech synth does its best to treat that string as Polish, so reads out the textual numbers correctly - "10" will get turned into the appropriate Polish word - but likely ends up just pronouncing the other words as-is, perhaps with a bit of a Polish accent? Wonder if there's any way to verify this...)

网友:你知道如果这发生在其他语言吗?例如,西班牙语吗?

(原文:Do you know if this happens in other languages? For example, Spanish?)

网友:做同样的问题重现在一个新项目,只有普通的表视图没有任何定制(除了一些行数据,所以您可以滚动)?

(原文:Does the same issue reproduce in a new project and only a plain table view without any customization (other than some rows of data, so that you can scroll)?)

楼主:@BrendanMcK是的,它说“行%d%d%d”用英语与波兰口音。

(原文:@BrendanMcK Yes, it speaks "Rows %d to %d of %d" in English with Polish accent.)

楼主:@DavidR鰊nqvist在新项目中,只有UITableView,它的行为一样。

(原文:@DavidRönnqvist In new project, with only UITableView, it behaves the same way.)

解决方案:
我找到了解决方案。在xcode项目设置,信息选项卡中,有一个定位部分。和波兰没有本地化,因为我们没有本地化应用程序(应用程序只在波兰)。我点击+添加波兰本地化,现在说“行%d%d%d”完全在波兰。
原文:

I found the solution.

In xcode, in project settings, Info tab, there is a Localization section. And there was no Polish localization, becouse we didn't localized app (app only in Polish). I click +, add Polish localization, and now it say "Rows %d to %d of %d" totally in Polish.