Commit 248b9dcc authored by Michal Čihař's avatar Michal Čihař

USe generic names for helper classes

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent fc1158c7
......@@ -345,16 +345,15 @@ class FileUnit(object):
self.unit.markfuzzy(fuzzy)
class TSUnit(FileUnit):
class MonolingualIDUnit(FileUnit):
def get_context(self):
if self.template is not None:
# Monolingual JSON files
return self.template.getid()
else:
return self.mainunit.getcontext()
class JSONUnit(FileUnit):
class MonolingualSimpleUnit(MonolingualIDUnit):
def get_locations(self):
return ''
......@@ -363,13 +362,6 @@ class JSONUnit(FileUnit):
return self.mainunit.getid().lstrip('.')
return get_string(self.template.target)
def get_context(self):
if self.template is not None:
# Monolingual JSON files
return self.template.getid()
else:
return self.mainunit.getcontext()
def is_translatable(self):
return True
......@@ -889,7 +881,7 @@ class TSFormat(FileFormat):
format_id = 'ts'
loader = ('ts2', 'tsfile')
autoload = ('.ts',)
unit_class = TSUnit
unit_class = MonolingualIDUnit
@register_fileformat
......@@ -1046,7 +1038,7 @@ class JSONFormat(FileFormat):
name = _('JSON file')
format_id = 'json'
loader = ('weblate.trans.aresource', 'JsonFile')
unit_class = JSONUnit
unit_class = MonolingualSimpleUnit
autoload = ('.json',)
@classmethod
......@@ -1086,7 +1078,7 @@ class CSVFormat(FileFormat):
name = _('CSV file')
format_id = 'csv'
loader = ('csvl10n', 'csvfile')
unit_class = JSONUnit
unit_class = MonolingualSimpleUnit
autoload = ('.csv',)
@property
......
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