-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3095 from polishlang/add/possibility-to-translate…
…-sections Possibility to translate `sections`
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}"; | ||
} | ||
} | ||
} | ||
} | ||
} |
8fff06c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice