Exemplo n.º 1
0
    def initialize(self, lang_code, initialization_dict, keys=None):
        if keys is None:
            keys = self.keys

        for key in keys:
            value = initialization_dict[key][lang_code] if key in initialization_dict else ''
            self.session.add(ConfigL10N(self.tid, lang_code, key, value))
Exemplo n.º 2
0
 def initialize(self, keys, lang, data):
     for key in keys:
         value = data[key][lang] if key in data else ''
         self.session.add(
             ConfigL10N({
                 'tid': self.tid,
                 'lang': lang,
                 'var_name': key,
                 'value': value
             }))