Skip to content

Commit

Permalink
Replace country flags with single language icon (jdm-contrib#943)
Browse files Browse the repository at this point in the history
  • Loading branch information
Foggalong authored Nov 1, 2021
1 parent cce96d8 commit a1b6b8c
Show file tree
Hide file tree
Showing 55 changed files with 15 additions and 63 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.svg]
indent_size = 1

[*.yml]
indent_size = 2

Expand Down
3 changes: 0 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,3 @@ Look for the `CODE.json` file in the `_data/trans/` directory where `CODE` is yo
2. Copy the contents of `en.json` to your new file
3. Translate each line
4. Within the `_pages/` directory, copy `_pages/index.html` to a new `CODE.html` file, and update the `lang: CODE` line to match the new page's code
5. Visit [gosquared/flags](https://github.com/gosquared/flags/tree/master/flags/flags-iso/shiny) and get the shiny 16px and 24px flags for your language.
6. Save the flag icons onto `assets/icons` as `CODE16.png` and `CODE24.png`, where `CODE` is your short country code.
7. On `assets/css/style.css` insert a `dropdown` and a `background-image` that reference these flags.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ Project licensed under the [MIT License](LICENSE) (MIT). This is a detached
fork of the [original repo](https://github.com/justdeleteme/justdelete.me)
that intends to keep the project alive, as the original one was abandoned.

Flags modified from [gosquared/flags](https://github.com/gosquared/flags),
MIT licensed, Copyright (c) 2017 Go Squared Ltd.
Language icon from [Font Awesome](https://github.com/FortAwesome/Font-Awesome)
released under the [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/)
license. Minor alignment changes made to optimize for the display size.

Search functionality modified from [DevCenter.me](https://github.com/stevestreza/DevCenter.me),
MIT licensed, Copyright (c) 2013 Steve Streza.
2 changes: 1 addition & 1 deletion _includes/body.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ <h2>{{ site.data.trans[page.lang].extensionguide|safe }}</h2>
</div>

<!-- Language dropdown -->
<div id="language-dropdown" class="dropdown dropdown-tip has-icons">
<div id="language-dropdown" class="dropdown dropdown-tip">
<ul class="dropdown-menu">
{% assign sorted_files = (site.data.trans | sort:0) %}
{% for lang in sorted_files %}
Expand Down
6 changes: 3 additions & 3 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
<body lang="{{ page.lang }}"{% if rtl %} dir="rtl"{% endif %}>

<nav>
<!-- begin language switcher -->
<span class="language-switch" href="#" data-dropdown="#language-dropdown" id="{{ page.lang }}">{{ site.data.trans[page.lang].name }}</span>
<!-- end language switcher -->
<a class="language-switch" href="#" data-dropdown="#language-dropdown">
<img class="icon" src="{{ site.baseurl }}/assets/icons/language.svg" alt="A|文"/>
</a>
<a href="#about" class="info">{{ site.data.trans.[page.lang].about }}</a>
</nav>

Expand Down
56 changes: 2 additions & 54 deletions assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,61 +34,9 @@ nav {
}

.language-switch {
background-position: left center;
background-repeat: no-repeat;
cursor: pointer;
padding: 8px 10px 8px 29px;
}

.dropdown .ar a, .ar a { background-image: url(../icons/flags/ar16.png); }
.dropdown .cat a, .cat a { background-image: url(../icons/flags/cat16.png); }
.dropdown .cz a, .cz a { background-image: url(../icons/flags/cz16.png); }
.dropdown .de a, .de a { background-image: url(../icons/flags/de16.png); }
.dropdown .en a, .en a { background-image: url(../icons/flags/en16.png); }
.dropdown .es a, .es a { background-image: url(../icons/flags/es16.png); }
.dropdown .fa a, .fa a { background-image: url(../icons/flags/fa16.png); }
.dropdown .fr a, .fr a { background-image: url(../icons/flags/fr16.png); }
.dropdown .gr a, .gr a { background-image: url(../icons/flags/gr16.png); }
.dropdown .id a, .id a { background-image: url(../icons/flags/id16.png); }
.dropdown .it a, .it a { background-image: url(../icons/flags/it16.png); }
.dropdown .kr a, .kr a { background-image: url(../icons/flags/kr16.png); }
.dropdown .nl a, .nl a { background-image: url(../icons/flags/nl16.png); }
.dropdown .pl a, .pl a { background-image: url(../icons/flags/pl16.png); }
.dropdown .pt_br a, .pt_br a { background-image: url(../icons/flags/pt_br16.png); }
.dropdown .ro a, .ro a { background-image: url(../icons/flags/ro16.png); }
.dropdown .ru a, .ru a { background-image: url(../icons/flags/ru16.png); }
.dropdown .sk a, .sk a { background-image: url(../icons/flags/sk16.png); }
.dropdown .sr a, .sr a { background-image: url(../icons/flags/sr16.png); }
.dropdown .th a, .th a { background-image: url(../icons/flags/th16.png); }
.dropdown .tr a, .tr a { background-image: url(../icons/flags/tr16.png); }
.dropdown .vi a, .vi a { background-image: url(../icons/flags/vi16.png); }
.dropdown .zh-cn a, .zh-cn a { background-image: url(../icons/flags/cn16.png); }
.dropdown .zh-tw a, .zh-tw a { background-image: url(../icons/flags/tw16.png); }

#ar { background-image: url(../icons/flags/ar24.png); }
#cat { background-image: url(../icons/flags/cat24.png); }
#cz { background-image: url(../icons/flags/cz24.png); }
#de { background-image: url(../icons/flags/de24.png); }
#en { background-image: url(../icons/flags/en24.png); }
#es { background-image: url(../icons/flags/es24.png); }
#fa { background-image: url(../icons/flags/fa24.png); }
#fr { background-image: url(../icons/flags/fr24.png); }
#gr { background-image: url(../icons/flags/gr24.png); }
#id { background-image: url(../icons/flags/id24.png); }
#it { background-image: url(../icons/flags/it24.png); }
#kr { background-image: url(../icons/flags/kr24.png); }
#nl { background-image: url(../icons/flags/nl24.png); }
#pl { background-image: url(../icons/flags/pl24.png); }
#pt_br { background-image: url(../icons/flags/pt_br24.png); }
#ro { background-image: url(../icons/flags/ro24.png); }
#ru { background-image: url(../icons/flags/ru24.png); }
#sk { background-image: url(../icons/flags/sk24.png); }
#sr { background-image: url(../icons/flags/sr24.png); }
#th { background-image: url(../icons/flags/th24.png); }
#tr { background-image: url(../icons/flags/tr24.png); }
#vi { background-image: url(../icons/flags/vi24.png); }
#zh-cn { background-image: url(../icons/flags/cn24.png); }
#zh-tw { background-image: url(../icons/flags/tw24.png); }
padding: 12px 10px 8px 12px;
}

nav a {
color: black;
Expand Down
Binary file removed assets/icons/flags/ar16.png
Binary file not shown.
Binary file removed assets/icons/flags/ar24.png
Binary file not shown.
Binary file removed assets/icons/flags/cat16.png
Binary file not shown.
Binary file removed assets/icons/flags/cat24.png
Binary file not shown.
Binary file removed assets/icons/flags/cn16.png
Binary file not shown.
Binary file removed assets/icons/flags/cn24.png
Binary file not shown.
Binary file removed assets/icons/flags/cz16.png
Binary file not shown.
Binary file removed assets/icons/flags/cz24.png
Binary file not shown.
Binary file removed assets/icons/flags/de16.png
Binary file not shown.
Binary file removed assets/icons/flags/de24.png
Binary file not shown.
Binary file removed assets/icons/flags/en16.png
Binary file not shown.
Binary file removed assets/icons/flags/en24.png
Binary file not shown.
Binary file removed assets/icons/flags/es16.png
Binary file not shown.
Binary file removed assets/icons/flags/es24.png
Binary file not shown.
Binary file removed assets/icons/flags/fa16.png
Binary file not shown.
Binary file removed assets/icons/flags/fa24.png
Binary file not shown.
Binary file removed assets/icons/flags/fr16.png
Binary file not shown.
Binary file removed assets/icons/flags/fr24.png
Binary file not shown.
Binary file removed assets/icons/flags/gr16.png
Binary file not shown.
Binary file removed assets/icons/flags/gr24.png
Binary file not shown.
Binary file removed assets/icons/flags/id16.png
Binary file not shown.
Binary file removed assets/icons/flags/id24.png
Binary file not shown.
Binary file removed assets/icons/flags/it16.png
Binary file not shown.
Binary file removed assets/icons/flags/it24.png
Binary file not shown.
Binary file removed assets/icons/flags/kr16.png
Binary file not shown.
Binary file removed assets/icons/flags/kr24.png
Diff not rendered.
Binary file removed assets/icons/flags/nl16.png
Diff not rendered.
Binary file removed assets/icons/flags/nl24.png
Diff not rendered.
Binary file removed assets/icons/flags/pl16.png
Diff not rendered.
Binary file removed assets/icons/flags/pl24.png
Diff not rendered.
Binary file removed assets/icons/flags/pt_br16.png
Diff not rendered.
Binary file removed assets/icons/flags/pt_br24.png
Diff not rendered.
Binary file removed assets/icons/flags/ro16.png
Diff not rendered.
Binary file removed assets/icons/flags/ro24.png
Diff not rendered.
Binary file removed assets/icons/flags/ru16.png
Diff not rendered.
Binary file removed assets/icons/flags/ru24.png
Diff not rendered.
Binary file removed assets/icons/flags/sk16.png
Diff not rendered.
Binary file removed assets/icons/flags/sk24.png
Diff not rendered.
Binary file removed assets/icons/flags/sr16.png
Diff not rendered.
Binary file removed assets/icons/flags/sr24.png
Diff not rendered.
Binary file removed assets/icons/flags/th16.png
Diff not rendered.
Binary file removed assets/icons/flags/th24.png
Diff not rendered.
Binary file removed assets/icons/flags/tr16.png
Diff not rendered.
Binary file removed assets/icons/flags/tr24.png
Diff not rendered.
Binary file removed assets/icons/flags/tw16.png
Diff not rendered.
Binary file removed assets/icons/flags/tw24.png
Diff not rendered.
Binary file removed assets/icons/flags/vi16.png
Diff not rendered.
Binary file removed assets/icons/flags/vi24.png
Diff not rendered.
3 changes: 3 additions & 0 deletions assets/icons/language.svg

0 comments on commit a1b6b8c

Please sign in to comment.