Note that there are some explanatory texts on larger screens.

plurals
  1. POArabic resource files not being picked by ASP.NET web site
    text
    copied!<p>I'm working on a project that has a web application module that generates localized emails upon request. The app requires html templates localization for several languages. I decided to go with asp.net resource files since the email layout is not likely to change and the amount of keys needed was relatively small. </p> <p>I'm using Global Resources and have around 15 different resource files for the required locales. I have my default resource file in English ("EmailTemplates.resx") and then several localized resource files ("EmailTemplates.ru-RU.resx", "EmailTemplates.zh-CN.resx", "EmailTemplates.it-IT.resx", "EmailTemplates.id-ID.resx", etc).</p> <p>Among the resource files, I have two arabic ones: "EmailTemplates.ar-AE.resx" which is actually in English and "EmailTemplates.ar-SA.resx" which is in Arabic. </p> <p>All the emails for non Arabic locales work perfectly. The app picks up the required locale and uses the corresponding resource files. But when I try to request the Arabic ones, it always fall back to the default resource file.</p> <p>The way I'm setting up the culture is based on the data requested, and not the browser settings:</p> <pre><code>Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture); Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(culture); </code></pre> <p>While debugging I can see that the CultureInfo is properly set to "ar-SA" or "ar-AE" but when the app retrieves the corresponding resource value, it always picks up the default one.</p> <p>I have entered Arabic data in the default resource file for testing purposes, and the Arabic text displays just fine, so I'm sure that it is not a font or HTML layout issue. </p> <p>I have searched all around the Internet, proved different approaches, and no luck. The "ar-SA" and "ar-AE" are valid CultureInfo values and the app compiles without issues, but it seems that whenever I request the Arabic emails, the app can't find the Arabic resource files.</p> <p>Any ideas? I'd really appreciate any hits and help !</p> <p>Cheers!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload