forked from ckan/ckanext-qa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed translation belonging to other plugins ckan#17
- Loading branch information
1 parent
e6b444b
commit bcb285f
Showing
3 changed files
with
67 additions
and
42 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: ckanext-qa 0.3\n" | ||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" | ||
"Report-Msgid-Bugs-To: EMAIL@ADDRES\n" | ||
"POT-Creation-Date: 2017-03-17 13:32+0100\n" | ||
"PO-Revision-Date: 2015-03-28 18:07+0100\n" | ||
"Last-Translator: Krzysztof Madejski <[email protected]>\n" | ||
|
@@ -49,13 +49,6 @@ msgstr "Brak otwartej licencji" | |
msgid "File could not be downloaded." | ||
msgstr "Nie udało się pobrać pliku." | ||
|
||
#: ckanext/qa/tasks.py:268 ckanext/qa/tasks.py:341 ckanext/qa/tasks.py:346 | ||
#: ckanext/qa/templates/qa/openness_stars.html:24 | ||
#: ckanext/qa/templates/qa/openness_stars_brief.html:23 | ||
#: ckanext/qa/templates/report/openness.html:88 | ||
msgid "Reason" | ||
msgstr "Wytłumaczenie" | ||
|
||
#: ckanext/qa/tasks.py:269 | ||
#, python-format | ||
msgid "Error details: %s." | ||
|
@@ -218,11 +211,6 @@ msgstr "Do oceny" | |
msgid "Score" | ||
msgstr "Ocena" | ||
|
||
#: ckanext/qa/templates/report/openness.html:28 | ||
#: ckanext/qa/templates/report/openness.html:85 | ||
msgid "Organization" | ||
msgstr "" | ||
|
||
#: ckanext/qa/templates/report/openness.html:33 | ||
#: ckanext/qa/templates/report/openness.html:56 | ||
msgid "Total stars" | ||
|
@@ -232,11 +220,3 @@ msgstr "W sumie gwiazdek" | |
#: ckanext/qa/templates/report/openness.html:55 | ||
msgid "Average score" | ||
msgstr "Średnia ocena" | ||
|
||
#: ckanext/qa/templates/report/openness.html:82 | ||
msgid "Dataset" | ||
msgstr "" | ||
|
||
#: ckanext/qa/templates/report/openness.html:83 | ||
msgid "Notes" | ||
msgstr "Notatki" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/bin/bash | ||
|
||
# When you copy templates from CKAN (or other plugins) you end up with already translated translations in your pot file. | ||
# This script filters them out from your .pot file. Run it right after `python setup.py extract_messages` | ||
|
||
PLUGIN_NAME=qa | ||
PLUGIN_DEPENDENCIES="report archiver" | ||
|
||
SAVE_REUSED=0 | ||
VERBOSE=0 | ||
CURR_DIR=$(readlink -m $0/..) | ||
SRC_DIR=$(readlink -m $0/../../../../..) | ||
|
||
while getopts ":p:r:" opt; do | ||
case $opt in | ||
l) LANGUAGES="$OPTARG" | ||
;; | ||
p) PLUGIN_DEPENDENCIES="$OPTARG" | ||
;; | ||
r) SAVE_REUSED=1 | ||
;; | ||
v) VERBOSE=1 | ||
;; | ||
\?) echo "Invalid option -$OPTARG" >&2 | ||
;; | ||
esac | ||
done | ||
|
||
function run_verbose { | ||
if [ $VERBOSE ]; then | ||
echo "# Running: $1" | ||
fi | ||
eval $1 | ||
} | ||
|
||
# Find strings that we have reused from core CKAN and other plugins | ||
DEP_POTS="" | ||
for PLUGIN in $PLUGIN_DEPENDENCIES; do | ||
DEP=$SRC_DIR/ckanext-$PLUGIN/ckanext/$PLUGIN/i18n/ckanext-$PLUGIN.pot | ||
echo $DEP | ||
if [ -f $DEP ]; then | ||
DEP_POTS="$DEP_POTS $DEP" | ||
else | ||
echo "Warning: .pot file for dependent $PLUGIN plugin doesn't exist, skipping $DEP" | ||
fi | ||
done | ||
echo $DEP_POTS | ||
|
||
run_verbose "msgcat $SRC_DIR/ckan/ckan/i18n/ckan.pot $DEP_POTS -o $CURR_DIR/_dependencies.pot" | ||
|
||
# Identify reused translations | ||
touch $CURR_DIR/_reused_translations.pot | ||
run_verbose "msgcat --use-first --more-than=1 $CURR_DIR/_dependencies.pot $CURR_DIR/ckanext-$PLUGIN_NAME.pot -o $CURR_DIR/_reused_translations.pot" | ||
|
||
# Leave only unique strings in our pot | ||
run_verbose "msgcat --unique $CURR_DIR/ckanext-$PLUGIN_NAME.pot $CURR_DIR/_reused_translations.pot -o $CURR_DIR/ckanext-$PLUGIN_NAME.pot" | ||
|
||
rm $CURR_DIR/_dependencies.pot | ||
if [ ! $SAVE_REUSED ]; then | ||
rm $CURR_DIR/_reused_translations.pot | ||
else | ||
echo "Saving $CURR_DIR/_reused_translations.pot" | ||
fi | ||
|
||
echo "" | ||
echo "I've updated $CURR_DIR/ckanext-$PLUGIN_NAME.pot." |