Commit 098e7c31 authored by Alain St-Denis's avatar Alain St-Denis
Browse files

remove some leftover comments + update TRANSLATIONS.md with details on how to...

remove some leftover comments + update TRANSLATIONS.md with details on how to deal with django.pot updates
parent 3fc49958
......@@ -30,7 +30,15 @@ django-admin compilemessages
```
Saving and archiving from the weblate project will push the updated po files to socialhome's repository.
If changes to translation files (pot and po) are made, they should be pushed to the repo and then forced synced from weblate's UI.
If changes to the translation template file (django.pot) are made, they should first be merged with all existing translations with (bash script example):
```
for f in locale/*/LC_MESSAGES/django.po; do
msgmerge -U $f locale/django.pot
done
```
and be pushed to the repo and then forced synced from the weblate UI.
Hack
----
......
......@@ -4,5 +4,4 @@ extrajs = translate.extract:extract_extrajs
[django: socialhome/templates/**.*]
[django: socialhome/*/templates/**.*]
[python: socialhome/**.py]
#[javascript: socialhome/static/**.js]
[extrajs: socialhome/static/**.js]
......@@ -24,14 +24,6 @@ def extract_extrajs(fileobj, keywords, comment_tags, options):
filtpat = re.compile('t\._f\("gettext"\)', re.UNICODE)
c = filtpat.sub('gettext', c)
# tickpat = re.compile(r'\x60(.*?)\x60', re.UNICODE)
# res = tickpat.findall(contents)
# comppat = re.compile(r'\$\{(.*?)\}', re.UNICODE)
# for s in res:
# r = comppat.findall(s)
# if r: txt = txt + '\n'.join(r)
# options['template_string'] = False
comppat = re.compile(r'(\$\{gettext\((.*?)\)\})', re.UNICODE)
c = comppat.sub(r'`+gettext(\g<2>)+`', c, re.UNICODE)
......@@ -50,8 +42,3 @@ if __name__ == '__main__':
with open(sys.argv[1], 'rb') as f:
for i in extract_extrajs(f, ['gettext'], [], {}):
print(i)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment