Duolingo is the most popular way to learn languages in the world. Best of all, it's 100% free!

https://www.duolingo.com/elvper

Quick course switcher for the new website

elvperPlus
  • 25
  • 22
  • 17
  • 15
  • 13
  • 13
  • 11
  • 2
  • 821

Edit: a script made by somebody else for the new site is working in all browsers. Get it here.. But it doesn't work on the old parts of the website, thus keep the old script installed next to it.

This script allows you to quickly switch between languages for those who do reverse trees or laddering (multiple "from" languages). It's only working on Chrome / Chromium atm.

I've adjusted the script made by Arekolek to work with the new website. The old version of the script has been integrated, which is important as some parts of the website haven't been ported over to the new system yet. Beware that the new script might contain some bugs.

Direct link to install the new script with Tampermonkey. Or view it on Github.. If you don't have Tampermonkey installed, you can get it here.

Credits to Arekolek and Andrewmof for the old versions of the script:

The old discussion thread of the now broken Arekolek's version

The discussion thread of Andrewmof's original version in 2014

I likely won't optimize / adjust the script short term, with the exception of fixing bugs. I'm not a programmer, thus the adjusted script is made by mashing potatoes on a keyboard, it does however work (/should work xD) which is the most important thing.

1 year ago

30 Comments


https://www.duolingo.com/prcsem3

I know this is completely random, but why does it say you have " -9001 " lingots?

1 year ago

https://www.duolingo.com/elvper
elvperPlus
  • 25
  • 22
  • 17
  • 15
  • 13
  • 13
  • 11
  • 2
  • 821

A representation of my programming skills xD.

1 year ago

https://www.duolingo.com/Koopafro
Koopafro
  • 19
  • 12
  • 9
  • 4
  • 4

It's not working for the course and profile pages for me, but it'll still be faster than manual switching. Thanks !

1 year ago

https://www.duolingo.com/elvper
elvperPlus
  • 25
  • 22
  • 17
  • 15
  • 13
  • 13
  • 11
  • 2
  • 821

Edit3: fixed a new bug that caused errors as a result of fixing the previous bug xD. Everything should work perfectly now - hopefully :P. Can you confirm it's all working perfectly now for you?

Edit2: Should be fixed!

Edit: did a semi-fix, preventing it from storing the "undefined" errors, but not fully fixing it. It might essentially fix it for everybody though.

I see, it says "undefined" for the 2nd menu of the original language, right?

That goes away when you switch back to that "from" language and then won't return.

I̶ ̶d̶o̶ ̶n̶o̶t̶ ̶k̶n̶o̶w̶ ̶h̶o̶w̶ ̶t̶o̶ ̶f̶i̶x̶ ̶i̶t̶ ̶a̶s̶ ̶I̶ ̶d̶o̶n̶'̶t̶ ̶u̶n̶d̶e̶r̶s̶t̶a̶n̶d̶ ̶t̶h̶e̶ ̶c̶a̶u̶s̶e̶ ̶y̶e̶t̶.̶

1 year ago

https://www.duolingo.com/elvper
elvperPlus
  • 25
  • 22
  • 17
  • 15
  • 13
  • 13
  • 11
  • 2
  • 821

Oh damn. Does it give any error in the console?

