diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/children.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/children.html.jinja index 3be0a33a..c7c15488 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/children.html.jinja +++ b/src/mkdocstrings_handlers/python/templates/material/_base/children.html.jinja @@ -19,6 +19,9 @@ Context: {{ log.debug("Rendering children of " + obj.path) }} {% endblock logs %} + {% import "language.html.jinja" as lang with context %} + {#- Language module providing the `t` translation method. -#} +
{% if root_members %} @@ -45,7 +48,7 @@ Context: ) %} {% if attributes %} {% if config.show_category_heading %} - {% filter heading(heading_level, id=html_id ~ "-attributes", skip_inventory=config.skip_local_inventory) %}Attributes{% endfilter %} + {% filter heading(heading_level, id=html_id ~ "-attributes", skip_inventory=config.skip_local_inventory) %}{{ lang.t("Attributes") }}{% endfilter %} {% endif %} {% with heading_level = heading_level + extra_level %} {% for attribute in attributes|order_members(config.members_order, members_list) %} @@ -65,7 +68,7 @@ Context: ) %} {% if type_aliases %} {% if config.show_category_heading %} - {% filter heading(heading_level, id=html_id ~ "-type_aliases") %}Type Aliases{% endfilter %} + {% filter heading(heading_level, id=html_id ~ "-type_aliases") %}{{ lang.t("Type Aliases") }}{% endfilter %} {% endif %} {% with heading_level = heading_level + extra_level %} {% for type_alias in type_aliases|order_members(config.members_order, members_list) %} @@ -85,7 +88,7 @@ Context: ) %} {% if classes %} {% if config.show_category_heading %} - {% filter heading(heading_level, id=html_id ~ "-classes", skip_inventory=config.skip_local_inventory) %}Classes{% endfilter %} + {% filter heading(heading_level, id=html_id ~ "-classes", skip_inventory=config.skip_local_inventory) %}{{ lang.t("Classes") }}{% endfilter %} {% endif %} {% with heading_level = heading_level + extra_level %} {% for class in classes|order_members(config.members_order, members_list) %} @@ -105,7 +108,7 @@ Context: ) %} {% if functions %} {% if config.show_category_heading %} - {% filter heading(heading_level, id=html_id ~ "-functions", skip_inventory=config.skip_local_inventory) %}Functions{% endfilter %} + {% filter heading(heading_level, id=html_id ~ "-functions", skip_inventory=config.skip_local_inventory) %}{{ lang.t("Functions") }}{% endfilter %} {% endif %} {% with heading_level = heading_level + extra_level %} {% for function in functions|order_members(config.members_order, members_list) %} @@ -128,7 +131,7 @@ Context: ) %} {% if modules %} {% if config.show_category_heading %} - {% filter heading(heading_level, id=html_id ~ "-modules", skip_inventory=config.skip_local_inventory) %}Modules{% endfilter %} + {% filter heading(heading_level, id=html_id ~ "-modules", skip_inventory=config.skip_local_inventory) %}{{ lang.t("Modules") }}{% endfilter %} {% endif %} {% with heading_level = heading_level + extra_level %} {% for module in modules|order_members("alphabetical", members_list) %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja index 43ec5b1a..57f9fd5a 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja +++ b/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja @@ -17,6 +17,9 @@ Context: {{ log.debug("Rendering " + class.path) }} {% endblock logs %} +{% import "language.html.jinja" as lang with context %} +{#- Language module providing the `t` translation method. -#} +
{% with obj = class, html_id = class.path, all_members = class.all_members %} @@ -246,7 +249,7 @@ Context: {% if "__init__" in all_members and all_members["__init__"].source %} {% with init = all_members["__init__"] %}
- Source code in + {{ lang.t("Source code in") }} {%- if init.relative_filepath.is_absolute() -%} {{ init.relative_package_filepath }} {%- else -%} @@ -259,7 +262,7 @@ Context: {% endif %} {% elif class.source %}
- Source code in + {{ lang.t("Source code in") }} {%- if class.relative_filepath.is_absolute() -%} {{ class.relative_package_filepath }} {%- else -%} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html.jinja index 9e0add3f..894639a7 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html.jinja +++ b/src/mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html.jinja @@ -93,7 +93,7 @@ Context:

{% if attribute.annotation %} - TYPE: + {{ lang.t("TYPE:") }} {% with expression = attribute.annotation %} {% include "expression.html.jinja" with context %} {% endwith %} diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/languages/en.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/languages/en.html.jinja index a2e38b7c..d2bbba03 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/languages/en.html.jinja +++ b/src/mkdocstrings_handlers/python/templates/material/_base/languages/en.html.jinja @@ -9,9 +9,11 @@ {% macro t(key) %}{{ { "ATTRIBUTE": "ATTRIBUTE", + "Attributes": "Attributes", "Attributes:": "Attributes:", "BOUND:": "BOUND:", "Bound or Constraints": "Bound or Constraints", + "Classes": "Classes", "Classes:": "Classes:", "Class Type Parameters:": "Class Type Parameters:", "CLASS TYPE PARAMETER": "CLASS TYPE PARAMETER", @@ -23,12 +25,14 @@ "DESCRIPTION": "DESCRIPTION", "Description": "Description", "Examples:": "Examples:", + "Functions": "Functions", "Functions:": "Functions:", "FUNCTION": "FUNCTION", "Init Type Parameters:": "Init Type Parameters:", "INIT TYPE PARAMETER": "INIT TYPE PARAMETER", "Methods:": "Methods:", "METHOD": "METHOD", + "Modules": "Modules", "Modules:": "Modules:", "MODULE": "MODULE", "Name": "Name", @@ -45,6 +49,7 @@ "Source code in": "Source code in", "TYPE:": "TYPE:", "Type": "Type", + "Type Aliases": "Type Aliases", "Type Aliases:": "Type Aliases:", "TYPE ALIAS": "TYPE ALIAS", "Type Parameters:": "Type Parameters:", diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/languages/ja.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/languages/ja.html.jinja index a8e70902..840da89c 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/languages/ja.html.jinja +++ b/src/mkdocstrings_handlers/python/templates/material/_base/languages/ja.html.jinja @@ -9,9 +9,11 @@ {% macro t(key) %}{{ { "ATTRIBUTE": "属性", + "Attributes": "属性", "Attributes:": "属性:", "BOUND:": "境界:", "Bound or Constraints": "境界や制約", + "Classes": "クラス", "Classes:": "クラス:", "Class Type Parameters:": "Class Type Parameters:", "CLASS TYPE PARAMETER": "CLASS TYPE PARAMETER", @@ -23,12 +25,14 @@ "DESCRIPTION": "デスクリプション", "Description": "デスクリプション", "Examples:": "例:", + "Functions": "関数", "Functions:": "関数:", "FUNCTION": "関数", "Init Type Parameters:": "Init Type Parameters:", "INIT TYPE PARAMETER": "INIT TYPE PARAMETER", "Methods:": "メソッド:", "METHOD": "メソッド", + "Modules": "モジュール", "Modules:": "モジュール:", "MODULE": "モジュール", "Name": "名前", @@ -45,6 +49,7 @@ "Source code in": "ソースコード位置:", "TYPE:": "タイプ:", "Type": "タイプ", + "Type Aliases": "型エイリアス", "Type Aliases:": "型エイリアス:", "TYPE ALIAS": "型エイリアス", "Type Parameters:": "型パラメータ:", diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/languages/zh.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/languages/zh.html.jinja index 67346ffd..53888779 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/languages/zh.html.jinja +++ b/src/mkdocstrings_handlers/python/templates/material/_base/languages/zh.html.jinja @@ -9,9 +9,11 @@ {% macro t(key) %}{{ { "ATTRIBUTE": "属性", + "Attributes": "属性", "Attributes:": "属性:", "BOUND:": "边界:", "Bound or Constraints": "边界或约束", + "Classes": "类", "Classes:": "类:", "Class Type Parameters:": "Class Type Parameters:", "CLASS TYPE PARAMETER": "CLASS TYPE PARAMETER", @@ -23,12 +25,14 @@ "DESCRIPTION": "描述", "Description": "描述", "Examples:": "示例:", + "Functions": "函数", "Functions:": "函数:", "FUNCTION": "函数", "Init Type Parameters:": "Init Type Parameters:", "INIT TYPE PARAMETER": "INIT TYPE PARAMETER", "Methods:": "方法:", "METHOD": "方法", + "Modules": "模块", "Modules:": "模块:", "MODULE": "模块", "Name": "名称", @@ -45,6 +49,7 @@ "Source code in": "源代码位于:", "TYPE:": "类型:", "Type": "类型", + "Type Aliases": "类型别名", "Type Aliases:": "类型别名:", "TYPE ALIAS": "类型别名", "Type Parameters:": "类型形参:",