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

Implement unit adding in file format class

parent 61c5862a
......@@ -21,6 +21,7 @@
File format specific behavior.
'''
from django.utils.translation import ugettext_lazy as _
from translate.storage.lisa import LISAfile
from translate.storage import factory
import importlib
import __builtin__
......@@ -154,6 +155,16 @@ class FileFormat(object):
return (None, False)
def add_unit(self, pounit):
'''
Adds new unit to underlaying store.
'''
if isinstance(self.store, LISAfile):
# LISA based stores need to know this
self.store.addunit(pounit, new=True)
else:
self.store.addunit(pounit)
class AutoFormat(FileFormat):
name = _('Automatic detection')
......
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