Use codecs.open for translation po files
This commit is contained in:
parent
a3f24c59e9
commit
54a9a7b906
1 changed files with 2 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ __copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms
|
|||
|
||||
import os
|
||||
import datetime
|
||||
import codecs
|
||||
|
||||
from collections import defaultdict
|
||||
from flask import request, g, url_for, make_response, render_template, send_from_directory, redirect, abort
|
||||
|
|
@ -924,7 +925,7 @@ def _get_translations(locale, domain):
|
|||
|
||||
def messages_from_po(path, locale, domain):
|
||||
messages = dict()
|
||||
with file(path) as f:
|
||||
with codecs.open(path, encoding="utf-8") as f:
|
||||
catalog = read_po(f, locale=locale, domain=domain)
|
||||
|
||||
for message in catalog:
|
||||
|
|
|
|||
Loading…
Reference in a new issue