Skip to content

Commit 28d5593

Browse files
author
Maciej Olko
committed
Initial commit
0 parents  commit 28d5593

File tree

8 files changed

+3844
-0
lines changed

8 files changed

+3844
-0
lines changed

.tx/config

Lines changed: 2427 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Polskie tłumaczenie dokumentacji Pythona
2+
========================================
3+
![9.31% do language switchera](https://img.shields.io/badge/language_switcher-9.31%25-0.svg)
4+
![postęp tłumaczenia całości dokumentacji](https://img.shields.io/badge/dynamic/json.svg?label=całość&query=$.pl&url=http://gce.zhsj.me/python/newest)
5+
6+
Znalazłeś błąd lub masz sugestię?
7+
* [Dodaj zgłoszenie](https://github.com/m-aciek/python-docs-pl/issues) w tym projekcie
8+
* lub sam [nanieś poprawkę](https://www.transifex.com/python-doc/python-newest/)
9+
w projekcie *Python document translation* na platformie Transifex.
10+
11+
Aktualizacja tłumaczeń
12+
----------------------
13+
* `python manage_translations.py recreate_tx_config`
14+
* `python manage_translations.py fetch`
15+
* `python manage_translations.py recreate_readme`

bugs.po

Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
# SOME DESCRIPTIVE TITLE.
2+
# Copyright (C) 2001-2019, Python Software Foundation
3+
# This file is distributed under the same license as the Python package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5+
#
6+
# Translators:
7+
# m_aciek <maciej.olko@gmail.com>, 2019
8+
#
9+
#, fuzzy
10+
msgid ""
11+
msgstr ""
12+
"Project-Id-Version: Python 3.8\n"
13+
"Report-Msgid-Bugs-To: \n"
14+
"POT-Creation-Date: 2019-09-01 14:24+0000\n"
15+
"PO-Revision-Date: 2017-02-16 17:31+0000\n"
16+
"Last-Translator: m_aciek <maciej.olko@gmail.com>, 2019\n"
17+
"Language-Team: Polish (https://www.transifex.com/python-doc/teams/5390/pl/)\n"
18+
"MIME-Version: 1.0\n"
19+
"Content-Type: text/plain; charset=UTF-8\n"
20+
"Content-Transfer-Encoding: 8bit\n"
21+
"Language: pl\n"
22+
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n"
23+
"%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n"
24+
"%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
25+
26+
msgid "Dealing with Bugs"
27+
msgstr "Zajmowanie się błędami"
28+
29+
msgid ""
30+
"Python is a mature programming language which has established a reputation "
31+
"for stability. In order to maintain this reputation, the developers would "
32+
"like to know of any deficiencies you find in Python."
33+
msgstr ""
34+
"Python jest dojrzałym językiem programowania, z ustaloną reputacją swojej "
35+
"stabilności. Aby utrzymać tę stabilność, deweloperzy chcieliby wiedzieć o "
36+
"wszelkich brakach, które da się znaleźć w Pythonie."
37+
38+
msgid ""
39+
"It can be sometimes faster to fix bugs yourself and contribute patches to "
40+
"Python as it streamlines the process and involves less people. Learn how to :"
41+
"ref:`contribute <contributing-to-python>`."
42+
msgstr ""
43+
"Czasem szybsze może być własnoręczne naprawienie błędu i wysłanie patchy do "
44+
"Pythona, usprawnia to proces i angażuje mniej osób. Dowiedz się, jak :ref:"
45+
"`kontrybuować <contributing-to-python>`."
46+
47+
msgid "Documentation bugs"
48+
msgstr "Błędy w dokumentacji"
49+
50+
msgid ""
51+
"If you find a bug in this documentation or would like to propose an "
52+
"improvement, please submit a bug report on the :ref:`tracker <using-the-"
53+
"tracker>`. If you have a suggestion on how to fix it, include that as well."
54+
msgstr ""
55+
"Jeśli znajdziesz błąd w tej dokumentacji lub chciałbyś zaproponować "
56+
"poprawkę, wyślij, prosimy, zgłoszenie błędu do :ref:`systemu <using-the-"
57+
"tracker>`. Jeśli masz sugestię, jak go naprawić, zawrzyj ją."
58+
59+
msgid ""
60+
"If you're short on time, you can also email documentation bug reports to "
61+
"docs@python.org (behavioral bugs can be sent to python-list@python.org). "
62+
"'docs@' is a mailing list run by volunteers; your request will be noticed, "
63+
"though it may take a while to be processed."
64+
msgstr ""
65+
"Jeśli brakuje ci czasu, możesz też wysyłać zgłoszenia błędów w dokumentacji "
66+
"na docs@python.org (błędy behawioralne mogą być wysyłane na python-"
67+
"list@python.org). 'docs@' jest listą mailingową prowadzoną przez "
68+
"wolontariuszy; twoje zgłoszenie zostanie zauważone, aczkolwiek może zająć "
69+
"chwilę jego przetworzenie."
70+
71+
msgid "`Documentation bugs`_"
72+
msgstr "`Błędy w dokumentacji`_"
73+
74+
msgid ""
75+
"A list of documentation bugs that have been submitted to the Python issue "
76+
"tracker."
77+
msgstr ""
78+
"Lista błędów w dokumentacji, które zostały wysłane do systemu zgłoszeń "
79+
"błędów Pythona."
80+
81+
msgid "`Issue Tracking <https://devguide.python.org/tracker/>`_"
82+
msgstr "`Śledzenie zgłoszeń <https://devguide.python.org/tracker/>`_"
83+
84+
msgid ""
85+
"Overview of the process involved in reporting an improvement on the tracker."
86+
msgstr "Omówienie procesu zgłaszania poprawki w systemie zgłoszeń."
87+
88+
msgid ""
89+
"`Helping with Documentation <https://devguide.python.org/docquality/#helping-"
90+
"with-documentation>`_"
91+
msgstr ""
92+
"`Pomoc w dokumentacji <https://devguide.python.org/docquality/#helping-with-"
93+
"documentation>`_"
94+
95+
msgid ""
96+
"Comprehensive guide for individuals that are interested in contributing to "
97+
"Python documentation."
98+
msgstr ""
99+
"Wyczerpujący przewodnik dla osób zainteresowanych rozwijaniem dokumentacji "
100+
"Pythona."
101+
102+
msgid "Using the Python issue tracker"
103+
msgstr "Używanie systemu zgłoszeń Pythona"
104+
105+
msgid ""
106+
"Bug reports for Python itself should be submitted via the Python Bug Tracker "
107+
"(https://bugs.python.org/). The bug tracker offers a Web form which allows "
108+
"pertinent information to be entered and submitted to the developers."
109+
msgstr ""
110+
"Zgłoszenia błędów w Pythonie powinny być zgłaszane przez Python Bug Tracker "
111+
"(https://bugs.python.org/). System zgłoszeń posiada formularz web, który "
112+
"pozwala wprowadzić stosowne informacje i wysłać je deweloperom."
113+
114+
msgid ""
115+
"The first step in filing a report is to determine whether the problem has "
116+
"already been reported. The advantage in doing so, aside from saving the "
117+
"developers time, is that you learn what has been done to fix it; it may be "
118+
"that the problem has already been fixed for the next release, or additional "
119+
"information is needed (in which case you are welcome to provide it if you "
120+
"can!). To do this, search the bug database using the search box on the top "
121+
"of the page."
122+
msgstr ""
123+
"Pierwszym krokiem przy wypełnianiu zgłoszenia jest ustalenie, czy problem "
124+
"został już zgłoszony. Zaletą tego ustalenia, oprócz oszczędzenia czasu "
125+
"deweloperów, jest to, że dowiesz się, co zostało zrobione, aby go naprawić; "
126+
"być może problem został już naprawiony na następne wydanie lub potrzebne są "
127+
"dodatkowe informacje (w tym przypadku zapraszamy cię, żebyś je podał, jeśli "
128+
"możesz!). Aby to zrobić, przeszukaj bazę zgłoszeń używając pola wyszukiwania "
129+
"na górze strony."
130+
131+
msgid ""
132+
"If the problem you're reporting is not already in the bug tracker, go back "
133+
"to the Python Bug Tracker and log in. If you don't already have a tracker "
134+
"account, select the \"Register\" link or, if you use OpenID, one of the "
135+
"OpenID provider logos in the sidebar. It is not possible to submit a bug "
136+
"report anonymously."
137+
msgstr ""
138+
"Jeśli problemu, który zgłaszasz, nie ma jeszcze w bug trackerze, wróć do "
139+
"Python Bug Trackera i zaloguj się. Jeśli nie masz jeszcze konta w trackerze, "
140+
"wybierz link „Register” lub, jeśli używasz OpenID, jedno z logo providerów "
141+
"OpenID w sidebarze. Nie da się wysłać zgłoszenia błędu anonimowo."
142+
143+
msgid ""
144+
"Being now logged in, you can submit a bug. Select the \"Create New\" link "
145+
"in the sidebar to open the bug reporting form."
146+
msgstr ""
147+
"Będąc teraz zalogowanym, możesz zgłosić buga. Wybierz link „Create New” w "
148+
"sidebarze, aby otworzyć formularz zgłaszania błędu."
149+
150+
msgid ""
151+
"The submission form has a number of fields. For the \"Title\" field, enter "
152+
"a *very* short description of the problem; less than ten words is good. In "
153+
"the \"Type\" field, select the type of your problem; also select the "
154+
"\"Component\" and \"Versions\" to which the bug relates."
155+
msgstr ""
156+
"Formularz zgłoszeniowy ma wiele pól. W polu „Title” wprowadź *bardzo* krótki "
157+
"opis problemu; mniej niż dziesięć słów jest dobrze. W polu „Type” wybierz "
158+
"typ swojego problemu; wybierz również „Component” i „Versions”, z którymi "
159+
"bug jest związany."
160+
161+
msgid ""
162+
"In the \"Comment\" field, describe the problem in detail, including what you "
163+
"expected to happen and what did happen. Be sure to include whether any "
164+
"extension modules were involved, and what hardware and software platform you "
165+
"were using (including version information as appropriate)."
166+
msgstr ""
167+
"W polu „Comment” opisz problem szczegółowo, zawierając informacje o tym, "
168+
"czego się spodziewałeś, aby się stało i co się stało zamiast. Zawrzyj "
169+
"informację, czy dotyczy to jakiegokolwiek modułu rozszerzeń i platform "
170+
"hardware'owych i software'owych, których używałeś (oraz informacje o "
171+
"wersjach)."
172+
173+
msgid ""
174+
"Each bug report will be assigned to a developer who will determine what "
175+
"needs to be done to correct the problem. You will receive an update each "
176+
"time action is taken on the bug."
177+
msgstr ""
178+
"Każde zgłoszenie błędu zostanie przypisane do dewelopera, który zdecyduje, "
179+
"co należy zrobić, aby naprawić problem. Dostaniesz aktualizację za każdym "
180+
"razem, gdy na bugu zostanie wykonana jakaś akcja."
181+
182+
msgid ""
183+
"`How to Report Bugs Effectively <https://www.chiark.greenend.org.uk/"
184+
"~sgtatham/bugs.html>`_"
185+
msgstr ""
186+
"`How to Report Bugs Effectively <https://www.chiark.greenend.org.uk/"
187+
"~sgtatham/bugs.html>`_"
188+
189+
msgid ""
190+
"Article which goes into some detail about how to create a useful bug report. "
191+
"This describes what kind of information is useful and why it is useful."
192+
msgstr ""
193+
"Artykuł, który dość szczegółowo opisuje, jak stworzyć wartościowe zgłoszenie "
194+
"błędu. Opisuje jakie rodzaje informacji są przydatne i dlaczego."
195+
196+
msgid ""
197+
"`Bug Report Writing Guidelines <https://developer.mozilla.org/en-US/docs/"
198+
"Mozilla/QA/Bug_writing_guidelines>`_"
199+
msgstr ""
200+
"`Wytyczne odnośnie pisania zgłoszeń błędów (w języku angielskim) <https://"
201+
"developer.mozilla.org/en-US/docs/Mozilla/QA/Bug_writing_guidelines>`_"
202+
203+
msgid ""
204+
"Information about writing a good bug report. Some of this is specific to "
205+
"the Mozilla project, but describes general good practices."
206+
msgstr ""
207+
"Informacje o pisaniu dobrych zgłoszeń błędów. Niektóre z nich są specyficzne "
208+
"dla projektu Mozilla, ale opisują ogólne dobre praktyki."
209+
210+
msgid "Getting started contributing to Python yourself"
211+
msgstr "Rozpoczęcie rozwijania Pythona samemu"
212+
213+
msgid ""
214+
"Beyond just reporting bugs that you find, you are also welcome to submit "
215+
"patches to fix them. You can find more information on how to get started "
216+
"patching Python in the `Python Developer's Guide`_. If you have questions, "
217+
"the `core-mentorship mailing list`_ is a friendly place to get answers to "
218+
"any and all questions pertaining to the process of fixing issues in Python."
219+
msgstr ""
220+
"Oprócz tylko zgłaszania błędów, które znajdziesz, jesteś również zaproszony "
221+
"do wysyłania patchy naprawiających je. Więcej informacji o tym, jak zacząć "
222+
"patchować Pythona, znajdziesz w `Python Developer's Guide`_. Jeśli masz "
223+
"pytania, `lista mailingowa core-mentorship`_ jest przyjaznym miejscem do "
224+
"uzyskiwania odpowiedzi na każde pytanie typowe dla procesu naprawiania "
225+
"błędów w Pythonie."

manage_translations.py

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
#!/usr/bin/env python
2+
#
3+
# This python file contains utility scripts to manage Python docs Polish translations.
4+
# It has to be run inside the python-docs-pl git root directory.
5+
#
6+
# Inspired by django-docs-translations script by claudep.
7+
#
8+
# The following command is available:
9+
#
10+
# * fetch: fetch translations from transifex.com and strip source lines from the
11+
# files.
12+
# * regenerate_tx_config: recreate configuration for all resources.
13+
14+
import os
15+
from os import getenv
16+
import sys
17+
from argparse import ArgumentParser
18+
from subprocess import call
19+
20+
from numpy import average
21+
import requests
22+
23+
LANGUAGE = 'pl'
24+
25+
26+
def fetch():
27+
"""
28+
Fetch translations from Transifex, remove source lines.
29+
"""
30+
if call("tx --version", shell=True) != 0:
31+
sys.stderr.write("The Transifex client app is required (pip install transifex-client).\n")
32+
exit(1)
33+
lang = LANGUAGE
34+
call(f'tx pull -l {lang} --minimum-perc=25', shell=True)
35+
for root, _, po_files in os.walk('.'):
36+
for po_file in po_files:
37+
if not po_file.endswith(".po"):
38+
continue
39+
po_path = os.path.join(root, po_file)
40+
print(po_path)
41+
call(f'msgcat --no-location -o {po_path} {po_path}', shell=True)
42+
43+
44+
RESOURCE_NAME_MAP = {
45+
'glossary_': 'glossary'
46+
}
47+
PROJECT_SLUG = 'python-newest'
48+
49+
50+
def recreate_tx_config():
51+
"""
52+
Regenerate Transifex client config for all resources.
53+
"""
54+
resources = _get_resources()
55+
with open('.tx/config', 'w') as config:
56+
config.writelines((
57+
'[main]\n',
58+
'host = https://www.transifex.com\n',
59+
))
60+
for resource in resources:
61+
slug = resource['slug']
62+
name = RESOURCE_NAME_MAP.get(slug, slug)
63+
if '--' in slug:
64+
directory, file_name = name.split('--')
65+
config.writelines((
66+
'\n',
67+
f'[{PROJECT_SLUG}.{slug}]\n',
68+
f'trans.{LANGUAGE} = {directory}/{file_name}.po\n',
69+
'type = PO\n',
70+
'source_lang = en\n',
71+
))
72+
else:
73+
config.writelines((
74+
'\n',
75+
f'[{PROJECT_SLUG}.{slug}]\n',
76+
f'trans.{LANGUAGE} = {name}.po\n',
77+
'type = PO\n',
78+
'source_lang = en\n',
79+
))
80+
81+
82+
def _get_resources():
83+
resources = []
84+
offset = 0
85+
while True:
86+
response = requests.get(
87+
f'https://api.transifex.com/organizations/python-doc/projects/{PROJECT_SLUG}/resources/',
88+
params={'language_code': LANGUAGE, 'offset': offset},
89+
auth=('api', getenv('TRANSIFEX_API_KEY')))
90+
response_list = response.json()
91+
resources.extend(response_list)
92+
if len(response_list) < 100:
93+
break
94+
offset += len(response_list)
95+
return resources
96+
97+
98+
def recreate_readme():
99+
def language_switcher(entry):
100+
return (entry['name'].startswith('bugs') or
101+
entry['name'].startswith('tutorial') or
102+
entry['name'].startswith('library--functions'))
103+
104+
resources = _get_resources()
105+
filtered = list(filter(language_switcher, resources))
106+
average_list = [e['stats']['translated']['percentage'] for e in filtered]
107+
weights_list = [e['wordcount'] for e in filtered]
108+
109+
language_switcher_status = average(average_list, weights=weights_list) * 100
110+
111+
with open('README.md', 'w') as file:
112+
file.write(
113+
f'''Polskie tłumaczenie dokumentacji Pythona
114+
========================================
115+
![{language_switcher_status:.2f}% language switchera](https://img.shields.io/badge/language_switcher-{language_switcher_status:.2f}%25-0.svg)
116+
![postęp tłumaczenia całości dokumentacji](https://img.shields.io/badge/dynamic/json.svg?label=całość&query=$.{LANGUAGE}&url=http://gce.zhsj.me/python/newest)
117+
118+
Znalazłeś błąd lub masz sugestię?
119+
* [Dodaj zgłoszenie](https://github.com/m-aciek/python-docs-pl/issues) w tym projekcie
120+
* lub sam [nanieś poprawkę](https://www.transifex.com/python-doc/python-newest/)
121+
w projekcie *Python document translation* na platformie Transifex.
122+
123+
Aktualizacja tłumaczeń
124+
----------------------
125+
* `python manage_translations.py recreate_tx_config`
126+
* `python manage_translations.py fetch`
127+
* `python manage_translations.py recreate_readme`
128+
'''
129+
)
130+
131+
132+
if __name__ == "__main__":
133+
RUNNABLE_SCRIPTS = ('fetch', 'recreate_tx_config', 'recreate_readme')
134+
135+
parser = ArgumentParser()
136+
parser.add_argument('cmd', nargs=1, choices=RUNNABLE_SCRIPTS)
137+
options = parser.parse_args()
138+
139+
eval(options.cmd[0])()

0 commit comments

Comments
 (0)