Is it the first time you install a course switching script? I noticed it failing sometimes for new users (who didn't have an old version of the script installed - it takes over old saves of the old script when available) but I thought I fixed it, apparently not :P.

1 year ago

https://www.duolingo.com/Koopafro
Koopafro
  • 19
  • 12
  • 9
  • 4
  • 4

Nope, I've been using the old version for quite some time.

It doesn't say "undefined" or anything, it just doesn't work. It shows the regular menu displaying the languages I'm learning fom English.

1 year ago

https://www.duolingo.com/elvper
elvperPlus
  • 25
  • 22
  • 17
  • 15
  • 13
  • 13
  • 11
  • 2
  • 821

I've fixed a few bugs yesterday, are you running the last version I made of the script, 1.0.9b?

1 year ago

https://www.duolingo.com/Koopafro
Koopafro
  • 19
  • 12
  • 9
  • 4
  • 4

I've just updated it, but it doesn't change anything.

1 year ago

https://www.duolingo.com/elvper
elvperPlus
  • 25
  • 22
  • 17
  • 15
  • 13
  • 13
  • 11
  • 2
  • 821

Does it say anything in the console? (F12 - console)

1 year ago

https://www.duolingo.com/Koopafro
Koopafro
  • 19
  • 12
  • 9
  • 4
  • 4

"ReferenceError: jQuery is not defined"

1 year ago

https://www.duolingo.com/monney30P
monney30P
  • 22
  • 13
  • 8
  • 7
  • 2

Thanks! This one's better than the other ones out right now - I don't have to refresh the page a few times for it to load correctly. :D

One thing you should probably fix is the flags - lots of people (including me) use the flags to quickly tell which language to click on. This seems to only be a problem on pages that use the new version of the site - the flags are correct on the Discussion page, for example.

EDIT: So I did a bit of playing around with inspect element and I think I know what's wrong here. I'm assuming you're getting the flags from this. If the user's course is in the top row (French, Spanish, German, Portuguese, Italian, English, Irish, Hungarian, Russian, Polish), the flag will display correctly. If it is in the next row, the flag will be shifted to the flag directly above it. For example, a Turkish flag will become the German ribbon, and a Japanese flag will become an Italian ribbon. If the flag is in the third row, it will be shifted to the flag two flags above it - Hindi becomes Romanian, Swedish becomes Japanese, etc. If the flag is in the fourth row, it will be shifted up three flags, and if it is in the fifth row, it will be shifted up four flags.

So it looks like a counting error of sorts that can probably be fixed pretty easily. :)

1 year ago

https://www.duolingo.com/elvper
elvperPlus
  • 25
  • 22
  • 17
  • 15
  • 13
  • 13
  • 11
  • 2
  • 821

Thanks for the info. Ok, fixed. Had forgotten to take into account the double rows and didn't notice as all languages I'm learning are on the first row xD.

1 year ago

https://www.duolingo.com/vytah
vytah
  • 16
  • 14
  • 14
  • 13
  • 12
  • 12
  • 11
  • 10
  • 10
  • 9
  • 9
  • 8
  • 7
  • 6
  • 3
  • 1130

There's another script that works like the old one, on every major browser: https://github.com/zeta12ti/DuolingoCourseSwitcher

1 year ago

https://www.duolingo.com/elvper
elvperPlus
  • 25
  • 22
  • 17
  • 15
  • 13
  • 13
  • 11
  • 2
  • 821

Good, then I don't have to spend any more time on this :P.

I only wish I had known earlier that it existed xD

1 year ago

https://www.duolingo.com/Mobetty
Mobetty
  • 25
  • 25
  • 25
  • 23
  • 21
  • 12
  • 8
  • 7
  • 5
  • 4

elvper, Thank you a thousand or 9000 times for this script! I gave you a lingot so you'll have -9000 in your store account. Muita obrigada!

1 year ago

https://www.duolingo.com/elvper
elvperPlus
  • 25
  • 22
  • 17
  • 15
  • 13
  • 13
  • 11
  • 2
  • 821

Is everything working as you'd expect?

Do you like the increased size of the flags? (the main page on the new website only - not on the forum and words tabs)

I think I might add an option on top of the script later to adjust the sizing of the flags a bit (even bigger or smaller), same for the text.

1 year ago

https://www.duolingo.com/HoeckerCarlos
HoeckerCarlos
  • 25
  • 25
  • 22
  • 19
  • 15
  • 13
  • 12
  • 11
  • 7
  • 5
  • 2
  • 1067

It doesn't work

1 year ago

https://www.duolingo.com/elvper
elvperPlus
  • 25
  • 22
  • 17
  • 15
  • 13
  • 13
  • 11
  • 2
  • 821

It will only list courses from languages you've switched to after installing the script. It won't list any courses of "from" languages that you've never switched to AFTER installing the script.

Or is it still not working for you after doing that?

1 year ago

https://www.duolingo.com/HoeckerCarlos
HoeckerCarlos
  • 25
  • 25
  • 22
  • 19
  • 15
  • 13
  • 12
  • 11
  • 7
  • 5
  • 2
  • 1067

I just switch the "from" language to Spanish, and is still not working. (in the home page, new site)
However the old script in the discussion (old site) page still works perfectly.

Edit: I am using Chrome

1 year ago

https://www.duolingo.com/elvper
elvperPlus
  • 25
  • 22
  • 17
  • 15
  • 13
  • 13
  • 11
  • 2
  • 821

Does it give any error in the console? (F12 - click console).

Atm I have no idea why it isn't working for you as it's working perfectly for me, also from scratch.

1 year ago

