wichert / lingua

Translation toolkit for Python
Other
46 stars 32 forks source link

Support JS templates #21

Closed delijati closed 10 years ago

delijati commented 11 years ago

Im using underscore templates in a project. Lingua trows that error:

Aborting due to parse error in /opt/develop/privat/stuff/templates/home.pt: not well-formed (invalid token): line 4, column 24

the files looks like that:

<metal:use use-macro="view.helper.api['main'].macros['master']">                                            
  <metal:fill fill-slot="content">
    <script type="text/html" id='alert'>
      <div class="alert <%= type %>"> 
        <button type="button" class="close" data-dismiss="alert">&times;</button><%= text %>
      </div>
    </script>
    ...
  </metal:fill>
</metal:use> 
wichert commented 10 years ago

This should work correctly with the Lingua 2. Previous versions used an XML parser, and since you input is not valid XML it would report an error.