Welcome Guest ( Log In | Register )

2 Pages V  1 2 >  
Reply to this topicStart new topic
> [Script] Language flag near gallery name

 
post Apr 20 2017, 02:27
Post #1
Extiandr



Newcomer
**
Group: Members
Posts: 55
Joined: 23-July 15
Level 365 (Dovahkiin)


Well, topic name says what this script does.

Shows a nice little flag, based on gallery language. (gets language from API call)
I included almost every language there is in ehwiki:languages section.

Can be helpful if you are too lazy to read the gallery language, or if it can't be seen entirely like in thumbs view mode.

Minimal view:
(IMG:[i.imgur.com] https://i.imgur.com/Z9wt4OH.png)

Thumbs view:
(IMG:[i.imgur.com] https://i.imgur.com/BpI4aRF.png)

Script: Attached File  ehlangflags.js.txt ( 14.94k ) Number of downloads: 6489


Hope this helps at least someone.

This post has been edited by Extiandr: Apr 3 2019, 14:14
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Apr 20 2017, 04:51
Post #2
blue penguin



in umbra, igitur, pugnabimus
***********
Group: Gold Star Club
Posts: 10,046
Joined: 24-March 12
Level 500 (Godslayer)


Added to the script index

If I may, you could use API to retrieve the tags and use that as an indicator. May be better than the title because titles can contain anything. From a quick search I found a shitty gallery names hiloday in spain, it could be named "Spanish holiday" instead (and am sure we have some galleries like that) and that would screw the search method of the script.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Apr 20 2017, 14:27
Post #3
Extiandr



Newcomer
**
Group: Members
Posts: 55
Joined: 23-July 15
Level 365 (Dovahkiin)


Thanks for the suggestion!

I changed the script.

Looks like it works fine:
(IMG:[savepic.org] http://savepic.org/8569522.png)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Apr 20 2017, 15:19
Post #4
@43883




************
Group: Gold Star Club
Posts: 31,482
Joined: 6-March 08
Level 500 (Newbie)


I was about to point out something about mobile phone era Unicode cross-browser implementation then noticed how you coded in the flags - and that's just the right way.

Good job! :)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Apr 20 2017, 15:42
Post #5
blue penguin



in umbra, igitur, pugnabimus
***********
Group: Gold Star Club
Posts: 10,046
Joined: 24-March 12
Level 500 (Godslayer)


Cool beans. 'tis a pretty decent script (IMG:[invalid] style_emoticons/default/smile.gif)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Apr 20 2017, 16:52
Post #6
hzqr



Savagely Still
********
Group: Gold Star Club
Posts: 4,672
Joined: 13-May 09
Level 462 (Dovahkiin)


If it helps, I have a ready-to-use flag stylesheet that supports all the languages supported by the EH API (I use it for another script)

[gist.github.com] 16x12 version

It should significantly reduce the size of your script (by around 40%-50%) if you somehow manage to integrate it

Example usage (US flag):
CODE
<div class="en flag">

France flag:
CODE
<div class="fr flag">


...and so on.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Apr 20 2017, 17:16
Post #7
@43883




************
Group: Gold Star Club
Posts: 31,482
Joined: 6-March 08
Level 500 (Newbie)


^ tiap's way is another good approach. That's overkill but there's also a combined flag stylesheet that includes all existing countries so your script becomes futureproof (unless NK decides to nuke all countries). :lol:

EDIT: [www.flag-sprites.com] https://www.flag-sprites.com/

This post has been edited by Luna_Flina: Apr 20 2017, 17:35
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Apr 20 2017, 17:30
Post #8
Extiandr



Newcomer
**
Group: Members
Posts: 55
Joined: 23-July 15
Level 365 (Dovahkiin)


From what i can see these are not all the languages EH has.
Even my script has more flags.
Are you sure?
I can combine my flags into 1 stylesheet too, if required.

This post has been edited by Extiandr: Apr 20 2017, 17:31
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Apr 20 2017, 17:39
Post #9
hzqr



Savagely Still
********
Group: Gold Star Club
Posts: 4,672
Joined: 13-May 09
Level 462 (Dovahkiin)


Yeah my bad, worded it wrong. Meant to say they're all the languages you can find in the Settings page, under "Excluded Languages". They're most likely not all the languages you can find in the "language:" namespace (haven't checked but there are probably a gorillion)
The script is fine as is, just thought I'd share the stylesheet thingamagic in case it could be useful
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Apr 20 2017, 18:39
Post #10
@43883




************
Group: Gold Star Club
Posts: 31,482
Joined: 6-March 08
Level 500 (Newbie)


QUOTE
language:arabic
language:catalan
language:chinese
language:czech
language:danish
language:dutch
language:english
language:finnish
language:french
language:german
language:greek
language:hindi
language:hungarian
language:indonesian
language:italian
language:japanese
language:korean
language:mongolian
language:norwegian
language:polish
language:portuguese
language:romanian
language:russian
language:spanish
language:swahili
language:swedish
language:tagalog
language:thai
language:turkish
language:vietnamese
Non-exhaustive, but that should be most of them. Added a bunch that don't have slaves. (The complete list with slaves can be found here as usual.)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Apr 20 2017, 20:05
Post #11
Extiandr



Newcomer
**
Group: Members
Posts: 55
Joined: 23-July 15
Level 365 (Dovahkiin)


I made one stylesheet and added 2 or 3 new flags, and script reduced its size around 2k.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Apr 21 2017, 21:36
Post #12
malikski



Newcomer
*
Group: Recruits
Posts: 14
Joined: 30-June 14


I honestly think a language flag is appropriate for all practical purposes.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Apr 24 2017, 01:08
Post #13
Extiandr



Newcomer
**
Group: Members
Posts: 55
Joined: 23-July 15
Level 365 (Dovahkiin)


Huge fix - now script can get info about > 25 galleries.
Should now work fine in favorites, and in thumb view on main page.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Mar 19 2019, 22:40
Post #14
svines85



doesn't care unless provoked
***********
Group: Gold Star Club
Posts: 19,369
Joined: 8-May 12
Level 170 (Lord)


The update to the gallery system seems to have made this script quit working......very sad, I love this script........anybody have any idea how to fix it?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Mar 20 2019, 06:10
Post #15
pwnmastr



Newcomer
**
Group: Members
Posts: 54
Joined: 5-December 12
Level 288 (Godslayer)


Figures I'd install this two days ago and now its broken, lol
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Mar 20 2019, 07:24
Post #16
Taylia



Newcomer
*
Group: Gold Star Club
Posts: 35
Joined: 8-March 16
Level 268 (Lord)


Try this?

Attached File  eh_flags.user.js.txt ( 14.41k ) Number of downloads: 1832


If it doesn't work, please PM me and let me know what browser & version you're using. I wrote it for current versions (and it won't work on Firefox <62 because I didn't think Array.flat() was that recent).

It's easy to fix for earlier versions if someone needs it (IMG:[invalid] style_emoticons/default/smile.gif)

This post has been edited by Taylia: Mar 20 2019, 07:26
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Mar 20 2019, 17:56
Post #17
Extiandr



Newcomer
**
Group: Members
Posts: 55
Joined: 23-July 15
Level 365 (Dovahkiin)


Updated the script and the screenshots.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Mar 20 2019, 20:05
Post #18
svines85



doesn't care unless provoked
***********
Group: Gold Star Club
Posts: 19,369
Joined: 8-May 12
Level 170 (Lord)


QUOTE(Extiandr @ Mar 20 2019, 10:56) *

Updated the script and the screenshots.

Outstanding, really appreciate it (IMG:[invalid] style_emoticons/default/smile.gif)

And yeah, a great script........I guess we're all different on how and what we browse, but I really found out yesterday how much I'd come to rely on this (IMG:[invalid] style_emoticons/default/biggrin.gif)
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Apr 3 2019, 14:15
Post #19
Extiandr



Newcomer
**
Group: Members
Posts: 55
Joined: 23-July 15
Level 365 (Dovahkiin)


Fixed it, again. Tenboro likes to break stuff with new design, apparently.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Apr 4 2019, 02:19
Post #20
mecal



Newcomer
*
Group: Recruits
Posts: 11
Joined: 26-June 14
Level 26 (Apprentice)


NICE WORK, THANKS FOR SHARING.
and would you like to post it on [sleazyfork.org] https://sleazyfork.org/
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


2 Pages V  1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 


Lo-Fi Version Time is now: 30th March 2025 - 22:51