mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-02-02 03:22:33 -06:00
Merge pull request #543 from nunocoracao/542-better-language-switcher
🎏 add new language selector
This commit is contained in:
commit
8f13df122e
26 changed files with 3999 additions and 3137 deletions
File diff suppressed because it is too large
Load diff
1
assets/icons/globe.svg
Normal file
1
assets/icons/globe.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M266.3 48.3L232.5 73.6c-5.4 4-8.5 10.4-8.5 17.1v9.1c0 6.8 5.5 12.3 12.3 12.3c2.4 0 4.8-.7 6.8-2.1l41.8-27.9c2-1.3 4.4-2.1 6.8-2.1h1c6.2 0 11.3 5.1 11.3 11.3c0 3-1.2 5.9-3.3 8l-19.9 19.9c-5.8 5.8-12.9 10.2-20.7 12.8l-26.5 8.8c-5.8 1.9-9.6 7.3-9.6 13.4c0 3.7-1.5 7.3-4.1 10l-17.9 17.9c-6.4 6.4-9.9 15-9.9 24v4.3c0 16.4 13.6 29.7 29.9 29.7c11 0 21.2-6.2 26.1-16l4-8.1c2.4-4.8 7.4-7.9 12.8-7.9c4.5 0 8.7 2.1 11.4 5.7l16.3 21.7c2.1 2.9 5.5 4.5 9.1 4.5c8.4 0 13.9-8.9 10.1-16.4l-1.1-2.3c-3.5-7 0-15.5 7.5-18l21.2-7.1c7.6-2.5 12.7-9.6 12.7-17.6c0-10.3 8.3-18.6 18.6-18.6H400c8.8 0 16 7.2 16 16s-7.2 16-16 16H379.3c-7.2 0-14.2 2.9-19.3 8l-4.7 4.7c-2.1 2.1-3.3 5-3.3 8c0 6.2 5.1 11.3 11.3 11.3h11.3c6 0 11.8 2.4 16 6.6l6.5 6.5c1.8 1.8 2.8 4.3 2.8 6.8s-1 5-2.8 6.8l-7.5 7.5C386 262 384 266.9 384 272s2 10 5.7 13.7L408 304c10.2 10.2 24.1 16 38.6 16H454c6.5-20.2 10-41.7 10-64c0-111.4-87.6-202.4-197.7-207.7zm172 307.9c-3.7-2.6-8.2-4.1-13-4.1c-6 0-11.8-2.4-16-6.6L396 332c-7.7-7.7-18-12-28.9-12c-9.7 0-19.2-3.5-26.6-9.8L314 287.4c-11.6-9.9-26.4-15.4-41.6-15.4H251.4c-12.6 0-25 3.7-35.5 10.7L188.5 301c-17.8 11.9-28.5 31.9-28.5 53.3v3.2c0 17 6.7 33.3 18.7 45.3l16 16c8.5 8.5 20 13.3 32 13.3H248c13.3 0 24 10.7 24 24c0 2.5 .4 5 1.1 7.3c71.3-5.8 132.5-47.6 165.2-107.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM187.3 100.7c-6.2-6.2-16.4-6.2-22.6 0l-32 32c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l32-32c6.2-6.2 6.2-16.4 0-22.6z"/></svg>
|
After Width: | Height: | Size: 1.5 KiB |
|
@ -56,27 +56,30 @@ Blowfish is optimised for full multilingual websites and theme assets are transl
|
|||
The theme currently supports the following languages by default:
|
||||
|
||||
| Language | Code |
|
||||
| ------------------------------------- | ------- |
|
||||
| :gb: English | `en` |
|
||||
| :bangladesh: Bengali | `bn` |
|
||||
| :cn: Simplified Chinese (China) | `zh-cn` |
|
||||
| :taiwan: Traditional Chinese (Taiwan) | `zh-tw` |
|
||||
| :finland: Finnish | `fi` |
|
||||
| :fr: French | `fr` |
|
||||
| :de: German | `de` |
|
||||
| :israel: Hebrew | `he` |
|
||||
| :hungary: Hungarian | `hu` |
|
||||
| :it: Italian | `it` |
|
||||
| :jp: Japanese | `ja` |
|
||||
| :brazil: Portuguese (Brazil) | `pt-br` |
|
||||
| :portugal: Portuguese (Portugal) | `pt-pt` |
|
||||
| :poland: Polish | `pl` |
|
||||
| :romania: Romanian | `ro` |
|
||||
| :es: Spanish (Spain) | `es` |
|
||||
| :tr: Turkish | `tr` |
|
||||
| 🇭🇷 Croatian | `hr` |
|
||||
| 🇮🇩 Indonesian | `id` |
|
||||
| ------------------------------ | ------- |
|
||||
| 🇧🇩 Bengali | `bn` |
|
||||
| 🇨🇿 Czech | `cs` |
|
||||
| 🇩🇪 German | `de` |
|
||||
| 🇬🇧 English | `en` |
|
||||
| 🇪🇸 Spanish (Spain) | `es` |
|
||||
| 🇫🇮 Finnish | `fi` |
|
||||
| 🇫🇷 French | `fr` |
|
||||
| 🇮🇱 Hebrew | `he` |
|
||||
| 🇭🇷 Croatian | `hr` |
|
||||
| 🇭🇺 Hungarian | `hu` |
|
||||
| 🇮🇩 Indonesian | `id` |
|
||||
| 🇮🇹 Italian | `it` |
|
||||
| 🇯🇵 Japanese | `ja` |
|
||||
| 🇵🇱 Polish | `pl` |
|
||||
| 🇧🇷 Portuguese (Brazil) | `pt-br` |
|
||||
| 🇵🇹 Portuguese (Portugal) | `pt-pt` |
|
||||
| 🇷🇴 Romanian | `ro` |
|
||||
| 🇷🇺 Russian | `ru` |
|
||||
| 🇹🇷 Turkish | `tr` |
|
||||
| 🇨🇳 Simplified Chinese (China) | `zh-cn` |
|
||||
| 🇹🇼 Traditional Chinese (Taiwan) | `zh-tw` |
|
||||
|
||||
|
||||
|
||||
The default translations can be overridden by creating a custom file in `i18n/[code].yaml` that contains the translation strings. You can also use this method to add new languages. If you'd like to share a new translation with the community, please [open a pull request](https://github.com/nunocoracao/blowfish/pulls).
|
||||
|
||||
|
@ -177,7 +180,7 @@ Many of the article defaults here can be overridden on a per article basis by sp
|
|||
### Article
|
||||
|
||||
| Name | Default | Description |
|
||||
| ------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| ------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `article.showDate` | `true` | Whether or not article dates are displayed. |
|
||||
| `article.showViews` | `false` | Whether or not article views are displayed. This requires firebase integrations to be enabled, look below. |
|
||||
| `article.showLikes` | `false` | Whether or not article likes are displayed. This requires firebase integrations to be enabled, look below. |
|
||||
|
|
|
@ -46,6 +46,7 @@ The full list of built-in icons and their corresponding names can referenced bel
|
|||
| ghost | {{< icon ghost >}} |
|
||||
| github | {{< icon github >}} |
|
||||
| gitlab | {{< icon gitlab >}} |
|
||||
| globe | {{< icon globe >}} |
|
||||
| goodreads | {{< icon goodreads >}} |
|
||||
| google | {{< icon google >}} |
|
||||
| hackernews | {{< icon hackernews >}} |
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇧🇩"
|
||||
|
||||
article:
|
||||
anchor_label: "Anchor"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇨🇿"
|
||||
|
||||
article:
|
||||
anchor_label: "Kotva"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇩🇪"
|
||||
|
||||
article:
|
||||
anchor_label: "Anker"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇬🇧"
|
||||
|
||||
article:
|
||||
anchor_label: "Anchor"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇪🇸"
|
||||
|
||||
article:
|
||||
anchor_label: "Ancla"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇫🇮"
|
||||
|
||||
article:
|
||||
anchor_label: "Ankkuri"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇫🇷"
|
||||
|
||||
article:
|
||||
anchor_label: "Ancre"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇮🇱"
|
||||
|
||||
article:
|
||||
anchor_label: "עוגן"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇭🇷"
|
||||
|
||||
article:
|
||||
anchor_label: "Sidro"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇭🇺"
|
||||
|
||||
article:
|
||||
anchor_label: "Horgony"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇮🇩"
|
||||
|
||||
article:
|
||||
anchor_label: "Anchor"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇮🇹"
|
||||
|
||||
article:
|
||||
anchor_label: "Ancora"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇯🇵"
|
||||
|
||||
article:
|
||||
anchor_label: "アンカー"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇵🇱"
|
||||
|
||||
article:
|
||||
anchor_label: "Kotwica"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇧🇷"
|
||||
|
||||
article:
|
||||
anchor_label: "Âncora"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇵🇹"
|
||||
|
||||
article:
|
||||
anchor_label: "Anchor"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇷🇴"
|
||||
|
||||
article:
|
||||
anchor_label: "Link"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇷🇺"
|
||||
|
||||
article:
|
||||
anchor_label: "Якорь"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇹🇷"
|
||||
|
||||
article:
|
||||
# anchor_label: "Anchor"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇨🇳"
|
||||
|
||||
article:
|
||||
anchor_label: "锚点"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
global:
|
||||
language: "🇹🇼"
|
||||
|
||||
article:
|
||||
anchor_label: "定位點"
|
||||
date: "{{ .Date }}"
|
||||
|
|
|
@ -1,7 +1,22 @@
|
|||
{{ if .IsTranslated }}
|
||||
<div class="inline">
|
||||
<div>
|
||||
<div class="cursor-pointer flex items-center nested-menu">
|
||||
<a class="text-base font-medium text-gray-500 hover:text-gray-900" title="{{ .Title }}">
|
||||
{{- i18n "global.language" | markdownify | emojify -}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="absolute menuhide">
|
||||
<div class="pt-2 p-5 mt-2 rounded-xl backdrop-blur shadow-2xl">
|
||||
<div class="flex flex-col space-y-3">
|
||||
{{ range .AllTranslations }}
|
||||
<a href="{{ .RelPermalink }}">{{ .Language.Params.displayName | emojify }}</a>
|
||||
<a href="{{ .RelPermalink }}" class="flex items-center">
|
||||
<p class="text-sm font-sm text-gray-500 hover:text-gray-900" title="{{ .Title }}">
|
||||
{{ .Language.Params.displayName | emojify }}
|
||||
</p>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
Loading…
Reference in a new issue