1. Forum
  2. >
  3. Topic: Duolingo
  4. >
  5. Userscript: Flag Background

https://www.duolingo.com/profile/Torsby

Userscript: Flag Background

<h1>Updated!</h1>

Hello all, I liked DasEinhorn's idea for a Flag Background userscript, which he stated in a comment on my Animated Duo userscript (https://www.duolingo.com/comment/7154119), so I decided to make an userscript for that as well.

This script changes the background of Duolingo to a grunge flag (most of them by http://think0.deviantart.com) corresponding the language you are learning.

This script now supports the flags for: Danish, Swedish, Norwegian, Irish, Esperanto, Vietnamese, Hungarian, Turkish, Irish, French, German, Portuguese (Brazil flag), Spanish (Spain flag), Italian, Dutch, Ukrainian, Polish, Greek and eventhough there is no sign of it: Icelandic.

The script is optimal for maximised browser windows.

Be sure to have tampermonkey for Chrome or greasemonkey for Firefox :).

Click here to download the script

UPDATE: The script now also supports the American flag for English!

UPDATE 2: The script now properly supports the Norwegian flag as well and the unsafe Download link is replaced by another one! :) Also improved the visibility of the footer links.

February 25, 2015

72 Comments


https://www.duolingo.com/profile/alexinIreland

That Irish background looks so good :D This is a really cool user script, thanks for sharing!


https://www.duolingo.com/profile/DeutscheMaus

The flags look great! By the way, I love your platypus avatar. :)


https://www.duolingo.com/profile/flootzavut

You make user scripts an art form!


https://www.duolingo.com/profile/writchie4

Thanks for the script, Torsby. Normally I'm not a fan of scripts like this that substantially change the design of the page, but this looks great.

My one suggestion would be to change the row of links at the bottom of discussion posts to some sort of color scheme that won't blend into the background. The links are basically invisible against the yellow in the Spanish flag (even more so than the usual light-gray on white color scheme). Maybe white text with a black border if that's possible?

Edit: Yes, it's possible. I added a couple lines to the script to make the links more visible. Can't do anything easily for the twitter and facebook links, but it's still a little better.


https://www.duolingo.com/profile/Torsby

Thank you, I put this in the update :)


https://www.duolingo.com/profile/prunc

Thanks for the script. Very inspirational.

I have only one critical thought. I learn german from the english for german speakers course and there is no english flag in your script, so the background remains white. Can you add an english flag to your script, please?

Also, you can modify the last four lines of code in your doFlag() function to look like this:

<pre>if(backgroundurl != ""){ $("body").css("background", "url("+backgroundurl+")"); $("body").css("background-size", "100%"); $("body").css("background-repeat", "no-repeat"); $("body").css("background-attachment", "fixed"); } </pre>

It is going to skip changing the background for courses it doesn't have a flag for.

Again thank you very much for this. It was worth your time.


https://www.duolingo.com/profile/Ice-Cold

Also, if you speak real English, you can just change the link under "American Flag" to: http://i.imgur.com/R5QUYoP.jpg And you will get the union jack. (Alternatively you can change any of the links to any country you like the same way.) Thanks heaps for this script btw!!


https://www.duolingo.com/profile/writchie4

if you speak real English

Ahem.... (A proper twist in ya knickers, init?)


https://www.duolingo.com/profile/Ice-Cold

P.S. I've never even been to England, I just like to acknowledge where my language came from - and it wasn't America :) Just like I don't learn German with a Swiss or Austrian flag as my background :) I can understand wanting your own country's flag there, but if you are from a different English-speaking country, it makes more sense to me to have the Union Jack :)


https://www.duolingo.com/profile/Ice-Cold

This article states that US english is archaic, and UK English kept evolving...? I guess I can agree, a language needs to keep growing, otherwise we wouldn't have words like 'computer' and 'laptop'. All great languages go through reformation and evolution, it keeps them alive :)


https://www.duolingo.com/profile/Torsby

Thanks! I updated it to support English!


https://www.duolingo.com/profile/JeskeH

I also think this is great!

I'm very much a context-dependent learner, so I was afraid of doing multiple languages on Duolingo simultaneously, for fear of mixing them up (I have no problem separating Mandarin and Swedish, because I'm learning Mandarin in a red book as opposed to blue/green Duolingo). Maybe these customized backgrounds will provide sufficiently different contexts for me to take up Irish again parallel to Swedish :)


https://www.duolingo.com/profile/Torsby

Thanks, I hope it helps! :)


https://www.duolingo.com/profile/513forever

Duolingo should make this an option in General


https://www.duolingo.com/profile/zalbro

Could you add Catalan? It keeps giving me the American flag when I switch to that course.


https://www.duolingo.com/profile/Albrechtion

That looks incredible!


https://www.duolingo.com/profile/GeniusJack

Thank you so much for posting! I love this script!


https://www.duolingo.com/profile/Azure_Waters

This is so cool!!! ^_^


https://www.duolingo.com/profile/MultiLinguAlex

Thank you so much for all the time you put into these useful and good-looking scripts =)


https://www.duolingo.com/profile/Eey91

Wow this is awesome!!! (downloading)

Question: Is there a way to keep the little green and gray mountains at the bottom of the page?, just because they are nice =)

English being the most taught language deserves a flag too hehe.


https://www.duolingo.com/profile/GwenDragoness

One slight error: the script shows the American flag for the Norwegian course. I fixed it by changing the condition from "no-BO" to "nb".


https://www.duolingo.com/profile/Torsby

Changed this in the update, thanks!


https://www.duolingo.com/profile/UneJamKuqEZi

