This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If true, it means it is between "# Translators:\n" and "#\n",
# and it is a translator credit. Start with False
is_translator_credits = False
# Start looping through the file, line by line, looking for the
# translation credits block, and then quit without going any
# further down.
for line in f:
# if true, translator credits block finished; quit file
if line == '#\n' and is_translator_credits:
break
# if true, we are in the translator credits block; extract info
if is_translator_credits:
# remove leading sharp sign, and trailing comma and year
line = line.strip('# ')
line = line[:-7]
# Skip entries we do not want to add
if line in ignore_entries:
continue
# Add entry to the set
translators_credits_set.add(line)
# if true, this is the start of the translation credits block;
# flag is_translator_credits and go to the next line
if line == '# Translators:\n':
is_translator_credits = True
continue
# if true, it means the loop went down until it found the first msgid.
# This means there is no translator credits block (i.e. no one started
# translating this file). Therefore we should stop looking at this file.
# Quit this file and go to the next one.
if line == 'msgid "':
break
# Remove parentheses that messes the alphabeticall order.
translators_credits_set.remove('(Douglas da Silva) <dementikovalev@yandex.ru>')
translators_credits_set.add('Douglas da Silva <dementikovalev@yandex.ru>')
# Print the resulting list to the standard output
for t in sorted(translators_credits_set):
print(t)
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Create list-translators.py #52
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Create list-translators.py #52
Filter by extension
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing