Skip to content
New issue

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

Cleanup old messages #288

Merged
merged 3 commits into from
May 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion resources/language/English/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ msgctxt "#32092"
msgid "Size"
msgstr ""


msgctxt "#32093"
msgid "List of public DNS IPs"
msgstr ""
Expand Down
4 changes: 0 additions & 4 deletions resources/language/German/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,3 @@ msgstr ""
msgctxt "#32135"
msgid "Belarusian"
msgstr ""

#~ msgctxt "#32040"
#~ msgid "Maximum torrents"
#~ msgstr "Maximale Anzahl an Torrents"
12 changes: 0 additions & 12 deletions resources/language/Hebrew/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -353,15 +353,3 @@ msgstr ""
msgctxt "#32135"
msgid "Belarusian"
msgstr ""

#~ msgctxt "#32036"
#~ msgid "Additional keyword filters (comma separated)"
#~ msgstr "מילים נוספות לסינון (מופרדות בפסיק)"

#~ msgctxt "#32037"
#~ msgid "Use underscores around keywords to require a space/dot, ie. _HEVC_"
#~ msgstr "להשתמש בקו תחתון סביב מילות מפתח כדי להשתמש ברווח/נקודה וכד'. לדוגמה: _HEVC_"

#~ msgctxt "#32040"
#~ msgid "Maximum torrents"
#~ msgstr "כמות מרבית של טורנטים"
4 changes: 0 additions & 4 deletions resources/language/Italian/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,3 @@ msgstr "Qualità video"
msgctxt "#32135"
msgid "Belarusian"
msgstr ""

#~ msgctxt "#32040"
#~ msgid "Maximum torrents"
#~ msgstr "Torrent massimi"
8 changes: 0 additions & 8 deletions resources/language/Lithuania/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,3 @@ msgstr ""
msgctxt "#32135"
msgid "Belarusian"
msgstr ""

#~ msgctxt "#32071"
#~ msgid "Timeout setting must be lower than Quasar's"
#~ msgstr "Laiko nustatymas turi būti mažesnis nei Quasar"

#~ msgctxt "#32040"
#~ msgid "Maximum torrents"
#~ msgstr "Maksimumas torrentų"
4 changes: 0 additions & 4 deletions resources/language/Portuguese (Brazil)/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,3 @@ msgstr ""
msgctxt "#32135"
msgid "Belarusian"
msgstr ""

#~ msgctxt "#32040"
#~ msgid "Maximum torrents"
#~ msgstr "Número Máximo torrents"
4 changes: 0 additions & 4 deletions resources/language/Portuguese/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,3 @@ msgstr ""
msgctxt "#32135"
msgid "Belarusian"
msgstr ""

#~ msgctxt "#32040"
#~ msgid "Maximum torrents"
#~ msgstr "Número Máximo torrents"
1 change: 0 additions & 1 deletion resources/language/Russian/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ msgctxt "#32086"
msgid "Log debug messages for parsing"
msgstr "Писать в лог сообщения парсера"


msgctxt "#32087"
msgid "Filtering"
msgstr "Фильтрация"
Expand Down
4 changes: 0 additions & 4 deletions resources/language/Spanish (Argentina)/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,3 @@ msgstr "Calidad de video"
msgctxt "#32135"
msgid "Belarusian"
msgstr ""

#~ msgctxt "#32040"
#~ msgid "Maximum torrents"
#~ msgstr "Número máximo de torrents"
4 changes: 0 additions & 4 deletions resources/language/Spanish (Mexico)/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,3 @@ msgstr ""
msgctxt "#32135"
msgid "Belarusian"
msgstr ""

#~ msgctxt "#32040"
#~ msgid "Maximum torrents"
#~ msgstr "Numero máximo de torrents"
4 changes: 0 additions & 4 deletions resources/language/Spanish/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,3 @@ msgstr "Calidad de vídeo"
msgctxt "#32135"
msgid "Belarusian"
msgstr ""

#~ msgctxt "#32040"
#~ msgid "Maximum torrents"
#~ msgstr "Número máximo de torrents"
20 changes: 9 additions & 11 deletions scripts/xgettext_remove_old_messages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ grep -oP 'msgctxt "#\K\d+' resources/language/messages.pot > ids.pot

while read -r line; do rg -q -g '!*.po' -g '!*.pot' $line . || echo $line; done < ids.pot > orphaned_ids.pot

find resources/ -name "*.po*" |
while read -r file
while read -r line
do
while read -r line
do
sed -i "/$line/,+3d" "$file"
done < orphaned_ids.pot
done
sed -i "/$line/,+3d" resources/language/messages.pot
done < orphaned_ids.pot

# TODO: https://stackoverflow.com/questions/10435926/how-to-automatcially-remove-unused-gettext-strings/26469640
# after cleaning pot file we can use msgattrib to clean po files
# msgattrib --set-obsolete --ignore-file=messages.pot -o messages.po messages.po
# msgattrib --no-obsolete -o messages.po messages.po
# from https://stackoverflow.com/questions/10435926/how-to-automatcially-remove-unused-gettext-strings/26469640
for file in resources/language/*/*.po
do
msgattrib --no-wrap --set-obsolete --ignore-file=resources/language/messages.pot -o "$file" "$file"
msgattrib --no-wrap --no-obsolete -o "$file" "$file"
done

rm -f ids.pot orphaned_ids.pot