-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcontribute.py
33 lines (28 loc) · 1.29 KB
/
contribute.py
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
27
28
29
30
31
32
33
pulling_from_transifex = ('zh-cn', 'pt-br', 'ja', 'uk', 'pl')
custom_contributing_links = {
'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.13/README.rst#%E5%8F%83%E8%88%87%E7%BF%BB%E8%AD%AF',
'fr': 'https://git.afpy.org/AFPy/python-docs-fr/src/branch/3.13/CONTRIBUTING.rst',
'id': 'https://github.com/python/python-docs-id/blob/master/README.md#berkontribusi-untuk-menerjemahkan',
'tr': 'https://github.com/python/python-docs-tr/blob/3.12/README.md#%C3%A7eviriye-katk%C4%B1da-bulunmak',
'gr': 'https://github.com/pygreece/python-docs-gr/blob/3.12/CONTRIBUTING.md',
}
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}')
)
if __name__ == '__main__':
for code, repo in (
('en', None),
('pl', None),
('ar', 'python/python-docs-ar'),
('zh-cn', None),
('id', None),
):
print(f'{code}: {get_contrib_link(code, repo)}')