本地化电子表格单元格名称
我正在开发一个具有类似电子表格界面的应用程序。有一个细胞网格。行已编号,列使用字母。因此,像 A2 和 Q17 这样的“名称”指的是网格中的单元格。
我知道我可以将 GetLocaleInfo(Ex) 与 LOCALE_SNATIVEDIGITS 结合使用来获取用户区域设置的适当数字,以便我可以格式化行号。但我没有看到适合区域设置的“字母表”的类似内容。
我可以想象对于具有大纲模式并且需要能够用字母枚举一些列表项的文字处理器之类的东西也会出现同样的问题。
我一直在研究 Windows NLS API,但没有看到像 LOCALE_SNATIVEALPHABET 这样的东西,也没有看到像 EnumLocaleAlphabet 这样的 API。我是否缺少这样的 API 或者我是否一直在开发自己的 API?
I'm working on an application that has a spreadsheet-like interface. There is a grid of cells. Rows are numbered, and letters are used for the columns. So "names" like A2 and Q17 refer to cells in the grid.
I know I can use GetLocaleInfo(Ex) with LOCALE_SNATIVEDIGITS to get the appropriate digits for the user's locale, so I can format the row numbers. But I don't see something comparable for the locale-appropriate "alphabet".
I could imagine the same question arising for things like word processors that have an outline mode and need to be able to enumerate some list items with letters.
I've been pouring through the Windows NLS APIs, and I don't see anything like LOCALE_SNATIVEALPHABET nor do I see an API like EnumLocaleAlphabet. Am I missing such an API or am I stuck rolling my own?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我个人还没有听说过这样的API。最接近您所要求的是 ICU uchar 的 UBlockCode 但它仍然不会给你具体的字母表。
顺便说一句,我不认为它实际上是本地化单元格名称,除非您本地化整个用户界面。但在这种情况下,您可以简单地要求翻译人员提供有效的单元格符号。
这可能是你应该做的,因为一些书写系统根本没有字母概念 >。也就是说,它被称为脚本,而不是字母。例如,我认为使用阿拉伯语作为单元格符号(在这种情况下是哪种字形变体?)不是个好主意,我也不会使用中文(所有可能的表意文字?)。
我的建议是:把它留给翻译人员,如果他们想本地化,那没关系,如果他们不想,就相信他们,他们真的应该了解自己的手艺。
Personally I haven't heard of such API. The closest to what you are asking would be ICU uchar's UBlockCode but it still won't give you concrete alphabet.
By the way, I don't think it is actually localize cell names unless you localize the whole User Interface. But in such case you may simply ask translators to provide valid cell symbols.
And this probably what you should do, because some writing systems do not have concept of alphabet at all. That is, it is called script, not alphabet. For example, I don't think it would be good idea to use Arabic for cell symbol (which glyph variant in such case?) nor I would use Chinese (all possible ideograms?).
My suggestion is: leave it to translators, if they want to localize it, that is OK, if they don't, just trust them, they really should know their craft.