Hello, your userscript is awesome! I just wanted to point out one thing, the Russian flag image url has 2 h's in the http. So it's hhttp.


https://www.duolingo.com/profile/prunc

Still the same after one year. hhttp://i.imgur.com/shKQqnR.jpg


https://www.duolingo.com/profile/S0R0USH

The flag gives me a sense of xenopatriotism which motivates me to learn the language even more haha


https://www.duolingo.com/profile/LangForThought

Nothing for Safari?


https://www.duolingo.com/profile/-..--..-.-.-.-

Use my updated version instead, it fixes the bug with Russian and includes every upcoming course including Welsh and Swahili: http://pastebin.com/hFCeQ2vn


https://www.duolingo.com/profile/Balaur

The Hebrew course currently displays an American flag. Will an Israeli flag be made available?


https://www.duolingo.com/profile/wazzie

Cute personalization‎!


https://www.duolingo.com/profile/GC1998

Is that Conworkshop I see? Are you a conlanger?


https://www.duolingo.com/profile/Torsby

Jups, I do conlang! :)


https://www.duolingo.com/profile/DerGoldmann

Much thanks. Finally got around to trying it out and it looks spectacular! :)


https://www.duolingo.com/profile/mjaumjaupurr

For some reason, the Norwegian flag background is showing up completely blank for me. I use tampermonkey. Any tips for how to fix it? Thanks!


https://www.duolingo.com/profile/Torsby

I updated the script, the link also should work! Pleas reinstall :)


https://www.duolingo.com/profile/grey236

What do you do after you click on the link because google gives me a yellow message at the top of my screen saying' "apps, extensions, and user scripts cannot be added from this website." I'm on windows btw


https://www.duolingo.com/profile/Suvajlo

Can you add the Russian flag too?


https://www.duolingo.com/profile/IvritMiron12

Maybe Israeli flag...?


https://www.duolingo.com/profile/Katzenperson

Would you consider updating your script for the new website? I was upgraded to the new websites, and all of my userscripts are broken, including your wonderful script.

I certainly hope you can. I miss the background!


https://www.duolingo.com/profile/Mandiras

I have used this successfully for a while now, but for the last few months (possibly as part of the Duolingo website update), the backgrounds have only worked properly in the 'Discussion' and, where applicable, 'Words' tabs. There's only the default grey background in the 'Home' tab (e.g. when doing exercises).


https://www.duolingo.com/profile/_Great_Uniter

I do like this script! Thank you for sharing!


https://www.duolingo.com/profile/LeIouch

Cool! Now there's a userscript I'll actually use, thanks!


https://www.duolingo.com/profile/DeanG6

I had this same idea yesterday myself. Must have read your mind. Thanks for creating this!


https://www.duolingo.com/profile/linguafiqari

The link isn't working for me for some reason (I have Tampermonkey installed).


https://www.duolingo.com/profile/Pratyush.

same for me. timeout error is showing up.


https://www.duolingo.com/profile/Torsby

Updated the link, should work now! Sorry it took so long.


https://www.duolingo.com/profile/Torsby

Updated the link, should work now! Sorry it took so long.


https://www.duolingo.com/profile/Torsby

Updated the link, should work now! Sorry it took so long.


https://www.duolingo.com/profile/Torsby

Updated the link, should work now! Sorry it took so long.


https://www.duolingo.com/profile/FrankKool

Very cool. Thanks for sharing!


https://www.duolingo.com/profile/Xefjord

I just discovered this beautiful flag userscript and I was wondering if it would be updated for the release of Russian? By anyone possibly? (I would also like to see a Hindi flag whenever that comes around) I wonder if the creator is gone because of his lack of activity on his homepage Q_Q


https://www.duolingo.com/profile/-..--..-.-.-.-

http://pastebin.com/hFCeQ2vn I updated to include every coming course including hindi and swahili


https://www.duolingo.com/profile/Pratyush.

Does it have Russian Flag ?


https://www.duolingo.com/profile/fiziksphreak

Your comment is old but for anyone else that comes across this, the web address for the Russian flag has a typo. It is hhttp. Remove the extra 'h' and it works perfectly.


https://www.duolingo.com/profile/-..--..-.-.-.-

It does but a bug messes it, my fixed version supports it. Just install original and paste mine in its place: http://pastebin.com/hFCeQ2vn


https://www.duolingo.com/profile/KateM303

Love it, thanks!!


https://www.duolingo.com/profile/Friesk

I have no idea how to get this to work, can I get some help with this?


https://www.duolingo.com/profile/Friesk

Nevermind, I got it to work! :D


https://www.duolingo.com/profile/jonathanbost

Well then, can you tell me how to?


https://www.duolingo.com/profile/Ceeciliiaa

Thanks a lot for this!! I really love it!

I think the background flag from Israel (because of Hebrew) is not available yet, right? :)


https://www.duolingo.com/profile/killerbng

Thank you very much!!


https://www.duolingo.com/profile/killerbng

It seems the RU url has hhttp, so to use it we need to remove 1 h , still an awesome userscript though!


https://www.duolingo.com/profile/Balaur

Currently, flags for Hebrew, Welsh, Romanian, Catalan, and Guaraní are missing. All these besides the one corresponding to Catalan (for which I'm sure a request could be made) exist in the Deviant Art source gallery. Any chance of seeing these in the near future?


https://www.duolingo.com/profile/dogomolo

Does this still work? I am using Chrome


https://www.duolingo.com/profile/-Meteora
  • Như cặc hahaha :)

https://www.duolingo.com/profile/KingLuiso

Not work with Firefox Quantum.


https://www.duolingo.com/profile/Sepochi

Does this script still work? It doesn't work here.

Learn a language in just 5 minutes a day. For free.