Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "eu11111"

Thank you!

What merge tool do you use? VS defaul?

If anyone is interested on a quite clean solution:

I create several bundles that adds the localized scripts. Example:

~/Scripts/Localized/en will include ~/Scripts/jquery-validation/js/localization/messages_en.js ~/Scripts/Localized/pt-BR will include ~/Scripts/jquery-validation/js/localization/messages_pt-BR.js

foreach (var cultureName in listLangCultures)
            {
                bundles.Add(
                    new ScriptBundle(string.Format("~/Scripts/Localized/{0}", cultureName))
                        .Include(
                            string.Format(
                                "~/Scripts/jquery-validation/js/localization/messages_{0}.js",
                                cultureName)));
            }

The class that renders the localized scripts

public class LocalizedScripts
    {
        public static HtmlString Render(string fileName, string culture, string delimiter)
        {
            fileName = string.Concat(fileName, delimiter, culture);
            var output = (HtmlString)Scripts.Render(fileName);
            return output;
        }

        public static HtmlString Render(string fileName, string culture)
        {
            return Render(fileName, culture, "/");
        }

        public static HtmlString Render(string fileName)
        {
            return Render(fileName, Thread.CurrentThread.CurrentUICulture.Name, "/");
        }
    }

Usage examples (used in Layout file, ie)

@LocalizedScripts.Render("~/Scripts/Localized");  // will load ~/Scripts/Localized/[current culture based on thread]
@LocalizedScripts.Render("~/Scripts/Localized", "en");  // will load ~/Scripts/Localized/en
@LocalizedScripts.Render("~/Scripts/Localized", "en", "-"); // will load ~/Scripts/Localized-en

I am not sure if this is the best solution, but it was the easiest/cleanest I could find. It works like a charm. I also suggest implementing something like PermissionNames in the Core layer, but to have a List of all ApplicationLanguage of your application. This way you can also use it on DefaultLanguagesCreator method in DefaultLanguagesCreator

Don't forget the list of language codes: <a class="postlink" href="http://www.science.co.il/Language/Locale-codes.php">http://www.science.co.il/Language/Locale-codes.php</a>

Thanks, hikalkan!

I can't access your link since it is probably private, but I found a workaround. I am loading different localized bundles and then I import the bundle based on the culture name of the user.

Thanks for the answer.

But I can't do it in the bundler, can I? I tried adding like this, but it didn't work!

bundles.Add(
    new ScriptBundle("~/Bundles/pages/vendor/js")
          .Include("~/Dashboard/assets/plugins/jquery-validation/js/localization/messages_" + Thread.CurrentThread.CurrentUICulture.Name.Replace("-", "_") + ".js")
                );

I got it working, if anyone is wondering how, I changed the settings:

Port > 587 Domain > empty string UseDefaultCredentials > false DefaultFromAddress > empty string DefaultFromDisplayName > empty string

I am wondering now how to get a View as a string, so I can build the mail from a View

new MailMessage(new MailAddress("[email protected]"), new MailAddress("[email protected]"))
 {
    Subject = "test",
     Body = [some view here],
    IsBodyHtml = true
 }

Thank you very much !

Thanks for the reply guys!

When you setup your partial view for the top bar (for example), you get a object of type MainMenu that you could manipulate at your own will. Otherwise, you could edit the setnavigation method from NavigationProvider to include some extra logic.

You just have to Add Items at your own will!

Maybe I should change my question: can I work with 2 different deploys sharing one single entity framework? Or should multi-tenant be always single-deploy?

Showing 1 to 9 of 9 entries