From d62e2f7e0ed83b22e81b256269c713ad48e33073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Fri, 10 Feb 2023 00:34:47 +0100 Subject: [PATCH] i18n: full support for RTL #470 --- README.md | 2 +- exampleSite/content/_index.en.md | 2 +- .../content/basics/migration/_index.en.md | 2 +- exampleSite/content/cont/i18n/_index.en.md | 2 +- exampleSite/layouts/partials/toc.html | 2 +- layouts/partials/logo.html | 10 +- layouts/partials/menu.html | 2 +- layouts/partials/stylesheet.html | 12 +- layouts/partials/toc.html | 2 +- static/css/auto-complete.css | 2 +- static/css/format-print.css | 9 +- static/css/ie.css | 226 ++++++++++++++---- static/css/nucleus.css | 2 +- static/css/theme.css | 143 +++++------ static/js/theme.js | 31 ++- 15 files changed, 276 insertions(+), 173 deletions(-) diff --git a/README.md b/README.md index 4c7938d7ab..d9ea573bbb 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The theme is a fork of the great [Learn theme](https://github.com/matcornic/hugo - Support for GFM (GitHub Flavored Markdown) - Print whole chapters or even the complete site - Multilingual mode for English, Arabic, Simplified Chinese, Traditional Chinese, Czech, Dutch, Finnish, French, German, Hindi, Indonesian, Italian, Japanese, Korean, Polish, Portuguese, Russian, Spanish, Turkish, Vietnamese -- Support for languages written right to left +- Full support for languages written right to left - Unrestricted menu configuration relating to amount of items and level of nesting - Font Awesome icons - Tagging support diff --git a/exampleSite/content/_index.en.md b/exampleSite/content/_index.en.md index 8d40211c22..df367649f5 100644 --- a/exampleSite/content/_index.en.md +++ b/exampleSite/content/_index.en.md @@ -26,7 +26,7 @@ See [What's New]({{% relref "basics/migration" %}}) within the latest update. - [Support for GFM]({{% relref "cont/markdown" %}}) (GitHub Flavored Markdown) - [Print]({{%relref "basics/configuration#activate-print-support" %}}) whole chapters or even the complete site - [Multilingual mode]({{%relref "cont/i18n" %}}) for English, Arabic, Simplified Chinese, Traditional Chinese, Czech, Dutch, Finnish, French, German, Hindi, Indonesian, Italian, Japanese, Korean, Polish, Portuguese, Russian, Spanish, Turkish, Vietnamese -- Support for languages written right to left +- Full support for languages written right to left - [Unrestricted menu configuration]({{%relref "cont/menushortcuts" %}}) relating to amount of items and level of nesting - [Font Awesome icons]({{%relref "shortcodes/icon" %}}) - [Tagging support]({{%relref "cont/tags" %}}) diff --git a/exampleSite/content/basics/migration/_index.en.md b/exampleSite/content/basics/migration/_index.en.md index 26b8b6ed91..337b5bdb50 100644 --- a/exampleSite/content/basics/migration/_index.en.md +++ b/exampleSite/content/basics/migration/_index.en.md @@ -20,7 +20,7 @@ This document shows you what's new in the latest release. For a detailed list of ## 5.12.0 (not yet released) -- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} Support for languages that are written right to left (like Arabic) is expanded to the top navigation bar. This feature is not available in Internet Explorer 11. +- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} Support for languages that are written right to left (like Arabic) is now complete and extended to the menu, the top navigation bar and print. This feature is not available in Internet Explorer 11. --- diff --git a/exampleSite/content/cont/i18n/_index.en.md b/exampleSite/content/cont/i18n/_index.en.md index 2d51a528b3..71a65608e1 100644 --- a/exampleSite/content/cont/i18n/_index.en.md +++ b/exampleSite/content/cont/i18n/_index.en.md @@ -8,7 +8,7 @@ The Relearn theme is fully compatible with Hugo multilingual mode. It provides: - Translation strings for default values (English, Arabic, Simplified Chinese, Traditional Chinese, Czech, Dutch, Finnish French, German, Hindi, Indonesian, Italian, Japanese, Korean, Polish, Portuguese, Russian, Spanish, Turkish, Vietnamese). Feel free to contribute! -- Support for languages written right to left +- Full support for languages written right to left - Automatic menu generation from multilingual content - In-browser language switching diff --git a/exampleSite/layouts/partials/toc.html b/exampleSite/layouts/partials/toc.html index f94c0569d5..ced4b58a63 100644 --- a/exampleSite/layouts/partials/toc.html +++ b/exampleSite/layouts/partials/toc.html @@ -1,5 +1,5 @@
-
+
{{- partial "shortcodes/piratify.html" (dict "context" . "pagefield" "TableOfContents" diff --git a/layouts/partials/logo.html b/layouts/partials/logo.html index 266b4250d8..5a7c7b8260 100644 --- a/layouts/partials/logo.html +++ b/layouts/partials/logo.html @@ -25,7 +25,7 @@ } #logo svg { margin-bottom: -20px; - margin-left: -23.5px; + margin-inline-start: -23.5px; width: 40.5%; } @media only all and (max-width: 59.938em) { @@ -35,7 +35,7 @@ } #logo svg { margin-bottom: -12px; - margin-left: -23px; + margin-inline-start: -23px; } } @media all and (-ms-high-contrast:none) { @@ -45,6 +45,12 @@ } #logo svg { margin-bottom: -62px; + margin-left: -23.5px; + } + } + @media only all and (-ms-high-contrast:none) and (max-width: 59.938em) { + #logo svg { + margin-left: -23px; } } diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html index c2129fa3a9..73fddd0bdf 100644 --- a/layouts/partials/menu.html +++ b/layouts/partials/menu.html @@ -6,7 +6,7 @@ {{- if ne $outputFormat "html" }} {{- $basename = partial "BaseName.hugo" $format.RelPermalink }} {{- end }} -