Serenity: Language selection does not work in IE11

Created on 10 Aug 2018  路  16Comments  路  Source: serenity-is/Serenity

Hi @volkanceylan ,

just a quick note: Under IE11, the language selection (switch language for currently logged in user on right, upper side) does not work in newest Serenity and also not on your demo page. With Chrome it works.

With Kind regards,

John

Most helpful comment

Just upgraded to Serenity 3.7.7 on core and it does not work for IE either. Chrome is fine. Thanks.

All 16 comments

I'll did this same question.

Language selection works on firefox too. Can't check if this works on edge too, because I don't have windows 10.

The other problem is when I migrate my classes from old Serenity Version to actual version (of course, checking all tips from upgrade guide or create a new project from template and migrate) and run, I have and error "prototype can't be null"

And it point to language script.

image

late notes:
1 - restarted VS
2 - restarted PC
3 - updated packages (Update-Package Serenity.Web and Update-Package Serenity.CodeGenerator)
4 - done steps 1 and 2 again

errors still happens.

Sorry, can't reproduce, it works in my PCs :/

image

Prototype error has no relation to this, you probably miss some /// references

@volkanceylan you are using Edge, try in IE it fails there.

@volkanceylan

you tried it with MS Edge, not IE11. Look at your Screenshot - This is Edge. :-)

P.S: With Edge it works - with IE11 not.

As IE11 is still the most used Webbrowser within Companies internal IT infrastructure - at least with those customers I work with - this should be fixed.

With kind regards,

John

@JohnRanger I already tried to tell that to @volkanceylan but it didn't answer, perhaps to busy ;)

@brunobola ,

jeah - I see - but I thought that when the creator of an issue responses to his response - maybe that has more weight :-)

I also think Volkan is very - very - busy (probably too many customers - all wanting his expert knowledge - plus the continuing work on the roadmap of SF / StartSharp).

Better so than no work.

Hope he will see this post in the near future and fix his really excellent Framework which I enjoy to work with every moment.

With kind regards,

John

For yet another confusing data point, changing language in IE 11 using 3.7.7 (asp.net, not core) is working for me locally. On the demo site, the Language dropdown is empty:

image

Just upgraded to Serenity 3.7.7 on core and it does not work for IE either. Chrome is fine. Thanks.

As I needed to solve it, I tried to find where it is happening. And in IE, the x function is undefined.

image

My knowledge of javascript is not deep enough to solve this in an elegant way, so I changed the async method to sync:

image

Until it gets fixed in Serenity.

Looks like in IE 11, Promises are not working as expected, so Async doesn't work properly.

You might need to load "~/Scripts/rsvp.js" before Serenity.CoreLib.js etc. scripts in LayoutHead.cshtml or ScriptBundles.json.

I won't be doing that as i don't want to load an extra script to please IE11, and its usage percentage is pretty low.

You might need to load "~/Scripts/rsvp.js" before Serenity.CoreLib.js etc. scripts in LayoutHead.cshtml or ScriptBundles.json.

I was doing this, probably why I couldn't reproduce the issue.

@Volkanceylan,

thanks for your feedback.

I think that Serenity Framework is still mostly used within Enterprises for - borrowed from your advertisement of it :-) - data-driven business apps.

So far, all of my large customers do still use IE11 as their standard in-house browser as it is the only browser which is enough configurable to be useful within large enterprises (>=50'000 users). Chrome has some GPOs but all IT guys which I am talking to do confirm that Chrome is not yet enterprise ready.

Firefox cannot at all be used in large enterprises because it is not centrally configurable.

So I think it would be still a good thing that Serenity Framework would fully work with IE11 at this point in time.

With kind regards,

John

And, if you are developing a software for an Enterprise, it wouldn't be that hard to add a line to ScriptBundles.json is it? And, you always say you use Serenity for personal projects, and customers are Enterprises with 50k+ users ;)

Hi @volkanceylan ,

I just saw your last comment right now :-) Yes - It is no problem to add the relevant line to _LayoutHead.cshtml (which with the current version of SF (3.9.9) does not work anymore by the way). I was more concerned about your way of thinking that IE11 is not anymore relevant and you would not anymore make sure that the current version of SF would be tested/garantied to run with IE11.

Even today (End of June 2019), while IE11 has about 1'500 GPO settings to manage it well behaving within an enterprise, Edge has only about 20 (a good article about that is here: https://theitbros.com/config-microsoft-edge-settings-using-gpo/.) This is why bigger entrerprises simply cannot just switch to anything else and are forced to continue to use an outdated browser - because the rest of them are not enterprise-ready (thank you Microsoft to leave all your well-paying enterprise customers in this really bad situation - a good new browser (Edge in Chromium mode) but not enterprise-manageable).

And with regards to my Serenity Projects... :-) With my customers, I am never contracted as a developer. Most positions are IT architect, IT admin or IT operator - depending on the needs of the customers. In these positions I often encounter situations where a Serenity-based app can relieve / solve some real problems - but I would never get any development budget for it. So I develop beside my official work and when the app then does its job, some people with which I work there (or myself) can do the work more efficient or more structured / guided because of the app.

This as a little insight in what I am doing :-)

Wish you a nice evening.

With kind regards,

John

Hi All,

if you came here because you are still forced to support IE11 - and the language selection didn't work anymore with the most recent SF 3.9.9, then do this (mostly borrowed from @globtech1 but made it work with the most recent (at time of writing) SF 3.9.9.

Modify /Modules/Common/Navigation/LanguageSelection to look like this:

namespace <your name space>.Common {
    export class LanguageSelection extends Serenity.Widget<any> {

        constructor(select: JQuery, currentLanguage: string) {
            super(select);

            currentLanguage = Q.coalesce(currentLanguage, 'en');

            this.change(e => {
                $.cookie('LanguagePreference', select.val(), {
                    path: Q.Config.applicationPath,
                    expires: 365
                });
                window.location.reload(true);
            });

            <your name space>.Administration.LanguageService.List({
            }, response => {

                response.Entities.forEach( x => {
                    Q.addOption(select, x.LanguageId, x.LanguageName);
                });

                if (!Q.any(response.Entities, z => z.LanguageId === currentLanguage)) {
                    var idx = currentLanguage.lastIndexOf('-');
                    if (idx >= 0) {
                        currentLanguage = currentLanguage.substr(0, idx);
                        if (!Q.any(response.Entities, y => y.LanguageId === currentLanguage)) {
                            currentLanguage = 'en';
                        }
                    }
                    else {
                        currentLanguage = 'en';
                    }
                }

                select.val(currentLanguage);

            });

        }
    }
}

That's it. This pulls the neccesary data direct from the server endpoint instead of relying on the lookups (which at that point in time are not yet ready). DB access always is more reliable than lookup because of no timing problems. :-)

Hope this helps someone.

P.S: Have just made a Wiki article of it: https://github.com/volkanceylan/Serenity/wiki/Fix:-Language-Selection-does-not-work-in-IE11-and-recent-Serenity-Frameworks

With kind regards,

John

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JohnRanger picture JohnRanger  路  3Comments

Amitloh picture Amitloh  路  3Comments

stixoffire picture stixoffire  路  3Comments

StefanTheiner picture StefanTheiner  路  3Comments

dudeman972 picture dudeman972  路  3Comments