jgauffin / griffin.mvccontrib

A contribution project for ASP.NET MVC3
http://blog.gauffin.org/tag/griffin-mvccontrib/
GNU Lesser General Public License v3.0
83 stars 40 forks source link

FileLocalizedTypeRepository loads json file for every translation #39

Closed florisrobbemont closed 11 years ago

florisrobbemont commented 11 years ago

In FileLocalizedTypeRepository.cs, the GetLanguage method, loads the entire JSON prompts file every time a translation is requested.

On line 242 in https://github.com/jgauffin/griffin.mvccontrib/blob/master/source/Griffin.MvcContrib/Localization/FlatFile/FileLocalizedTypeRepository.cs

Lines 241-246 can be replaced with:

prompts = LoadLanguage(culture) ?? new TypePromptCollection(culture); _languages.Add(culture, prompts);

paolosanchi commented 11 years ago

you are right, i'm going to commit your fix.

paolosanchi commented 11 years ago

fixed https://github.com/paolosanchi/griffin.mvccontrib/commit/bb85f2073a54fd5d96126ce7d0dafc93ffaa88f8 https://github.com/jgauffin/griffin.mvccontrib/pull/41