Browse Source

Merge branch 'develop' into release-0.28

pull/360/head
Simon Eisenmann 9 years ago
parent
commit
eb425a3df5
  1. 2
      src/hooks/pre-commit.hook
  2. 20
      src/i18n/helpers/polint.py
  3. 2
      src/i18n/messages-ru.po

2
src/hooks/pre-commit.hook

@ -78,7 +78,7 @@ fi @@ -78,7 +78,7 @@ fi
for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.po$"` ; do
echo "Checking ${file}"
nf=`git checkout-index --temp ${file} | cut -f 1`
./src/i18n/helpers/polint.py "${nf}"
./src/i18n/helpers/polint.py --hook "${nf}" "${file}"
r=$?
rm "${nf}"
if [ $r != 0 ] ; then

20
src/i18n/helpers/polint.py

@ -62,7 +62,10 @@ def parsepo(fn): @@ -62,7 +62,10 @@ def parsepo(fn):
msgstr = None
elif line.startswith("msgstr"):
msgstr = line.strip()[8:-1]
elif line.startswith('"') and msgstr is not None and msgid is not None:
elif line.startswith('"'):
if msgstr is None:
msgid += line.strip()[1:-1]
elif msgstr is not None:
msgstr += line.strip()[1:-1]
elif line.startswith("#. Default: "):
default = line.strip()[13:-1]
@ -184,12 +187,27 @@ def main(): @@ -184,12 +187,27 @@ def main():
_, POT_DATA, _ = parsepo(os.path.join(ROOT, 'messages.pot'))
errors = 0
try:
sys.argv.remove('--hook')
except ValueError:
is_hook = False
else:
is_hook = True
if is_hook:
filename, orig_filename = sys.argv[1:]
filenames = [filename]
else:
orig_filename = None
filenames = sys.argv[1:]
show_filenames = False
if not filenames:
filenames = glob.glob(os.path.join(ROOT, 'messages-*.po'))
show_filenames = True
for filename in filenames:
if orig_filename:
language = os.path.basename(orig_filename)[9:-3]
else:
language = os.path.basename(filename)[9:-3]
if show_filenames:
print 'Checking %s (%s)' % (filename, language)

2
src/i18n/messages-ru.po

@ -301,7 +301,7 @@ msgid "" @@ -301,7 +301,7 @@ msgid ""
"and rooms."
msgstr ""
"Ваше фото, имя и сообщение о статусе идентифицируют вас в вызовах, чатах "
"и комнатах"
"и комнатах."
msgid "Your ID"
msgstr "Ваш ID"

Loading…
Cancel
Save