plural

iOS. Pluralization. Stringdict with format that contains 2 int arguments

这一生的挚爱 提交于 2020-08-20 03:56:29
问题 My question is similar to How to add regular string placeholders to a translated plurals .stringdict in swift ios but I am trying to understand if it is possible to pass 2 int parameters to strings dict. Say if I want to translate something like: 1 apple : 3 pears 2 apples : 1 pear Is it possible to do it in one localized format string like: let apples = 1 let pears = 3 let applesAndPears = String.localizedStringWithFormat(<format>, apples, pears) print(applesAndPears) or do I have to combine

Symfony2 plural translation with specific rules (when number ends in specific digit)

﹥>﹥吖頭↗ 提交于 2020-01-05 07:02:02
问题 I'm trying to translate results count to Lithuanian and there are some specific rules. I'll try to explain them: All counts ending with zero (0, 10, 20 ... 1050, 1060...) and between 12 & 19 inclusive (12...19) All counts ending with one, except ending with 11 (1, 21, 31 ... 1221, 1231... but not 11, 111, 211 ... 2311, 2411) All other not listed above (2...9 inclusive and more than 21 to which above rules does not apply) I tried something like this (using YAML), but even number 40 doesn't

Symfony2 plural translation with specific rules (when number ends in specific digit)

∥☆過路亽.° 提交于 2020-01-05 07:01:28
问题 I'm trying to translate results count to Lithuanian and there are some specific rules. I'll try to explain them: All counts ending with zero (0, 10, 20 ... 1050, 1060...) and between 12 & 19 inclusive (12...19) All counts ending with one, except ending with 11 (1, 21, 31 ... 1221, 1231... but not 11, 111, 211 ... 2311, 2411) All other not listed above (2...9 inclusive and more than 21 to which above rules does not apply) I tried something like this (using YAML), but even number 40 doesn't

Quantity “two” not working in Android Strings-Resources Plural

天涯浪子 提交于 2020-01-01 04:30:10
问题 Android allows translators to define Plurals. The following example works for me with locale 'en': <plurals name="numberOfSongsAvailable"> <item quantity="one">One song found.</item> <item quantity="other">%d songs found.</item> </plurals> But adding a special value for two does not work, still the other version is taken. Is the usage of two dependent upon the locale? So does Android only take the two version if the locale explicitly specifies that there should be a two version? The SO

Rails: Handling a scaffolding, such as “Sheep,” that has the same plural and singular form

我们两清 提交于 2019-12-21 12:33:50
问题 I'm wanting to create a model called CommunicationMeans (or, alternatively, MeansOfCommunication). However, this is both the singular and plural form of this term. I ran this: $ rails g scaffold CommunicationMeans It generated a model named CommunicationMean and a controller named CommunicationMeansController. I need the model to also be named CommunicationMeans. I vaguely remember an example in some documentation using a Sheep model, but what is the "correct" way to handle this situation?

How to use Android quantity strings (plurals)?

狂风中的少年 提交于 2019-12-21 03:15:07
问题 I am trying to use getQuantityString method in Resources to retrieve Quantity Strings (Plurals) based on android developer guidelines Quantity String (Plurals) The error I am getting is Error:(604) Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute? Error:(604) Found tag </item> where </plurals> is expected when I set up plurals as below <plurals name="productCount"> <item quantity="one" formatted="true">%1$d of %2$d product</item>

function switching between singular and plural?

女生的网名这么多〃 提交于 2019-12-20 09:55:38
问题 I'm looking for a function that given a string it switches the string to singular/plural. I need it to work for european languages other than English. Are there any functions that can do the trick? (Given a string to convert and the language?) Thanks 回答1: There is no function built into PHP for this type of operation. There are, however, some tools that you may be able to use to help accomplish your goal. There is an unofficial Google Dictionary API which contains information on plurals. You

.NET EF 6 Pluralization with prefix in table names

僤鯓⒐⒋嵵緔 提交于 2019-12-20 05:00:11
问题 Plural table names are default convention in EF. but when I have added the prefix I can not make names anymore plural unfortunately. Any ideas? protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Types() .Configure(entity => entity.ToTable("MyPrefix_" + entity.ClrType.Name)); modelBuilder.Conventions.Add<PluralizingTableNameConvention>(); base.OnModelCreating(modelBuilder); } 回答1: The PluralizingTableNameConvention uses a PluralizationService that can be used

How to add regular string placeholders to a translated plurals .stringdict in swift ios

▼魔方 西西 提交于 2019-12-18 09:03:33
问题 I want to translate this string using a plurar stringdict in swift for iOS stays at %1$@ stay at %1$@ Using a simple plural without placeholders works, thanks to this question But when I add a string placeholder I get a crash when accessing it. The regular plurals are working using the following xml: <dict> <key>NSStringLocalizedFormatKey</key> <string>%#@format@</string> <key>format</key> <dict> <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string> <key

i18n Pluralization

六眼飞鱼酱① 提交于 2019-12-17 22:59:37
问题 I want to be able to translate pluralized strings in i18n in rails. A string can be : You have 2 kids or You have 1 kid I know that I can use pluralize helper method, but I want to embed this in i18n translations so that I don't have to mess up with my views at any point in the future. I read that :count is somehow used in translations for plural, but I can't find any real resources on how it gets implemented. Notice that I know that I can pass a variable in a translation string. I also tried