Pluralising和本地化在C#中的字符串 [英] Pluralising and Localizing strings in C#

查看:171
本文介绍了Pluralising和本地化在C#中的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个C#WPF应用程序,我试图与RESX文件全球化。它的工作原理出色。但是我碰到顺利。我有个名字的复数相对简单的解决方案,在那里我有我显示字符串的单数和复数形式,我挑基础上,力所能及的事情我谈论的头号。

I've got a C# WPF application I'm attempting to globalize with resx files. It works splendidly. I've run into a hitch, however. I've got a relatively simple solution for pluralisation where I have a singular and plural form of the string I'm displaying and I pick one based on the number of whatever things I'm talking about.

不过,我最近来的事实,一些文化有多个复数形式条款。已遍布很好的解决人来在C#这个问题,更不用说WPF?

However, I've recently come to terms with the fact that some cultures have multiple plural forms. Has anyone come across a good solution to this problem in C#, let alone WPF?

这是我见过的这个问题来自波兰语言典型的例子。波兰有一个独特的,paucal和复数形式。这个例子是单词文件翻译:

The canonical example that I've seen for this problem comes from the Polish language. Polish has a singular, paucal, and plural form. This example is for the translation of the word "file":


  • 1 plik

  • 2, 3,4 pliki

  • 5-21 pliko'w

  • 22-24 pliki

  • 25-31 pliko'w

  • 1 plik
  • 2,3,4 pliki
  • 5-21 pliko'w
  • 22-24 pliki
  • 25-31 pliko'w

推荐答案

Mozilla已经在Firefox 3中实现这一点,他们有描述引导如何在这里使用实施
最值得注意的是,在
与PluralForm 部分发展中,他们有链接

Mozilla has implemented this in Firefox 3, and they have a guide describing how to use their implementation here. Most notably, in the Developing with PluralForm section, they have a link

资源://gre/modules/PluralForm.jsm

resource://gre/modules/PluralForm.jsm

要实施的来源。必须在Firefox 3和更高打开。

to the source of their implementation. Must be opened from within Firefox 3 and higher.

我没有通过整个事情看,但这似乎是个不错的地方,至少可以得到一些想法。

I have not read through the whole thing, but this seems to be like a good place to at least get some ideas.

心连心。

这篇关于Pluralising和本地化在C#中的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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