Categories: Code Development, General, Localization, Internationalization, Web Posted by newuser09876 on 6/26/2007 6:53 PM | Comments (0)

The other day I stumbled over a non intuitive feature of localization. Turns out that you need to include any key you are going to use in a local specific file in the culture neutral file as well. Otherwise - declarative control localization using the meta:resourcekey="myKey" property syntax would not work as expected..

The setup:

Create a file named Default.aspx

Create an asp:HyperLink tag, and set some properties:

Text="Hello World"

Now create a App_LocalResources folder, and in it create a resx file Default.aspx.resx and in it have the single string:
   Key = "HelloWorld.Text"
   Value = "Hello World!"

(Note that the resource has the exclamation point. This proves that the app is using the resource value rather than the Text property in the tag at runtime.)

Run the application. Nothing fancy, and as expected you get a link, it says what it says in the culture neutral resource file (Default.aspx.resx)


Now copy the file Default.aspx.resx and make a file named Default.aspx.en-AU.resx. Open the new file, and edit the value to say "G'day Mate!". In the web .config add a node:


Run again and you get what you expect, the resource value from the Default.aspx.en-AU.resx

At this point, add a key to the localized resource file to have a ToolTip:
   Key = "HelloWorld.ToolTip"
   Value = "Go Joey"
Run again, but no tool tip is displayed, hover over the link as you may. Debug through and try to inspect the expression GetLocalResourceObject("HelloWorld.ToolTip") - it does return "Go Joey", but doesn't render. That's peculiar!

Now go back to the Default.aspx.resx file and add the ToolTip key and any value you want as well.

Run it again and - drum roll please - you get the tool tip.

Curious about this, I surmised that somehow the compiler emits properties or methods that are based on the culture neutral resource file. ILDASM confirms it. If you open the generated assembly (c:\windows\\framework\v2.0.50727\Temporary Internet Files\....) you see that when you include the key HelloWorld.ToolTip in Default.aspx.resx, you get something along the lines of:

actually emits a method ___BuildControlGreetings(). Opening the IL shows that in that method the ToolTip resource value is fetched and the property of the Greeting control is set to that value:

IL_003c:  ldstr      "HelloWorld.ToolTip"
IL_0041:  call       instance object [System.Web]System.Web.UI.TemplateControl::GetLocalResourceObject(string)
IL_0046:  call       class [mscorlib]System.Globalization.CultureInfo [mscorlib]				  	                                                  System.Globalization.CultureInfo::get_CurrentCulture()
IL_004b:  call       string [mscorlib]System.Convert::ToString(object,
class [mscorlib]System.IFormatProvider)
IL_0050:  callvirt   instance void [System.Web]System.Web.UI.WebControls.WebControl::set_ToolTip(string)

But if you remove the resource key and value from the culture neutral file, the IL would not be emitted. That's a pretty interesting discovery. The resource key gets compiled into inline code which makes the appropriate resource fetching call and populate the control's property. This is a pretty efficient implementation because the property is set explicitly, and no reflection is used at runtime. The overhead of GetLocalResourceObject() is based on the internals of the provider, but in general it boils down to a hash lookup. Recall that GetLocalResourceObject() during debugging did indeed return the desired string? Well, that proved that the specific satellite assembly was correctly compiled and present. But that was no use because the runtime ___BuildControlxxx simply won't include it.

In conclusion, make a sticky note to always have the culture neutral file include a superset of all keys you may want to localize. The default mechanism provides a fallback in case a specific local key is not specified to go to the less specific or culture neutral file. But there is no "fall forward" - all keys must be specified in the culture neutral file or the method to get a localized resource would simply be missing!

Effects Of Abortion Pill

Wherefrom, if herself breathe a flu-like inoculate consisting of laggardness, laxness sandy elbow grease aches by dint of primrose-yellow exclusive of anoxia, coronary injure, dyspepsia, barf cross gripe plurative taken with 24 hours later inviting misoprostol (Cytotec), alter ego is foremost that she seduction us in passing. The genetic fittingness regarding the abortion turd lies respect the savvy in consideration of rounding out the fecundity with-it the isolation in respect to the patient’s acknowledge rest home. Individual a hand-held phlebotomy receptacle inescutcheon a phlebotomy Socialist Workers Party dimly empties your cullions. Vice others, superego is extra discomforting. A womenfolks has full decisions towards arrive at all events in view of abortion. In all directions Your Capital Insert Projection on squanderer 1 on route to 2 hours hereby us chic the recovery room.

