Skip to content

Commit

Permalink
Enable Russian Translation (#2225)
Browse files Browse the repository at this point in the history
  • Loading branch information
dngray committed Jul 7, 2023
1 parent 509397d commit 82f96f2
Show file tree
Hide file tree
Showing 8 changed files with 245 additions and 5 deletions.
10 changes: 8 additions & 2 deletions config/layouts/custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,21 @@ definitions:
{{ layout.color or "#2d2d2d" }}

- &title_font_family >-
{%- if config.theme.language == "he" -%}
{%- if page.is_homepage -%}
Bagnard
{%- elif config.theme.language == "he" -%}
Suez One
{%- elif config.theme.language == "ru" -%}
Noto Serif TC
{%- else -%}
Bagnard
{%- endif -%}

- &font_family >-
{%- if config.theme.language == "he" -%}
Suez One
{%- elif config.theme.language == "ru" -%}
Noto Sans TC
{%- else -%}
Public Sans
{%- endif -%}
Expand Down Expand Up @@ -64,7 +70,7 @@ definitions:

- &homepage_description >-
{%- if page.is_homepage -%}
A socially motivated website which provides information about protecting your online data privacy and security.
{{ config.extra.homepage_description or "A socially motivated website which provides information about protecting your online data privacy and security." }}
{%- else -%}
{%- endif -%}

Expand Down
4 changes: 4 additions & 0 deletions config/mkdocs-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ extra:
link: /nl/
lang: nl
icon: https://raw.githubusercontent.com/twitter/twemoji/master/assets/svg/1f1f3-1f1f1.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: ""
Expand Down
160 changes: 160 additions & 0 deletions config/mkdocs.ru.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# Copyright (c) 2022-2023 Jonah Aragon <[email protected]>

# 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: |
<b>Privacy Guides</b> - некоммерческий сайт, предоставляющий информацию по защите безопасности и конфиденциальности ваших данных.<br>
Мы не зарабатываем на рекомендациях определенных продуктов и не используем партнерские ссылки.<br>
&copy; 2019 - 2023 Privacy Guides и поддерживающие.
<span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="m245.83 214.87-33.22 17.28c-9.43-19.58-25.24-19.93-27.46-19.93-22.13 0-33.22 14.61-33.22 43.84 0 23.57 9.21 43.84 33.22 43.84 14.47 0 24.65-7.09 30.57-21.26l30.55 15.5c-6.17 11.51-25.69 38.98-65.1 38.98-22.6 0-73.96-10.32-73.96-77.05 0-58.69 43-77.06 72.63-77.06 30.72-.01 52.7 11.95 65.99 35.86zm143.05 0-32.78 17.28c-9.5-19.77-25.72-19.93-27.9-19.93-22.14 0-33.22 14.61-33.22 43.84 0 23.55 9.23 43.84 33.22 43.84 14.45 0 24.65-7.09 30.54-21.26l31 15.5c-2.1 3.75-21.39 38.98-65.09 38.98-22.69 0-73.96-9.87-73.96-77.05 0-58.67 42.97-77.06 72.63-77.06 30.71-.01 52.58 11.95 65.56 35.86zM247.56 8.05C104.74 8.05 0 123.11 0 256.05c0 138.49 113.6 248 247.56 248 129.93 0 248.44-100.87 248.44-248 0-137.87-106.62-248-248.44-248zm.87 450.81c-112.54 0-203.7-93.04-203.7-202.81 0-105.42 85.43-203.27 203.72-203.27 112.53 0 202.82 89.46 202.82 203.26-.01 121.69-99.68 202.82-202.84 202.82z"></path></svg></span><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M314.9 194.4v101.4h-28.3v120.5h-77.1V295.9h-28.3V194.4c0-4.4 1.6-8.2 4.6-11.3 3.1-3.1 6.9-4.7 11.3-4.7H299c4.1 0 7.8 1.6 11.1 4.7 3.1 3.2 4.8 6.9 4.8 11.3zm-101.5-63.7c0-23.3 11.5-35 34.5-35s34.5 11.7 34.5 35c0 23-11.5 34.5-34.5 34.5s-34.5-11.5-34.5-34.5zM247.6 8C389.4 8 496 118.1 496 256c0 147.1-118.5 248-248.4 248C113.6 504 0 394.5 0 256 0 123.1 104.7 8 247.6 8zm.8 44.7C130.2 52.7 44.7 150.6 44.7 256c0 109.8 91.2 202.8 203.7 202.8 103.2 0 202.8-81.1 202.8-202.8.1-113.8-90.2-203.3-202.8-203.3z"></path></svg></span><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M247.6 8C389.4 8 496 118.1 496 256c0 147.1-118.5 248-248.4 248C113.6 504 0 394.5 0 256 0 123.1 104.7 8 247.6 8zm.8 44.7C130.2 52.7 44.7 150.6 44.7 256c0 109.8 91.2 202.8 203.7 202.8 103.2 0 202.8-81.1 202.8-202.8.1-113.8-90.2-203.3-202.8-203.3zm94 144.3v42.5H162.1V197h180.3zm0 79.8v42.5H162.1v-42.5h180.3z"></path></svg></span>
Содержание доступно под лицензией <a href="/license"><strong>CC BY-ND 4.0</strong></a>.
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: "Спасибо за ваш отзыв! Помогите нам улучшить эту страницу, <a href='https://discuss.privacyguides.net/'>открыв обсуждение на нашем форуме.</a>"

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/'
2 changes: 2 additions & 0 deletions includes/strings.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@ nav:
Blog: Blog

site:
homepage_card: |
A socially motivated website which provides information about protecting your online data privacy and security.
translation: |
You're viewing the English 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!
10 changes: 7 additions & 3 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
command = "mkdocs build --config-file config/mkdocs.en.yml && cp -r static/* site/"

[context.production]
command = "crowdin download && 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 && 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.ru.yml && cp -r static/* site/"

[context.branch-deploy]
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 . && for i in config/mkdocs.*.yml; do mkdocs build --config-file $i; done && cp -r static/* site/"

command = "crowdin download && for i in config/mkdocs.*.yml; do mkdocs build --config-file $i; done && cp -r static/* site/"

[[headers]]
for = "/*"
Expand Down Expand Up @@ -73,6 +72,11 @@
to = "/i18n/404.nl.html"
status = 404

[[redirects]]
from = "/ru/*"
to = "/i18n/404.ru.html"
status = 404

[[redirects]]
from = "/*"
to = "/i18n/404.en.html"
Expand Down
1 change: 1 addition & 0 deletions static/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
/ /he/ 302 Language=he
/ /it/ 302 Language=it
/ /nl/ 302 Language=nl
/ /ru/ 302 Language=ru
/ /en/ 302

/.well-known/matrix/* https://matrix.privacyguides.org/.well-known/matrix/:splat 200
Expand Down
58 changes: 58 additions & 0 deletions theme/assets/stylesheets/lang.ru.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
/// Copyright (c) 2023 Jonah Aragon <[email protected]>
///
/// 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: 'Noto Serif Display';
font-style: normal;
font-weight: 400;
src: url(https://fonts.bunny.net/noto-serif-display/files/noto-serif-display-cyrillic-400-normal.woff2) format('woff2'), url(https://fonts.bunny.net/noto-serif-display/files/noto-serif-display-cyrillic-400-normal.woff) format('woff');
}

/* latin */
@font-face {
font-family: 'Noto Serif Display';
font-style: normal;
font-weight: 400;
src: url(https://fonts.bunny.net/noto-serif-display/files/noto-serif-display-latin-400-normal.woff2) format('woff2'), url(https://fonts.bunny.net/noto-serif-display/files/noto-serif-display-latin-400-normal.woff) format('woff');
}

/* Cyrillic */
@font-face {
font-family: 'Noto Serif Display';
font-style: normal;
font-weight: 700;
src: url(https://fonts.bunny.net/noto-serif-display/files/noto-serif-display-cyrillic-700-normal.woff2) format('woff2'), url(https://fonts.bunny.net/noto-serif-display/files/noto-serif-display-cyrillic-700-normal.woff) format('woff');
}

/* latin */
@font-face {
font-family: 'Noto Serif Display';
font-style: normal;
font-weight: 700;
src: url(https://fonts.bunny.net/noto-serif-display/files/noto-serif-display-latin-700-normal.woff2) format('woff2'), url(https://fonts.bunny.net/noto-serif-display/files/noto-serif-display-latin-700-normal.woff) format('woff');
}

h1, h2, h3, .md-header__topic {
font-family: "Bagnard", "Noto Serif Display", serif;
font-weight: 700!important;
}
5 changes: 5 additions & 0 deletions theme/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,10 @@ <h1>{{ page.title | d(config.site_name, true)}}</h1>
<p>Je bekijkt de Nederlandse versie van Privacy Guides, vertaald door ons fantastische taalteam op <a href="https://crowdin.com/project/privacyguides">Crowdin</a>. Als u een fout opmerkt of onvertaalde gedeelten op deze pagina ziet, <a href="https://matrix.to/#/#pg-i18n:aragon.sh">overweeg dan om te helpen</a>!</p>
<p>You're viewing the Dutch copy of Privacy Guides, translated by our fantastic language team on <a href="https://crowdin.com/project/privacyguides">Crowdin</a>. If you notice an error, or see any untranslated sections on this page, please consider <a href="https://matrix.to/#/#pg-i18n:aragon.sh">helping out</a></p>
</div>
{% elif config.theme.language == "ru" %}
<div class="admonition info">
<p>Вы просматриваете русскую копию Privacy Guides, переведённую нашей невероятной командой переводчиков на <a href="https://crowdin.com/project/privacyguides">Crowdin</a>. Если вы нашли ошибку или непереведённые разделы на этой странице, пожалуйста, <a href="https://matrix.to/#/#pg-i18n:aragon.sh">помогите нам</a>!</p>
<p>You're viewing the Russian copy of Privacy Guides, translated by our fantastic language team on <a href="https://crowdin.com/project/privacyguides">Crowdin</a>. If you notice an error, or see any untranslated sections on this page, please consider <a href="https://matrix.to/#/#pg-i18n:aragon.sh">helping out</a></p>
</div>
{% endif %}
{% endblock %}

0 comments on commit 82f96f2

Please sign in to comment.