diff --git a/.github/ISSUE_TEMPLATE/04-add-translations.yml b/.github/ISSUE_TEMPLATE/04-add-translations.yml index 99e872e7b..42c10f287 100644 --- a/.github/ISSUE_TEMPLATE/04-add-translations.yml +++ b/.github/ISSUE_TEMPLATE/04-add-translations.yml @@ -20,61 +20,61 @@ body: description: >- Please translate the labels on the right. For new languages, translate each line. For existing languages, only translate lines containing the - icon :arrow_left: and remove the icon before submitting. + :arrow_left: icon and remove the icon before submitting. [More](https://squidfunk.github.io/mkdocs-material/contributing/adding-translations/#translations_1) value: |- {% macro t(key) %}{{ { - "language": "en", - "direction": "ltr", - "action.edit": "Edit this page", - "action.skip": "Skip to content", - "action.view": "View source of this page", - "announce.dismiss": "Don't show this again", - "blog.archive": "Archive", - "blog.categories": "Categories", - "blog.categories.in": "in", - "blog.continue": "Continue reading", - "blog.draft": "Draft", - "blog.index": "Back to index", - "blog.meta": "Metadata", - "blog.references": "Related links", - "clipboard.copy": "Copy to clipboard", - "clipboard.copied": "Copied to clipboard", - "consent.accept": "Accept", - "consent.manage": "Manage settings", - "consent.reject": "Reject", - "footer": "Footer", - "footer.next": "Next", - "footer.previous": "Previous", - "header": "Header", - "meta.comments": "Comments", - "meta.source": "Source", - "nav": "Navigation", - "readtime.one": "1 min read", - "readtime.other": "# min read", - "rss.created": "RSS feed", - "rss.updated": "RSS feed of updated content", - "search": "Search", - "search.placeholder": "Search", - "search.share": "Share", - "search.reset": "Clear", - "search.result.initializer": "Initializing search", - "search.result.placeholder": "Type to start searching", - "search.result.none": "No matching documents", - "search.result.one": "1 matching document", - "search.result.other": "# matching documents", - "search.result.more.one": "1 more on this page", - "search.result.more.other": "# more on this page", - "search.result.term.missing": "Missing", - "select.language": "Select language", - "select.version": "Select version", - "source": "Go to repository", - "source.file.contributors": "Contributors", - "source.file.date.created": "Created", - "source.file.date.updated": "Last update", - "tabs": "Tabs", - "toc": "Table of contents", - "top": "Back to top" + "language": "en ⬅️", + "direction": "ltr ⬅️", + "action.edit": "Edit this page ⬅️", + "action.skip": "Skip to content ⬅️", + "action.view": "View source of this page ⬅️", + "announce.dismiss": "Don't show this again ⬅️", + "blog.archive": "Archive ⬅️", + "blog.categories": "Categories ⬅️", + "blog.categories.in": "in ⬅️", + "blog.continue": "Continue reading ⬅️", + "blog.draft": "Draft ⬅️", + "blog.index": "Back to index ⬅️", + "blog.meta": "Metadata ⬅️", + "blog.references": "Related links ⬅️", + "clipboard.copy": "Copy to clipboard ⬅️", + "clipboard.copied": "Copied to clipboard ⬅️", + "consent.accept": "Accept ⬅️", + "consent.manage": "Manage settings ⬅️", + "consent.reject": "Reject ⬅️", + "footer": "Footer ⬅️", + "footer.next": "Next ⬅️", + "footer.previous": "Previous ⬅️", + "header": "Header ⬅️", + "meta.comments": "Comments ⬅️", + "meta.source": "Source ⬅️", + "nav": "Navigation ⬅️", + "readtime.one": "1 min read ⬅️", + "readtime.other": "# min read ⬅️", + "rss.created": "RSS feed ⬅️", + "rss.updated": "RSS feed of updated content ⬅️", + "search": "Search ⬅️", + "search.placeholder": "Search ⬅️", + "search.share": "Share ⬅️", + "search.reset": "Clear ⬅️", + "search.result.initializer": "Initializing search ⬅️", + "search.result.placeholder": "Type to start searching ⬅️", + "search.result.none": "No matching documents ⬅️", + "search.result.one": "1 matching document ⬅️", + "search.result.other": "# matching documents ⬅️", + "search.result.more.one": "1 more on this page ⬅️", + "search.result.more.other": "# more on this page ⬅️", + "search.result.term.missing": "Missing ⬅️", + "select.language": "Select language ⬅️", + "select.version": "Select version ⬅️", + "source": "Go to repository ⬅️", + "source.file.contributors": "Contributors ⬅️", + "source.file.date.created": "Created ⬅️", + "source.file.date.updated": "Last update ⬅️", + "tabs": "Tabs ⬅️", + "toc": "Table of contents ⬅️", + "top": "Back to top ⬅️" }[key] }}{% endmacro %} render: Jinja validations: diff --git a/material/overrides/hooks/translations.py b/material/overrides/hooks/translations.py index 671ebf0a8..6a523f698 100644 --- a/material/overrides/hooks/translations.py +++ b/material/overrides/hooks/translations.py @@ -86,13 +86,14 @@ def on_page_markdown(markdown: str, *, page: Page, config: MkDocsConfig, files): # Assemble GitHub issue URL link = urlparse(issue_url) link = link._replace(query = urlencode({ - "template": "04-add-a-translation.yml", + "template": "04-add-translations.yml", "title": f"Update {name} translations", "translations": "\n".join([ "{% macro t(key) %}{{ {", ",\n".join(translations), "}[key] }}{% endmacro %}" - ]) + ]), + "country-flag": f":flag_{countries[code]}:" })) # Add translation diff --git a/src/overrides/hooks/translations.py b/src/overrides/hooks/translations.py index 671ebf0a8..6a523f698 100644 --- a/src/overrides/hooks/translations.py +++ b/src/overrides/hooks/translations.py @@ -86,13 +86,14 @@ def on_page_markdown(markdown: str, *, page: Page, config: MkDocsConfig, files): # Assemble GitHub issue URL link = urlparse(issue_url) link = link._replace(query = urlencode({ - "template": "04-add-a-translation.yml", + "template": "04-add-translations.yml", "title": f"Update {name} translations", "translations": "\n".join([ "{% macro t(key) %}{{ {", ",\n".join(translations), "}[key] }}{% endmacro %}" - ]) + ]), + "country-flag": f":flag_{countries[code]}:" })) # Add translation