-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcontribute.py
More file actions
26 lines (23 loc) · 1.2 KB
/
contribute.py
File metadata and controls
26 lines (23 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
pulling_from_transifex: frozenset[str] = frozenset(
{'zh-cn', 'pt-br', 'ja', 'uk', 'pl', 'ru', 'fa', 'id'}
)
custom_contributing_links: dict[str, str] = {
'es': 'https://python-docs-es.readthedocs.io/page/CONTRIBUTING.html',
'ko': 'https://www.flowdas.com/pages/python-docs-ko.html',
'zh-tw': 'https://github.com/python/python-docs-zh-tw/blob/3.14/README.rst#id2',
'fr': 'https://git.afpy.org/AFPy/python-docs-fr/src/branch/3.14/CONTRIBUTING.rst',
'id': 'https://github.com/python/python-docs-id/blob/3.14/README.md#berkontribusi-untuk-menerjemahkan',
'tr': 'https://github.com/python/python-docs-tr/blob/3.12/README.md#%C3%A7eviriye-katk%C4%B1da-bulunmak',
'el': 'https://github.com/python/python-docs-el/blob/3.14/CONTRIBUTING.md',
'pt-br': 'https://python.org.br/traducao/',
}
def get_contrib_link(language: str, repo: str | None) -> str | None:
return (
custom_contributing_links.get(language)
or (
language in pulling_from_transifex
and 'https://explore.transifex.com/python-doc/python-newest/'
)
or (repo and f'https://github.com/{repo}')
or 'https://devguide.python.org/documentation/translations/translating/'
)