<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Localizing an XBAP application without using LocBaml</title>
	<atom:link href="http://www.geektieguy.com/2006/12/12/localizing-an-xbap-application-without-using-locbaml/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.geektieguy.com/2006/12/12/localizing-an-xbap-application-without-using-locbaml/</link>
	<description>News and views from the geek tie guy.</description>
	<lastBuildDate>Mon, 06 Sep 2010 18:09:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: GeekTieGuy</title>
		<link>http://www.geektieguy.com/2006/12/12/localizing-an-xbap-application-without-using-locbaml/comment-page-1/#comment-43595</link>
		<dc:creator>GeekTieGuy</dc:creator>
		<pubDate>Thu, 27 Aug 2009 04:47:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.geektieguy.com/2006/12/12/localizing-an-xbap-application-without-using-locbaml/#comment-43595</guid>
		<description>In theory, yes. You would use MageUI or the command-line equivalent to open up the deployment manifest and then generate a new manifest from there after adding the localized resource dlls. If you search my blog, I have something on using MageUI in order to get UAC elevation to work with XBAP deployed apps. The steps would be similar, I believe. But honestly, I felt at the time that it wasn&#039;t worth investigating in depth, because the XAML localization method I&#039;ve outlined fit my needs at the time perfectly. Sorry I can&#039;t be of more help. Thanks for stopping by and asking, though. I appreciate every single visitor and comments even more!</description>
		<content:encoded><![CDATA[<p>In theory, yes. You would use MageUI or the command-line equivalent to open up the deployment manifest and then generate a new manifest from there after adding the localized resource dlls. If you search my blog, I have something on using MageUI in order to get UAC elevation to work with XBAP deployed apps. The steps would be similar, I believe. But honestly, I felt at the time that it wasn&#8217;t worth investigating in depth, because the XAML localization method I&#8217;ve outlined fit my needs at the time perfectly. Sorry I can&#8217;t be of more help. Thanks for stopping by and asking, though. I appreciate every single visitor and comments even more!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J3nonk</title>
		<link>http://www.geektieguy.com/2006/12/12/localizing-an-xbap-application-without-using-locbaml/comment-page-1/#comment-43593</link>
		<dc:creator>J3nonk</dc:creator>
		<pubDate>Thu, 27 Aug 2009 04:13:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.geektieguy.com/2006/12/12/localizing-an-xbap-application-without-using-locbaml/#comment-43593</guid>
		<description>You said above:
....
And finally, getting an XBAP application to be deployable after localization with LocBaml requires opening up the application manifest and adding all the localized resource files to it. Otherwise a deployment error will bite you.

Do you know how to change  the app manifest to add all the localized resources file?
can you share it with us?

Thanks in advance.</description>
		<content:encoded><![CDATA[<p>You said above:<br />
&#8230;.<br />
And finally, getting an XBAP application to be deployable after localization with LocBaml requires opening up the application manifest and adding all the localized resource files to it. Otherwise a deployment error will bite you.</p>
<p>Do you know how to change  the app manifest to add all the localized resources file?<br />
can you share it with us?</p>
<p>Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GeekTieGuy</title>
		<link>http://www.geektieguy.com/2006/12/12/localizing-an-xbap-application-without-using-locbaml/comment-page-1/#comment-12622</link>
		<dc:creator>GeekTieGuy</dc:creator>
		<pubDate>Wed, 10 Sep 2008 15:22:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.geektieguy.com/2006/12/12/localizing-an-xbap-application-without-using-locbaml/#comment-12622</guid>
		<description>Not off the top of my head. It&#039;s been a long while since I&#039;ve worked with this, so my only feeble suggestion is to investigate some of the constructions that Blend has for doing certain things only at design time. The details escape me right now, but I think I saw something on the Expression Blog at Microsoft about this several months (perhaps even a year) ago.</description>
		<content:encoded><![CDATA[<p>Not off the top of my head. It&#8217;s been a long while since I&#8217;ve worked with this, so my only feeble suggestion is to investigate some of the constructions that Blend has for doing certain things only at design time. The details escape me right now, but I think I saw something on the Expression Blog at Microsoft about this several months (perhaps even a year) ago.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad</title>
		<link>http://www.geektieguy.com/2006/12/12/localizing-an-xbap-application-without-using-locbaml/comment-page-1/#comment-12616</link>
		<dc:creator>Chad</dc:creator>
		<pubDate>Wed, 10 Sep 2008 14:25:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.geektieguy.com/2006/12/12/localizing-an-xbap-application-without-using-locbaml/#comment-12616</guid>
		<description>When I use Application.Current.FindResource, Blend does not render the UI.  The app works, but Blend throws an exception error because it cannot find the resource.

Suggestions?</description>
		<content:encoded><![CDATA[<p>When I use Application.Current.FindResource, Blend does not render the UI.  The app works, but Blend throws an exception error because it cannot find the resource.</p>
<p>Suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.geektieguy.com/2006/12/12/localizing-an-xbap-application-without-using-locbaml/comment-page-1/#comment-7368</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Tue, 13 May 2008 14:31:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.geektieguy.com/2006/12/12/localizing-an-xbap-application-without-using-locbaml/#comment-7368</guid>
		<description>Regarding the issue with the design view and the default language - you can define a RD for your default language in your App.xaml and later optionally add another RD in the described way, the new items will hide the items defined for the default language. BTW for review purposes you could also build an &quot;identity&quot; RD on-the-fly mapping the key value to the key value. With such a auxilary construct you can display your forms showing your keys instead of the values.</description>
		<content:encoded><![CDATA[<p>Regarding the issue with the design view and the default language &#8211; you can define a RD for your default language in your App.xaml and later optionally add another RD in the described way, the new items will hide the items defined for the default language. BTW for review purposes you could also build an &#8220;identity&#8221; RD on-the-fly mapping the key value to the key value. With such a auxilary construct you can display your forms showing your keys instead of the values.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GeekTieGuy</title>
		<link>http://www.geektieguy.com/2006/12/12/localizing-an-xbap-application-without-using-locbaml/comment-page-1/#comment-1368</link>
		<dc:creator>GeekTieGuy</dc:creator>
		<pubDate>Wed, 03 Oct 2007 16:23:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.geektieguy.com/2006/12/12/localizing-an-xbap-application-without-using-locbaml/#comment-1368</guid>
		<description>Sorry, I haven&#039;t had a need to look into that. So I don&#039;t know. 

However, one thing you could try is put default strings into all XAML elements (TextBox, Label, TextBlock, etc.) and then replace them at runtime, for example in the Loaded event (or something that fires earlier.)</description>
		<content:encoded><![CDATA[<p>Sorry, I haven&#8217;t had a need to look into that. So I don&#8217;t know. </p>
<p>However, one thing you could try is put default strings into all XAML elements (TextBox, Label, TextBlock, etc.) and then replace them at runtime, for example in the Loaded event (or something that fires earlier.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick</title>
		<link>http://www.geektieguy.com/2006/12/12/localizing-an-xbap-application-without-using-locbaml/comment-page-1/#comment-1365</link>
		<dc:creator>Rick</dc:creator>
		<pubDate>Wed, 03 Oct 2007 09:51:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.geektieguy.com/2006/12/12/localizing-an-xbap-application-without-using-locbaml/#comment-1365</guid>
		<description>Any idea how to load default language so that application won&#039;t loop crapy in design view?</description>
		<content:encoded><![CDATA[<p>Any idea how to load default language so that application won&#8217;t loop crapy in design view?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Al</title>
		<link>http://www.geektieguy.com/2006/12/12/localizing-an-xbap-application-without-using-locbaml/comment-page-1/#comment-1006</link>
		<dc:creator>Al</dc:creator>
		<pubDate>Sat, 22 Sep 2007 10:51:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.geektieguy.com/2006/12/12/localizing-an-xbap-application-without-using-locbaml/#comment-1006</guid>
		<description>Hi,

I think this way is way better than localization with Locbaml (at least for strings). The problem we have with Locbaml (as far as I tested) is that if a new localizable (e.g. Window) is added to your project AFTER localization process, you&#039;ll need to regenerate the whole .csv file, so what will happen to all already localized content?

I&#039;ve changed your code to contain fallback to default culture when a culture-specific resource is not found. Here it is :


        public static ResourceDictionary LoadExternalResourceDictionary(string xamlFilename, CultureInfo culture)
        {
            string cultureName = string.Empty;

            if (culture != null)
                cultureName = string.Concat(&quot;.&quot;, culture.Name);

            if(Path.HasExtension(xamlFilename))
            {
                string ext = Path.GetExtension(xamlFilename);
                xamlFilename = xamlFilename.Remove(xamlFilename.Length - ext.Length);
            }

            try
            {
                string looseFile = string.Format(&quot;pack://siteoforigin:,,,/{0}{1}.xaml&quot;, xamlFilename, culture != null ? cultureName : string.Empty);
                Uri uri = new Uri(looseFile, UriKind.Absolute);

                System.Windows.Markup.XamlReader reader = new System.Windows.Markup.XamlReader();
                System.Windows.Resources.StreamResourceInfo info = System.Windows.Application.GetRemoteStream(uri);

                return reader.LoadAsync(info.Stream) as ResourceDictionary;
            }
            catch
            {
                if(culture != null)
                {
                    return LoadExternalResourceDictionary(xamlFilename, null);
                }
                else
                {
                    throw;
                }
            }
        }</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I think this way is way better than localization with Locbaml (at least for strings). The problem we have with Locbaml (as far as I tested) is that if a new localizable (e.g. Window) is added to your project AFTER localization process, you&#8217;ll need to regenerate the whole .csv file, so what will happen to all already localized content?</p>
<p>I&#8217;ve changed your code to contain fallback to default culture when a culture-specific resource is not found. Here it is :</p>
<p>        public static ResourceDictionary LoadExternalResourceDictionary(string xamlFilename, CultureInfo culture)<br />
        {<br />
            string cultureName = string.Empty;</p>
<p>            if (culture != null)<br />
                cultureName = string.Concat(&#8220;.&#8221;, culture.Name);</p>
<p>            if(Path.HasExtension(xamlFilename))<br />
            {<br />
                string ext = Path.GetExtension(xamlFilename);<br />
                xamlFilename = xamlFilename.Remove(xamlFilename.Length &#8211; ext.Length);<br />
            }</p>
<p>            try<br />
            {<br />
                string looseFile = string.Format(&#8220;pack://siteoforigin:,,,/{0}{1}.xaml&#8221;, xamlFilename, culture != null ? cultureName : string.Empty);<br />
                Uri uri = new Uri(looseFile, UriKind.Absolute);</p>
<p>                System.Windows.Markup.XamlReader reader = new System.Windows.Markup.XamlReader();<br />
                System.Windows.Resources.StreamResourceInfo info = System.Windows.Application.GetRemoteStream(uri);</p>
<p>                return reader.LoadAsync(info.Stream) as ResourceDictionary;<br />
            }<br />
            catch<br />
            {<br />
                if(culture != null)<br />
                {<br />
                    return LoadExternalResourceDictionary(xamlFilename, null);<br />
                }<br />
                else<br />
                {<br />
                    throw;<br />
                }<br />
            }<br />
        }</p>
]]></content:encoded>
	</item>
</channel>
</rss>
