Skip to content

Commit

Permalink
Merge pull request #2468 from mythmon/unicode-db-extract
Browse files Browse the repository at this point in the history
Deal with unicode in l10n msgids.
  • Loading branch information
rlr committed Apr 10, 2015
2 parents 7f76530 + 9dba628 commit 1e8f8ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Expand Up @@ -7,6 +7,7 @@
- id: check-merge-conflict
- id: check-yaml
- id: debug-statements
- id: trailing-whitespace
- id: flake8
exclude: "\
(.*migrations.*)|\
Expand All @@ -20,4 +21,3 @@
(scripts/sprint_report.py)|\
(scripts/year_in_review.py)"
args: [--max-line-length=99]
- id: trailing-whitespace
7 changes: 4 additions & 3 deletions kitsune/sumo/management/commands/extract_db.py
Expand Up @@ -74,6 +74,7 @@ def handle(self, *args, **options):
comments = s['comments']
if comments:
for c in comments:
f.write('# {comment}\n'.format(comment=c))
f.write('_("""{id}""", "{context}")\n'.format(
id=s['id'], context=s['context']))
f.write(u'# {comment}\n'.format(comment=c).encode('utf8'))

f.write(u'_("""{id}""", "{context}")\n'.format(id=s['id'], context=s['context'])
.encode('utf8'))

0 comments on commit 1e8f8ed

Please sign in to comment.