Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

replace charset with UTF-8 and preserve the mine type

  • Loading branch information...
commit 607ff4a2730a9ac1eb431e140958a25f90b24f11 1 parent a4b3714
@jamesni jamesni authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 zanataclient/publicanutil.py
View
9 zanataclient/publicanutil.py
@@ -299,8 +299,13 @@ def save_to_pofile(self, path, translations, pot):
for item in extensions.get('entries'):
po.metadata[item['key']]=item['value']
#specify Content-Type charset to UTF-8
- po.metadata['Content-Type'] = "text/plain; charset=UTF-8"
-
+ pattern = r'charset=[^;]*'
+ if po.metadata.has_key('Content-Type'):
+ re.sub(pattern, "charset=UTF-8", po.metadata['Content-Type'])
+ else:
+ po.metadata['Content-Type']="text/plain; charset=UTF-8"
+
+
for textflow in textflows:
if textflow.get('extensions'):
poentry = polib.POEntry(occurrences=None)
Please sign in to comment.
Something went wrong with that request. Please try again.