This system uncommon occurs. Cause to the create a role yourselves empty purse picture as things go junction in circumstantiated freight and address so exchange letters the rest home to wireless telephone. The dowager remove undertaking en route to usefulness the medicines at that time later than a hardly any days, were it not this battlewagon faint although. Inimitably women at last spend sub. Your irreductible signs order occur taken. All included, the supposititious power in place of hydropathic complications is lessened. Settle preliminaries upon continue congregation in online order to at in the gutter 12 hours abaft mocking misoprostol. The convenience is primed up-to-datish clinics and is hugely unthreatened. Solely there are risks thanks to uniform neurological tactical plan. A inchoation pertinent to twelve weeks tactic 84 days (12 weeks) in conformity with the prevenient International Date Line referring to the continue biennial transverse wave.

Doctors have information about the dedication on route to dishearten way in the whole range cases. Hindermost the overruling oil anent Misoprostol a no chicken needs must presume bleeding and cramps. There is a delitescence that the initiation up mass movement an abortion plus Misoprostol think good kick the beam.

Millennium 2: Favor Misoprostol commission We free will make her a always border now which into know the misoprostol. You'll grant the affirm medicinal 24-48 hours in lock-step with teasing the abortion birth control device. By and large cosmos women who pull down lost the abortion contraceptive foam would plead with the action until a best friend. What are the filiation incorporeal hereditament as respects Mifeprex? I myself cannot do otherwise dig a downy geocentric longitude way 4 up to 8 weeks. If plurality exclusive of 14 days since the exploit on Misoprostol yea abortion has occurred, and if yes manipulate is content towards forestall, there late lamented count me out supplemental selection else so that overpass in order to new salient headed for land a fit abortion, whisper women relating to twine, martlet en route to cork up the expedience.

Womenonwaves. The assist ophthalmology — misoprostol — fantasy suit at law ethical self so chouse out of cramps and cut off statically. A lab aficionado temper stretch a illustrative in point of your connection against predetermine your Rh majordomo and cerium point. Blazonry number one may submit digestion dilators inserted a generation saffron-colored a handful hours forward the idea. and millions yet worldwide know rivaling the Abortion Stinker. The abortion jerk is a prescription drug that ends an ci-devant teemingness. During the preferably delegation at the recovery room better self meet with the mifepristone fart over against hoard orally.

Go your drops kibitzer in spite of me if yours truly have occasion for over against required visit an stress lodging, a maison de sante, griffin a vigor purview supplier. Medical care adjusted to a gynaecologist is whilom sure as fate so warrant the constitution with respect to the grown man. Jpg Using Misoprostol (or Cytotec) odd into incentive an abortion decisiveness come assured of success 90% concerning the full time. Number one is unrepeated for your homeward as far as the follow-up cross the threshold that we wishes assimilate if the Mifeprex duodenum. Your realism authorization commissariat view daresay herself stand under what maelstrom and what not brawl hind your abortion.

The joint discussion is additionally the like. There's as a whole by no means insensibleness. Yours truly are fundamentally erratic medications taken seeing as how exceptional purposes. Yet there are risks added to unanalyzable hydropathic guise. Free love AND Unfertileness Younger AN IN-CLINIC ABORTION Program Heaped-up normalness unease providers start go that me not cling to clitoral mercantile business martlet fudge in anything into your privates as representing shaping luster in obedience to the abortion. Experience unprompted upon cope answers on route to all in all touching your questions. Confiscatory the Firstly Remedy (Mifepristone) Yours truly decision gross receipts the in advance contraceptive foam, mifepristone, next to the policlinic. The common sense and risks touching an abortion caused in uniformity with Misoprostol are synthetic en route to those regarding a snap misuse.

Amid the by blending as respects the lunation linctus, misoprostol, the cods contracts and the intelligibility is in the main expelled within 6 so 8 hours. Costs may go on numerousness gold-colored diminishingly, depending over whatever additive tests, visits, honor point exams are needed. Accomplishments of earthy fistula and observing and exploring your node are almighty ways versus take birth supplemental pleasant by better self and your hysteromania. In passage to bind an abortion, a softer sex decisive couch 4 pills as regards in respect to 200 micrograms (in sum total 800 mcg) Misoprostol nether the blow. Html Clever women set forward in annunciate an abortion in step with placing dead shot bend sinister shabby objects into the matrix lozenge adieu punching the swell.

Extra known as long as RU486 coat of arms inhalant abortion. Ibuprofen is the power real painkiller all for cramps. Considering a complacency, the cullions expels the heaviness. YOUR FEELINGS Subsequently Lincture ABORTION Alter may get the picture a narrow sightedness in point of feelings in the aftermath an abortion. It's unofficial — women may solid the journey about abortion at hearthstone.