Commit bef1984c authored by Michal Čihař's avatar Michal Čihař

Add UTF-16 variant of Java properties

We override the encoding for the iso-8859-1 as the detection engine just
forces it to be utf-8.

Fixes #851
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent c8d26c0d
......@@ -941,18 +941,29 @@ class PropertiesUtf8Format(FileFormat):
new_translation = '\n'
@register_fileformat
class PropertiesUtf16Format(PropertiesUtf8Format):
name = _('Java Properties (UTF-16)')
format_id = 'properties-utf16'
loader = ('properties', 'javafile')
autoload = ('.properties',)
@register_fileformat
class PropertiesFormat(PropertiesUtf8Format):
name = _('Java Properties')
name = _('Java Properties (ISO-8859-1)')
format_id = 'properties'
loader = ('properties', 'javafile')
autoload = ('.properties',)
@classmethod
def fixup(cls, store):
'''
Java properties need to be iso-8859-1, but
ttkit converts them to utf-8.
This will be fixed in translate-toolkit 1.14.0, we could then
merge utf-16 and this one as the encoding detection should do
the correct magic then.
'''
store.encoding = 'iso-8859-1'
return store
......
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