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!

February 25, 2015

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

Looks great!

February 25, 2015

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

Beautiful!

February 25, 2015

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

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

February 25, 2015

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

You make user scripts an art form!

February 25, 2015

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.

February 27, 2015

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

Thank you, I put this in the update :)

May 23, 2015

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.

February 26, 2015

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

Thanks! I updated it to support English!

February 26, 2015

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

November 12, 2015

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

if you speak real English

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

November 12, 2015

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

November 12, 2015

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

November 12, 2015

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

February 26, 2015

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

Thanks, I hope it helps! :)

February 26, 2015

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

Duolingo should make this an option in General

February 26, 2015

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

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

January 18, 2016

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

That looks incredible!

February 25, 2015

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

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

February 25, 2015

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

This is so cool!!! ^_^

February 25, 2015

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

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

February 25, 2015

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.

February 25, 2015

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

May 22, 2015

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

Changed this in the update, thanks!

May 23, 2015

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.

May 24, 2015

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

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

December 8, 2016

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

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

July 4, 2015

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

Nothing for Safari?

November 2, 2015

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

November 4, 2015

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

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

June 22, 2016

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

Cute personalization‎!

February 25, 2015

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

Is that Conworkshop I see? Are you a conlanger?

February 25, 2015

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

Jups, I do conlang! :)

February 26, 2015

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

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

March 4, 2015

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!

May 22, 2015

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

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

May 23, 2015

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

November 2, 2015

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

Can you add the Russian flag too?

December 19, 2015

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

Maybe Israeli flag...?

November 25, 2016

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!

May 3, 2017

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

July 10, 2017

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

I do like this script! Thank you for sharing!

February 25, 2015

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

I'm loving it!

February 27, 2015

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

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

February 27, 2015

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

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

February 28, 2015

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

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

May 3, 2015

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

same for me. timeout error is showing up.

May 3, 2015

https://www.duolingo.com/profile/f.grottesi

Me too!

May 5, 2015

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

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

May 23, 2015

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

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

May 23, 2015

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

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

May 23, 2015

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

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

May 23, 2015

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

Very cool. Thanks for sharing!

July 9, 2015

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

September 1, 2015

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

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

November 4, 2015

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

Does it have Russian Flag ?

November 3, 2015

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.

February 10, 2016

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

November 4, 2015

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

nice

November 11, 2015

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

Love it, thanks!!

November 23, 2015

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

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

January 11, 2016

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

Nevermind, I got it to work! :D

January 11, 2016

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

Well then, can you tell me how to?

November 20, 2018

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

July 5, 2016

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

Thank you very much!!

August 4, 2016

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!

August 4, 2016

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?

December 8, 2016

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

It's not working in Turkey :( I think, it's because imgur is banned in our country :/

August 3, 2017

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

Does this still work? I am using Chrome

May 22, 2018

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

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

Not work with Firefox Quantum.

August 15, 2018
Learn a language in just 5 minutes a day. For free.