Skip to content

Commit

Permalink
Merge pull request #3095 from polishlang/add/possibility-to-translate…
Browse files Browse the repository at this point in the history
…-sections

Possibility to translate `sections`
  • Loading branch information
zkoppert authored Sep 28, 2023
2 parents 46fb40e + 27d1f24 commit 8fff06c
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions assets/css/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ $marketing-font-path: "/assets/fonts/";
@import "covers.scss";
@import "anchor.scss";
@import "button.scss";
@import "translate.scss";
41 changes: 41 additions & 0 deletions assets/css/translate.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Translation results of " Section x" in articles
// Autor: Olsza
// License: CC-BY-4.0

// Enter the locale code and the translation of "Section" in the language.
// The country code should be the same as the value of the lang attribute in html (use "-" instead of "_")
$section_translation: (
"de": "Abschnitt",
"el": "",
"en": "Section",
"eo": "Sekcio",
"es": "Sección",
"fa": "",
"fr": "Partie",
"hu": "",
"id": "",
"ja": "",
"ko": "섹션",
"ms": "",
"nl": "Sectie",
"pl": "Rozdział",
"pt": "",
"ro": "",
"ru": "",
"ta": "",
"tr": "",
"zh-hant": "章節",
"zh-hans": "章节",
);

@each $locale, $translation in $section_translation {
@if $translation != "" {
html[lang="#{$locale}"] .article-body {
@for $i from 1 through 9 {
h2:nth-of-type(#{$i}):before {
content: "#{$translation} #{$i}";
}
}
}
}
}

1 comment on commit 8fff06c

@Ripern1
Copy link

@Ripern1 Ripern1 commented on 8fff06c Oct 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Please sign in to comment.