Skip to content

Commit

Permalink
Updated issue templates
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Sep 21, 2023
1 parent 96d845f commit f4e4d71
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 56 deletions.
104 changes: 52 additions & 52 deletions .github/ISSUE_TEMPLATE/04-add-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions material/overrides/hooks/translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/overrides/hooks/translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f4e4d71

Please sign in to comment.