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


Userscript: Flag Background


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



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


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


You make user scripts an art form!


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.


Thank you, I put this in the update :)


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.


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!!


if you speak real English

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


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 :)


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 :)


Thanks! I updated it to support English!


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 :)


Thanks, I hope it helps! :)


Duolingo should make this an option in General


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


That looks incredible!


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


This is so cool!!! ^_^


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


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.


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".


Changed this in the update, thanks!


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.


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


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


Nothing for Safari?


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


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


Cute personalization‎!


Is that Conworkshop I see? Are you a conlanger?


Jups, I do conlang! :)


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


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!


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


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


Can you add the Russian flag too?


Maybe Israeli flag...?


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!


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).


I do like this script! Thank you for sharing!


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


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


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


same for me. timeout error is showing up.


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


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


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


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


Very cool. Thanks for sharing!


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


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


Does it have Russian Flag ?


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.


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


Love it, thanks!!


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


Nevermind, I got it to work! :D


Well then, can you tell me how to?


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

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


Thank you very much!!


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


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?


Does this still work? I am using Chrome

  • Như cặc hahaha :)


Not work with Firefox Quantum.


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

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