diff --git a/CHANGELOG b/CHANGELOG index ab5b835c8..5792c729f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +mkdocs-material-2.5.6 (2018-02-xx) + + * Added Persian translations + mkdocs-material-2.5.5 (2018-01-31) * Added Hungarian translations diff --git a/material/base.html b/material/base.html index 0fbcd0c8d..c9d738088 100644 --- a/material/base.html +++ b/material/base.html @@ -69,13 +69,12 @@ {% endfor %} {% block extrahead %}{% endblock %} - {% set direction = config.theme.direction %} {% if palette.primary or palette.accent %} {% set primary = palette.primary | replace(" ", "-") | lower %} {% set accent = palette.accent | replace(" ", "-") | lower %} - + {% else %} - + {% endif %} diff --git a/material/partials/language.html b/material/partials/language.html index 0eb19608a..707362263 100644 --- a/material/partials/language.html +++ b/material/partials/language.html @@ -1,10 +1,11 @@ {% import "partials/language/" + config.theme.language + ".html" as lang %} -{% import "partials/language/en.html" as oops %} +{% import "partials/language/en.html" as fallback %} {% macro t(key) %}{{ { + "direction": config.theme.direction, "search.language": ( config.extra.search | default({}) ).language, "search.tokenizer": ( config.extra.search | default({}) ).tokenizer | default("", true), -}[key] or lang.t(key) or oops.t(key) }}{% endmacro %} +}[key] or lang.t(key) or fallback.t(key) }}{% endmacro %} diff --git a/material/partials/language/fa.html b/material/partials/language/fa.html new file mode 100644 index 000000000..7f5e5cd17 --- /dev/null +++ b/material/partials/language/fa.html @@ -0,0 +1,21 @@ +{% macro t(key) %}{{ { + "language": "fa", + "direction": "rtl", + "clipboard.copy": "کپی کردن", + "clipboard.copied": "کپی شد", + "edit.link.title": "این صفحه را ویرایش کنید", + "footer.previous": "قبلی", + "footer.next": "بعدی", + "meta.comments": "نظرات", + "meta.source": "منبع", + "search.language": "en", + "search.placeholder": "جستجو", + "search.result.placeholder": "برای شروع جستجو تایپ کنید", + "search.result.none": "سندی یافت نشد", + "search.result.one": "1 سند یافت شد", + "search.result.other": "# سند یافت شد", + "search.tokenizer": "[\s]+", + "skip.link.title": "پرش به محتویات", + "source.link.title": "رفتن به مخزن", + "toc.title": "فهرست موضوعات" +}[key] }}{% endmacro %} diff --git a/src/base.html b/src/base.html index f9c0ca240..6e8ae109b 100644 --- a/src/base.html +++ b/src/base.html @@ -146,15 +146,14 @@ - {% set direction = config.theme.direction %} {% if palette.primary or palette.accent %} {% set primary = palette.primary | replace(" ", "-") | lower %} {% set accent = palette.accent | replace(" ", "-") | lower %} - {% else %} - + {% endif %} diff --git a/src/partials/language.html b/src/partials/language.html index 2a68ad4df..b22e74dae 100644 --- a/src/partials/language.html +++ b/src/partials/language.html @@ -24,14 +24,15 @@ {% import "partials/language/" + config.theme.language + ".html" as lang %} -{% import "partials/language/en.html" as oops %} +{% import "partials/language/en.html" as fallback %} {% macro t(key) %}{{ { + "direction": config.theme.direction, "search.language": ( config.extra.search | default({}) ).language, "search.tokenizer": ( config.extra.search | default({}) ).tokenizer | default("", true), -}[key] or lang.t(key) or oops.t(key) }}{% endmacro %} +}[key] or lang.t(key) or fallback.t(key) }}{% endmacro %} diff --git a/src/partials/language/fa.html b/src/partials/language/fa.html new file mode 100644 index 000000000..8a575f940 --- /dev/null +++ b/src/partials/language/fa.html @@ -0,0 +1,44 @@ + + + +{% macro t(key) %}{{ { + "language": "fa", + "direction": "rtl", + "clipboard.copy": "کپی کردن", + "clipboard.copied": "کپی شد", + "edit.link.title": "این صفحه را ویرایش کنید", + "footer.previous": "قبلی", + "footer.next": "بعدی", + "meta.comments": "نظرات", + "meta.source": "منبع", + "search.language": "en", + "search.placeholder": "جستجو", + "search.result.placeholder": "برای شروع جستجو تایپ کنید", + "search.result.none": "سندی یافت نشد", + "search.result.one": "1 سند یافت شد", + "search.result.other": "# سند یافت شد", + "search.tokenizer": "[\s]+", + "skip.link.title": "پرش به محتویات", + "source.link.title": "رفتن به مخزن", + "toc.title": "فهرست موضوعات" +}[key] }}{% endmacro %}