mirego / accent

The first developer-oriented translation tool. True asynchronous flow between translators and your team.
https://www.accent.reviews
BSD 3-Clause "New" or "Revised" License
1.3k stars 97 forks source link

Xliff support broken for multiple files #107

Open kwojtaszek opened 5 years ago

kwojtaszek commented 5 years ago

I found out that accent has issues with xliff files that includes multiple files inside as an array. Looking into code spotted, that this part has issues: https://github.com/mirego/accent/blob/master/lib/langue/formatter/xliff_1_2/parser.ex#L11 While files may be also an array:

 {'{urn:oasis:names:tc:xliff:document:1.2}xliff',
  [
    {'{http://www.w3.org/2001/XMLSchema-instance}schemaLocation',
     'urn:oasis:names:tc:xliff:document:1.2 http://docs.oasis-open.org/xliff/v1.2/os/xliff-core-1.2-strict.xsd'},
    {'version', '1.2'}
  ],
  [
    {'{urn:oasis:names:tc:xliff:document:1.2}file',
     [
       {'datatype', 'plaintext'},
       {'target-language', 'en'},
       {'source-language', 'en'},
       {'original', 'MobileSeller/Base.lproj/LaunchScreen.storyboard'}
     ],

Example file: https://share.getcloudapp.com/RBu7xZNp

kwojtaszek commented 5 years ago

Initial work https://github.com/mirego/accent/pull/110