Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi, I am pretty new to C# and using resources in Localization. My query is :
 
If I have some Local Resources and Global resources in my application. Suppose If i don't have a resource in my App_LocalResources folder for particular language, Will the application look for App_GlobalResource folder for that language resource ?
 
For example :
 
App_GlobalResources folder :
 
Myweb.en-US.resx
Myweb.hi-IN.resx
 
App_LocalResources folder :
 
Myweb.en-US.resx
Myweb.hi-IN.resx
 
Suppose if my hindi-Indian resx file will be missing in App_LocalResources folder,,, Is it possible, to make the application look for APP_GlobalResource 's folder if the resx file is missing in App_LocalResource folder ? If it's possible, how can we do that ?
 
Thank you in advance.
Posted 19-Feb-12 1:21am
Edited 19-Feb-12 1:22am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

It won't look at the Global resources, nor should it. "Global" in this context means global to the application (available to across pages etc) rather than a global locale.
 
The rule is it traverses up the tree:
e.g.
Foo.resx (default - lets say english)
Foo.hi.resx (default hindi)
Foo.hi-IN.resx ("Indian" hindi, not sure what other forms there are, but this is it!)
 
Let's say you access a value called Foo and your culture is set to hi-IN. First it will look at the Indian Hindi, then just the generic Hindi, then the default. So the thing to do is have the default language (e.g. American English) in the base Foo.resx file, then localize it for different dialects (e.g. British English). Then add a deafault for Hindi (probably "Indian" hindi, then localize further for Hindi dialects). This should cover pretty much all circumstances and you should be able to re-factor what you have to do what you want in the existing local mechanism.
 
Hope this answers your question fully!
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 7,355
1 DamithSL 5,199
2 Sergey Alexandrovich Kryukov 4,942
3 Maciej Los 4,906
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 19 Feb 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100