From 6f9cf58da18151c03f65622f84a28bc6f26a9aa6 Mon Sep 17 00:00:00 2001 From: Daniel Gray Date: Fri, 7 Jul 2023 08:30:49 +0000 Subject: [PATCH] Enable Russian Translation (#2225) --- config/layouts/custom.yml | 4 +- config/mkdocs-common.yml | 4 + config/mkdocs.ru.yml | 164 +++++++++++++++++++++++++++ netlify.toml | 8 +- static/_redirects | 1 + theme/assets/stylesheets/lang-ru.css | 60 ++++++++++ theme/main.html | 4 + 7 files changed, 241 insertions(+), 4 deletions(-) create mode 100644 config/mkdocs.ru.yml create mode 100644 theme/assets/stylesheets/lang-ru.css diff --git a/config/layouts/custom.yml b/config/layouts/custom.yml index 60eaa80c..9e319c9f 100644 --- a/config/layouts/custom.yml +++ b/config/layouts/custom.yml @@ -25,7 +25,7 @@ definitions: Bagnard {%- elif config.theme.language == "he" -%} Suez One - {%- elif config.theme.language == "zh-Hant" -%} + {%- elif config.theme.language == ("zh-Hant" or "ru") -%} Noto Serif TC {%- else -%} Bagnard @@ -34,7 +34,7 @@ definitions: - &font_family >- {%- if config.theme.language == "he" -%} Suez One - {%- elif config.theme.language == "zh-Hant" -%} + {%- elif config.theme.language == ("zh-Hant" or "ru") -%} Noto Sans TC {%- else -%} Public Sans diff --git a/config/mkdocs-common.yml b/config/mkdocs-common.yml index 8f9573fe..4cadfcd3 100644 --- a/config/mkdocs-common.yml +++ b/config/mkdocs-common.yml @@ -66,6 +66,10 @@ extra: link: /zh-hant/ lang: zh-Hant icon: https://raw.githubusercontent.com/twitter/twemoji/master/assets/svg/1f1ed-1f1f0.svg + - name: Russian + link: /ru/ + lang: ru + icon: https://raw.githubusercontent.com/twitter/twemoji/master/assets/svg/1f1f7-1f1fa.svg repo_url: https://github.com/privacyguides/privacyguides.org repo_name: "" diff --git a/config/mkdocs.ru.yml b/config/mkdocs.ru.yml new file mode 100644 index 00000000..b6f6d78d --- /dev/null +++ b/config/mkdocs.ru.yml @@ -0,0 +1,164 @@ +# Copyright (c) 2022-2023 Jonah Aragon + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +INHERIT: mkdocs-common.yml +docs_dir: '../i18n/ru' +site_url: "https://www.privacyguides.org/ru/" +site_dir: '../site/ru' + +site_name: Privacy Guides +site_description: | + Privacy Guides - это ваш главный ресурс по конфиденциальности и безопасности для защиты себя в Интернете. +copyright: | + Privacy Guides - некоммерческий сайт, предоставляющий информацию по защите безопасности и конфиденциальности ваших данных.
+ Мы не зарабатываем на рекомендациях определенных продуктов и не используем партнерские ссылки.
+ © 2019 - 2023 Privacy Guides и поддерживающие. + + Содержание доступно под лицензией CC BY-ND 4.0. +edit_uri: edit/main/docs/ + +extra: + generator: false + analytics: + provider: plausible + property: privacyguides.org + feedback: + title: "Была ли эта страница полезной?" + ratings: + - icon: material/robot-happy-outline + name: "Эта страница была полезна" + data: Helpful + note: "Спасибо за ваш отзыв!" + - icon: material/robot-confused + name: "Эта страница может быть улучшена" + data: Needs Improvement + note: "Спасибо за ваш отзыв! Помогите нам улучшить эту страницу, открыв обсуждение на нашем форуме." + +extra_css: + - assets/stylesheets/extra.css?v=3.2.0 + - assets/stylesheets/lang-ru.css?v=3.13.0 + +theme: + language: ru + font: + text: Public Sans + code: DM Mono + palette: + - media: "(prefers-color-scheme)" + scheme: default + accent: deep purple + toggle: + icon: material/brightness-auto + name: "Включить тёмную тему" + - media: "(prefers-color-scheme: dark)" + scheme: slate + accent: amber + toggle: + icon: material/brightness-2 + name: "Включить светлую тему" + - media: "(prefers-color-scheme: light)" + scheme: default + accent: deep purple + toggle: + icon: material/brightness-5 + name: "Переключиться на тему системы" + +markdown_extensions: + pymdownx.snippets: + auto_append: + - includes/abbreviations.ru.txt + +nav: + - Главная: 'index.md' + - База знаний: + - 'basics/why-privacy-matters.md' + - 'basics/threat-modeling.md' + - 'basics/common-threats.md' + - 'basics/common-misconceptions.md' + - 'basics/account-creation.md' + - 'basics/account-deletion.md' + - Технологические аспекты: + - 'basics/passwords-overview.md' + - 'basics/multi-factor-authentication.md' + - 'basics/email-security.md' + - 'basics/vpn-overview.md' + - Дополнительные темы: + - 'advanced/dns-overview.md' + - 'advanced/tor-overview.md' + - 'advanced/payments.md' + - 'advanced/communication-network-types.md' + - Операционные системы: + - 'os/android-overview.md' + - 'os/linux-overview.md' + - 'os/qubes-overview.md' + - kb-archive.md + - Рекомендации: + - 'tools.md' + - Интернет-браузинг: + - 'tor.md' + - 'desktop-browsers.md' + - 'mobile-browsers.md' + - Провайдеры: + - 'cloud.md' + - 'dns.md' + - 'email.md' + - 'financial-services.md' + - 'search-engines.md' + - 'vpn.md' + - Программное обеспечение: + - 'calendar.md' + - 'cryptocurrency.md' + - 'data-redaction.md' + - 'email-clients.md' + - 'encryption.md' + - 'file-sharing.md' + - 'frontends.md' + - 'multi-factor-authentication.md' + - 'news-aggregators.md' + - 'notebooks.md' + - 'passwords.md' + - 'productivity.md' + - 'real-time-communication.md' + - 'video-streaming.md' + - Операционные системы: + - 'android.md' + - 'desktop.md' + - 'router.md' + - О сайте: + - 'about/index.md' + - 'about/criteria.md' + - 'about/statistics.md' + - 'about/notices.md' + - 'about/privacy-policy.md' + - Сообщество: + - 'about/donate.md' + - Онлайн-сервисы: 'about/services.md' + - Правила поведения: 'CODE_OF_CONDUCT.md' + - 'about/privacytools.md' + - Помощь проекту: + - Руководство по написанию: + - 'meta/writing-style.md' + - 'meta/brand.md' + - Технические руководства: + - 'meta/uploading-images.md' + - 'meta/git-recommendations.md' + - Список изменений: 'https://github.com/privacyguides/privacyguides.org/releases' + - Форум: 'https://discuss.privacyguides.net/' + - Блог: 'https://blog.privacyguides.org/' diff --git a/netlify.toml b/netlify.toml index 69124f8d..24614af7 100644 --- a/netlify.toml +++ b/netlify.toml @@ -23,11 +23,10 @@ command = "mkdocs build --config-file config/mkdocs.en.yml && cp -r static/* site/" [context.production] - command = "git clone https://github.com/privacyguides/i18n i18n-download && cp -rl i18n-download/i18n . && cp -rl i18n-download/includes . && cp -rl i18n-download/theme . && mkdocs build --config-file config/mkdocs.en.yml && mkdocs build --config-file config/mkdocs.es.yml && mkdocs build --config-file config/mkdocs.fr.yml && mkdocs build --config-file config/mkdocs.he.yml && mkdocs build --config-file config/mkdocs.it.yml && mkdocs build --config-file config/mkdocs.nl.yml && mkdocs build --config-file config/mkdocs.zh-Hant.yml && cp -r static/* site/" + command = "git clone https://github.com/privacyguides/i18n i18n-download && cp -rl i18n-download/i18n . && cp -rl i18n-download/includes . && cp -rl i18n-download/theme . && mkdocs build --config-file config/mkdocs.en.yml && mkdocs build --config-file config/mkdocs.es.yml && mkdocs build --config-file config/mkdocs.fr.yml && mkdocs build --config-file config/mkdocs.he.yml && mkdocs build --config-file config/mkdocs.it.yml && mkdocs build --config-file config/mkdocs.nl.yml && mkdocs build --config-file config/mkdocs.zh-Hant.yml && mkdocs build --config-file config/mkdocs.ru.yml && cp -r static/* site/" [context.branch-deploy] command = "crowdin download && for i in config/mkdocs.*.yml; do mkdocs build --config-file $i; done && cp -r static/* site/" - [[headers]] for = "/*" @@ -78,6 +77,11 @@ to = "/i18n/404.zh-Hant.html" status = 404 +[[redirects]] + from = "/ru/*" + to = "/i18n/404.ru.html" + status = 404 + [[redirects]] from = "/*" to = "/i18n/404.en.html" diff --git a/static/_redirects b/static/_redirects index 78c3358f..fd120bcb 100644 --- a/static/_redirects +++ b/static/_redirects @@ -25,6 +25,7 @@ / /it/ 302 Language=it / /nl/ 302 Language=nl / /zh-hant/ 302 Language=zh-Hant +/ /ru/ 302 Language=ru / /en/ 302 /.well-known/matrix/* https://matrix.privacyguides.org/.well-known/matrix/:splat 200 diff --git a/theme/assets/stylesheets/lang-ru.css b/theme/assets/stylesheets/lang-ru.css new file mode 100644 index 00000000..7d249f34 --- /dev/null +++ b/theme/assets/stylesheets/lang-ru.css @@ -0,0 +1,60 @@ +/* +/// Copyright (c) 2023 Jonah Aragon +/// +/// Permission is hereby granted, free of charge, to any person obtaining a +/// copy of this software and associated documentation files (the "Software"), +/// to deal in the Software without restriction, including without limitation +/// the rights to use, copy, modify, merge, publish, distribute, sublicense, +/// and/or sell copies of the Software, and to permit persons to whom the +/// Software is furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +/// DEALINGS +*/ + +/* cyrillic */ +@font-face { + font-family: 'Playfair Display'; + font-style: normal; + font-weight: 700; + font-stretch: 100%; + font-display: swap; + src: url(https://fonts.bunny.net/playfair-display/files/playfair-display-cyrillic-700-normal.woff2) format('woff2'), url(https://fonts.bunny.net/playfair-display/files/playfair-display-cyrillic-700-normal.woff) format('woff'); + unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; +} + +/* latin */ +@font-face { + font-family: 'Playfair Display'; + font-style: normal; + font-weight: 700; + font-stretch: 100%; + font-display: swap; + src: url(https://fonts.bunny.net/playfair-display/files/playfair-display-latin-700-normal.woff2) format('woff2'), url(https://fonts.bunny.net/playfair-display/files/playfair-display-latin-700-normal.woff) format('woff'); + unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; +} + +/* latin-ext */ +@font-face { + font-family: 'Playfair Display'; + font-style: normal; + font-weight: 700; + font-stretch: 100%; + font-display: swap; + src: url(https://fonts.bunny.net/playfair-display/files/playfair-display-latin-ext-700-normal.woff2) format('woff2'), url(https://fonts.bunny.net/playfair-display/files/playfair-display-latin-ext-700-normal.woff) format('woff'); + unicode-range: U+0100-02AF,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF; +} + + +h1, h2, h3, .md-header__topic { + font-family: 'Bagnard', 'Playfair Display', serif; + font-weight: 700!important; +} diff --git a/theme/main.html b/theme/main.html index 41b468c7..e46721a7 100644 --- a/theme/main.html +++ b/theme/main.html @@ -143,6 +143,10 @@

您正在查看由我們在Crowdin上出色的語言團隊翻譯的《隱私指南》英文版。如果您發現錯誤,或在此頁面上看到任何未翻譯的部分,請考慮提供幫助!有關更多信息和提示,請參閱我們的翻譯指南.

You're viewing the Chinese (Traditional) copy of Privacy Guides, translated by our fantastic language team on Crowdin. If you notice an error, or see any untranslated sections on this page, please consider helping out! For more information and tips see our translation guide.

+ {% elif config.theme.language == "ru" %} +
+

Вы просматриваете русскую копию Privacy Guides, переведённую нашей невероятной командой переводчиков на Crowdin. Если вы нашли ошибку или непереведённые разделы на этой странице, пожалуйста, помогите нам! Для получения дополнительной информации и советов см. наше руководство по переводу.

+

You're viewing the Russian copy of Privacy Guides, translated by our fantastic language team on Crowdin. If you notice an error, or see any untranslated sections on this page, please consider helping out! For more information and tips see our translation guide.

{% endif %} {% endblock %}