https://www.duolingo.com/HoeckerCarlos
HoeckerCarlos
  • 25
  • 25
  • 22
  • 19
  • 15
  • 13
  • 12
  • 11
  • 7
  • 5
  • 2
  • 1067

Yes, I tried again with all scripts disabled, including the styles. Same result.:
Uncaught TypeError: Cannot read property 'fromLanguage' of undefined at updateCourses (eval at E_c (:3:221), <anonymous>:121:50) at HTMLDivElement.mouseenter (eval at E_c (:3:221), <anonymous>:183:17) at HTMLDivElement.handle (eval at E_c (:3:221), <anonymous>:8:69) at HTMLDocument.dispatch (eval at E_c (:3:221), <anonymous>:7:28337) at HTMLDocument.v.handle (eval at E_c (:3:221), <anonymous>:7:25042) at HTMLDocument.t._wrapped (https://d35aaqx5ub95lt.cloudfront.net/js/vendor-dc221740.js:90:6903)

1 year ago

https://www.duolingo.com/elvper
elvperPlus
  • 25
  • 22
  • 17
  • 15
  • 13
  • 13
  • 11
  • 2
  • 821

Oh crap, I just realize why it isn't working on the main page - and probably also not for anybody else - except me. I'll check if I can fix it.

1 year ago

https://www.duolingo.com/elvper
elvperPlus
  • 25
  • 22
  • 17
  • 15
  • 13
  • 13
  • 11
  • 2
  • 821

It should be fixed in the last version. Can confirm?

Thanks for your help in finding the bug.

1 year ago

https://www.duolingo.com/HoeckerCarlos
HoeckerCarlos
  • 25
  • 25
  • 22
  • 19
  • 15
  • 13
  • 12
  • 11
  • 7
  • 5
  • 2
  • 1067

This is what I see: Imgur

1 year ago

https://www.duolingo.com/elvper
elvperPlus
  • 25
  • 22
  • 17
  • 15
  • 13
  • 13
  • 11
  • 2
  • 821

Yes, the undefined bug should automatically go away and not return after you've manually switched back to the bugged language. I thought I fixed it though, damn :P. Could potentially be caused by stored values from a previous version. For now I'm going to assume it's because of stored values from an older version as in the last few versions it doesn't do anymore what previously caused this bug to happen.

From the (2nd) picture it looks like it should. Anything wrong related to details you mention? The flags are bigger than in the older script (intentional). There should also be a blue hovering bar on the 2nd menu, which isn't visible in the picture? If missing it could potentially be because of a custom coloring script you use?

1 year ago

https://www.duolingo.com/HoeckerCarlos
HoeckerCarlos
  • 25
  • 25
  • 22
  • 19
  • 15
  • 13
  • 12
  • 11
  • 7
  • 5
  • 2
  • 1067

Wait! now it works!... weird, the only details are the flags
Imgur

1 year ago

https://www.duolingo.com/elvper
elvperPlus
  • 25
  • 22
  • 17
  • 15
  • 13
  • 13
  • 11
  • 2
  • 821

Flags are fixed now. Sorry didn't immediately notice the problem from your picture yesterday :P.

1 year ago

https://www.duolingo.com/anthgrl
anthgrl
  • 25
  • 15
  • 15
  • 8
  • 8
  • 449

It isn't working for me either, I'm afraid (Firefox 53.0.3). When I'm on the homepage it's the same old menu it always was, and when I'm on the discussion page I get the undefined thing. I tried switching between the different courses as you suggested and now all of the base language menus are showing undefined, even the ones that weren't before. Could there be something that I'm doing wrong? I tried logging out and back in again, and restarting my browser... I can't see a version number when I install the script, but I just reinstalled it so it should be the most recent (1.0.9)

Sorry if I'm creating more work for you. I really do appreciate you taking the time to update this script - it's the one I've missed most with the new site, and the other update with all of the courses showing was just too much. So thank you for doing this. :-)

1 year ago

https://www.duolingo.com/elvper
elvperPlus
  • 25
  • 22
  • 17
  • 15
  • 13
  • 13
  • 11
  • 2
  • 821

It was written for Chrome, but I'll check it out.

1 year ago

https://www.duolingo.com/HoeckerCarlos
HoeckerCarlos
  • 25
  • 25
  • 22
  • 19
  • 15
  • 13
  • 12
  • 11
  • 7
  • 5
  • 2
  • 1067

Thank you very much elvper for your effort and time invested!
Happily for all of us, Since today, Duo count with this feature natively!.

1 year ago