pluralize

Is there a way to set custom pluralizations in EDM designer 2010?

僤鯓⒐⒋嵵緔 提交于 2019-12-01 11:09:57
I am using VS 2010 and I have an entity 'Person'. The pluralization-service turns its plural to 'People', I want it to be Persons. Is there a place where I can manage the pluralizations library? Not in Visual Studio , no. In the meantime though you can drop down to the API level and create your own implementation derived from the abstract PluralizationService class. Once you’ve done this you can tell the EntityModelSchemaGenerator to use your implementation, rather than the default, to produce a model using your particular pluralization rules. This is an API only solution, we don’t yet provide

Javascript pluralize a string

做~自己de王妃 提交于 2019-11-30 10:56:56
问题 In PHP, I use Kuwamoto's class to pluralize nouns in my strings. I didn't find something as good as this script in javascript except for some plugins. So, it would be great to have a javascript function based on Kuwamoto's class. http://kuwamoto.org/2007/12/17/improved-pluralizing-in-php-actionscript-and-ror/ 回答1: Simple version (ES6): const maybePluralize = (count, noun, suffix = 's') => `${count} ${noun}${count !== 1 ? suffix : ''}`; Usage: maybePluralize(0, 'turtle'); // 0 turtles

Javascript pluralize a string

本小妞迷上赌 提交于 2019-11-29 23:51:30
In PHP, I use Kuwamoto's class to pluralize nouns in my strings. I didn't find something as good as this script in javascript except for some plugins. So, it would be great to have a javascript function based on Kuwamoto's class. http://kuwamoto.org/2007/12/17/improved-pluralizing-in-php-actionscript-and-ror/ Simple version (ES6): const maybePluralize = (count, noun, suffix = 's') => `${count} ${noun}${count !== 1 ? suffix : ''}`; Usage: maybePluralize(0, 'turtle'); // 0 turtles maybePluralize(1, 'turtle'); // 1 turtle maybePluralize(2, 'turtle'); // 2 turtles maybePluralize(3, 'fox', 'es'); /

ASP.NET MVC Controller Naming Pluralization

自作多情 提交于 2019-11-29 21:11:05
RESTful conventions indicate using plural nouns over singular objects. What is the pluralization convention for naming ASP.NET MVC controllers, i.e. ProductController or ProductsController ? Cybermaxs Some MVC Frameworks use plurals, however the MVC project templates contains a controller called AccountController thus suggesting singlular naming. It doesn't matter. As with most things in the Asp.net MVC framework the choice is yours. There is no real conventions. It's my personal opinion but what matters is that you pick a scheme and be consistent! I'm going to have to disagree with the

Entity Framework Core RC2 table name pluralization

随声附和 提交于 2019-11-28 19:11:14
Is there a way to do what this code did in EF Core RC 2? protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Conventions.Remove<PluralizingTableNameConvention>(); } Morteza Manavi There is no convention for this as of EF RC2 build. This is from EF Core team: In past pre-release of EF Core, the table name for an entity was the same as the entity class name. In RC2 we now use the name of the DbSet property. If no DbSet property is defined for the given entity type, then the entity class name is used. Now if you want to revert back to the RC1 naming conventions for

ASP.NET MVC Controller Naming Pluralization

笑着哭i 提交于 2019-11-28 17:17:38
问题 RESTful conventions indicate using plural nouns over singular objects. What is the pluralization convention for naming ASP.NET MVC controllers, i.e. ProductController or ProductsController ? 回答1: Some MVC Frameworks use plurals, however the MVC project templates contains a controller called AccountController thus suggesting singlular naming. It doesn't matter. As with most things in the Asp.net MVC framework the choice is yours. There is no real conventions. It's my personal opinion but what

i18n Pluralization

橙三吉。 提交于 2019-11-28 15:00:00
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 something like : <%= t 'misc.kids', :kids_num => pluralize(1, 'kid') %> Which works fine, but has a

override default pluralize for model-name in rails3

99封情书 提交于 2019-11-27 19:21:22
my locale is :de and I like to get this: Sheet.model_name.human.pluralize # => Belegs to add me a trailing "e" instead of "s" Sheet.model_name.human.pluralize # => Belege just for the Sheet-class. Can I add it somehow in my config/locales/models/de.yml ? First of all, you need to stop using .pluralize . It uses the Inflector (which is mainly used for Rails internals, e.g. guessing table names for model Sheet -> sheets). Sheet.model_name.human # => "Beleg" "Beleg".pluralize # => "Belegs" What you should do is to use the :count option. Sheet.model_name.human(:count => 2) # => "Belege" This

How turn off pluralize table creation for Entity Framework 5?

荒凉一梦 提交于 2019-11-27 08:50:59
I am trying to use Entity Framework 5. The first problem was that EF creats tables automatically. I tried to fix it by including dbModelBuilder.Conventions.Remove<PluralizingTableNameConvention>() . The second problem was the error like this The model backing the 'CountryContext' context has changed since the database was created. Consider using Code First Migrations to update the database. I tried fix it by dbModelBuilder.Conventions.Remove<IncludeMetadataConvention>(); but no sense. The data access layer the next: Table(Name = "tblCountries")] public class Country { [Column(Name = "id",

Java API for plural forms of English words

给你一囗甜甜゛ 提交于 2019-11-27 08:02:21
Are there any Java API(s) which will provide plural form of English words (e.g. cacti for cactus )? Meng Lu Wolfram|Alpha return a list of inflection forms for a given word. See this as an example: http://www.wolframalpha.com/input/?i=word+cactus+inflected+forms And here is their API: http://products.wolframalpha.com/api/ Sławek Check Evo Inflector which implements English pluralization algorithm based on Damian Conway paper " An Algorithmic Approach to English Pluralization ". The library is tested against data from Wiktionary and reports 100% success rate for 1000 most used English words and