diff --git a/README.md b/README.md index 62d6126e..dadb5756 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,7 @@ LoveIt supports the following languages: * Italian * Spanish * German +* Serbian * [Contribute with a new language](https://github.com/dillonzq/LoveIt/pulls) [Languages Compatibility](https://hugoloveit.com/theme-documentation-basics/#language-compatibility) diff --git a/README.zh-cn.md b/README.zh-cn.md index fb5ddc7f..d68d0b71 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -129,6 +129,7 @@ LoveIt 支持下列语言: * 意大利语 * 西班牙语 * 德语 +* 塞尔维亚语 * [贡献一种新的语言](https://github.com/dillonzq/LoveIt/pulls) [语言兼容性](https://hugoloveit.com/zh-cn/theme-documentation-basics/#language-compatibility) diff --git a/exampleSite/content/posts/theme-documentation-basics.en.md b/exampleSite/content/posts/theme-documentation-basics.en.md index 37929f61..32671d55 100644 --- a/exampleSite/content/posts/theme-documentation-basics.en.md +++ b/exampleSite/content/posts/theme-documentation-basics.en.md @@ -854,6 +854,8 @@ In `config/css/_custom.scss`, you can add some css style code to customize the s | Italian | `it` | `it` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | Spanish | `es` | `es` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | German | `de` | `de` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | +| German | `de` | `de` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | +| Serbian | `sr` | `sr` | :(far fa-square fa-fw): | :(far fa-square fa-fw): | ### 4.2 Basic Configuration diff --git a/exampleSite/content/posts/theme-documentation-basics.fr.md b/exampleSite/content/posts/theme-documentation-basics.fr.md index f7b79d9e..d7494628 100644 --- a/exampleSite/content/posts/theme-documentation-basics.fr.md +++ b/exampleSite/content/posts/theme-documentation-basics.fr.md @@ -859,6 +859,7 @@ In `config/css/_custom.scss`, you can add some css style code to customize the s | Italian | `it` | `it` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | Spanish | `es` | `es` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | German | `de` | `de` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | +| Serbian | `sr` | `sr` | :(far fa-square fa-fw): | :(far fa-square fa-fw): | ### 4.2 Basic Configuration diff --git a/exampleSite/content/posts/theme-documentation-basics.zh-cn.md b/exampleSite/content/posts/theme-documentation-basics.zh-cn.md index 30ce445f..aec55c4a 100644 --- a/exampleSite/content/posts/theme-documentation-basics.zh-cn.md +++ b/exampleSite/content/posts/theme-documentation-basics.zh-cn.md @@ -862,6 +862,7 @@ $code-font-family: Fira Mono, Source Code Pro, Menlo, Consolas, Monaco, monospac | 意大利语 | `it` | `it` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | 西班牙语 | `es` | `es` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | | 德语 | `de` | `de` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): | +| 塞尔维亚语 | `pl` | `pl` | :(far fa-square fa-fw): | :(far fa-square fa-fw): | ### 4.2 基本配置 diff --git a/i18n/de.toml b/i18n/de.toml index 11be58ce..5cf537e5 100644 --- a/i18n/de.toml +++ b/i18n/de.toml @@ -80,12 +80,12 @@ other = "Abbrechen" [noResultsFound] other = "Keine Ergebnisse gefunden" -[lunrLanguageLib] -other = "lib/lunr/lunr.de.js" - [lunrLanguageCode] other = "de" +[lunrLanguageLib] +other = "lib/lunr/lunr.de.js" + [copyToClipboard] other = "In Zwischenablage kopieren" # === partials/assets.html === diff --git a/i18n/en.toml b/i18n/en.toml index ad5e8074..b9f88a87 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -79,6 +79,9 @@ other = "Cancel" [noResultsFound] other = "No results found" +[lunrLanguageCode] +other = "en" + [copyToClipboard] other = "Copy to clipboard" # === partials/assets.html === diff --git a/i18n/es.toml b/i18n/es.toml index f40889cb..64e3dbc5 100644 --- a/i18n/es.toml +++ b/i18n/es.toml @@ -80,12 +80,12 @@ other = "Cancelar" [noResultsFound] other = "No se encontraron resultados" -[lunrLanguageLib] -other = "lib/lunr/lunr.es.js" - [lunrLanguageCode] other = "es" +[lunrLanguageLib] +other = "lib/lunr/lunr.es.js" + [copyToClipboard] other = "Copiar al portapapeles" # === partials/assets.html === diff --git a/i18n/fr.toml b/i18n/fr.toml index 56085cdb..300c72b5 100644 --- a/i18n/fr.toml +++ b/i18n/fr.toml @@ -80,12 +80,12 @@ other = "Annuler" [noResultsFound] other = "Aucun résultat trouvé" -[lunrLanguageLib] -other = "lib/lunr/lunr.fr.js" - [lunrLanguageCode] other = "fr" +[lunrLanguageLib] +other = "lib/lunr/lunr.fr.js" + [copyToClipboard] other = "Copier dans le presse-papiers" # === partials/assets.html === diff --git a/i18n/it.toml b/i18n/it.toml index e37633b0..4d79ab47 100644 --- a/i18n/it.toml +++ b/i18n/it.toml @@ -80,12 +80,12 @@ other = "Annulla" [noResultsFound] other = "Nessun risultato trovato" -[lunrLanguageLib] -other = "lib/lunr/lunr.it.js" - [lunrLanguageCode] other = "it" +[lunrLanguageLib] +other = "lib/lunr/lunr.it.js" + [copyToClipboard] other = "Copia negli appunti" # === partials/assets.html === diff --git a/i18n/pl.toml b/i18n/pl.toml index a487d1e0..92cf05ed 100644 --- a/i18n/pl.toml +++ b/i18n/pl.toml @@ -80,9 +80,6 @@ other = "Anuluj" [noResultsFound] other = "Nie znaleziono wyników" -[lunrLanguageLib] -other = "lib/lunr/lunr.pl.js" - [lunrLanguageCode] other = "pl" diff --git a/i18n/pt-BR.toml b/i18n/pt-BR.toml index 2931cc98..6c9856ec 100644 --- a/i18n/pt-BR.toml +++ b/i18n/pt-BR.toml @@ -80,12 +80,12 @@ other = "Cancelar" [noResultsFound] other = "Nenhum resultado encontrado" -[lunrLanguageLib] -other = "lib/lunr/lunr.pt.js" - [lunrLanguageCode] other = "pt" +[lunrLanguageLib] +other = "lib/lunr/lunr.pt.js" + [copyToClipboard] other = "Copiar para a área de transferência" # === partials/assets.html === diff --git a/i18n/sr.toml b/i18n/sr.toml new file mode 100644 index 00000000..118f32cb --- /dev/null +++ b/i18n/sr.toml @@ -0,0 +1,191 @@ +# Translations for Serbian +# Превод на Српски +# https://gohugo.io/content-management/multilingual/#translation-of-strings + +# === baseof == +[backToTop] +other = "Назад на Врх" + +[viewComments] +other = "Погледај Коментаре" +# === baseof == + +# === Post === +[posts] +other = "Постови" +# === Post === + +# === Taxonomy === +[allSome] +other = "Све %s" + +[tag] +other = "Таг" + +[tags] +other = "Тагови" + +[category] +other = "Категорија" + +[categories] +other = "Категорије" +# === Taxonomy === + +# === Pagination === +[more] +other = "Више" +# === Pagination === + +# === partials/header.html === +[selectLanguage] +other = "Изабери Језик" + +[switchTheme] +other = "Промени Тему" +# === partials/header.html === + +# === partials/footer.html === +[poweredBySome] +other = "Покреће %s" + +[theme] +other = "Тема" +# === partials/footer.html === + +# === partials/comment.html === +[valineLang] +other = "sr" + +[valinePlaceholder] +other = "Ваш коментар ..." + +[facebookLanguageCode] +other = "sr_RS" +# === partials/comment.html === + +# === partials/assets.html === +[search] +other = "Претрага" + +[searchPlaceholder] +other = "Претражи наслове или садржај..." + +[clear] +other = "Очисти" + +[cancel] +other = "Поништи" + +[noResultsFound] +other = "Без резултата" + +[lunrLanguageCode] +other = "sr" + +[copyToClipboard] +other = "Копирај на радну таблу" +# === partials/assets.html === + +# === partials/plugin/share.html === +[shareOn] +other = "Подели на" +# === partials/plugin/share.html === + +# === posts/single.html === +[contents] +other = "Садржаји" + +[publish] +other = "објављено" + +[included] +other = "укључено" + +[wordCount] +other = "око {{ .Count }} речи" + +[readingTime] +other = "{{ .Count }} мин" + +[views] +other = "прегледа" + +[author] +other = "Аутор" + +[lastMod] +other = "Чланак је обновљен %s" + +[license] +other = "Објављено под условима %s лиценце" + +[seeMarkdown] +other = "Читај Markdown" + +[back] +other = "Назад" + +[home] +other = "Почетна" + +[readMore] +other = "Прочитај више" +# === posts/single.html === + +# === 404.html === +[pageNotFound] +other = "Страница није пронађена" + +[pageNotFoundText] +other = "Страница коју тражите не постоји. Жао нам је." +# === 404.html === + +# === shortcodes/admonition.html === +[note] +other = "Напомена" + +[abstract] +other = "Сажетак" + +[info] +other = "Инфо" + +[tip] +other = "Савет" + +[success] +other = "Успех" + +[question] +other = "Питање" + +[warning] +other = "Упозорење" + +[failure] +other = "Неуспех" + +[danger] +other = "Опасност" + +[bug] +other = "Грешка" + +[example] +other = "Пример" + +[quote] +other = "Цитат" +# === shortcodes/admonition.html === + +# === shortcodes/version.html === +[new] +other = "НОВО" + +[changed] +other = "ПРОМЕЊЕНО" + +[deleted] +other = "ОБРИСАНО" +# === shortcodes/version.html === diff --git a/i18n/zh-CN.toml b/i18n/zh-CN.toml index cd7521cf..67f19da8 100644 --- a/i18n/zh-CN.toml +++ b/i18n/zh-CN.toml @@ -80,11 +80,14 @@ other = "取消" [noResultsFound] other = "没有找到结果" +[lunrLanguageCode] +other = "zh" + [lunrLanguageLib] other = "lib/lunr/lunr.zh.js" -[lunrLanguageCode] -other = "zh" +[lunrSegmentitLib] +other = "lib/lunr/lunr.segmentit.js" [copyToClipboard] other = "复制到剪贴板" diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index cad8f1fe..edb52c8b 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -19,10 +19,10 @@ {{- end -}} {{- $source := $cdn.lunrJS | default "lib/lunr/lunr.min.js" -}} {{- dict "source" $source "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}} - {{- if ne .Language.Lang "en" -}} + {{- if T "lunrLanguageLib" -}} {{- $config = T "lunrLanguageCode" | dict "lunrLanguageCode" | dict "search" | merge $config -}} - {{- if eq .Language.Lang "zh-cn" -}} - {{- $config = dict "lunrSegmentitURL" (resources.Get "lib/lunr/lunr.segmentit.js").RelPermalink | dict "search" | merge $config -}} + {{- with T "lunrSegmentitLib" -}} + {{- $config = dict "lunrSegmentitURL" (resources.Get .).RelPermalink | dict "search" | merge $config -}} {{- end -}} {{- dict "source" "lib/lunr/lunr.stemmer.support.js" "minify" true "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}} {{- dict "source" (T "lunrLanguageLib") "minify" true "fingerprint" $fingerprint | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}