locize / xliff

xliff2js and js2xliff converter xliff utils
MIT License
80 stars 37 forks source link

Adding support for google actions xliff elements #27

Closed armonge closed 4 years ago

armonge commented 4 years ago

Related to #26

At this point the implementation is working and all of the existing functionality continues to work correctly (according to the tests). Would very much appreciate comments, will of course also be adding some documentation to the README

The proposal is for the JSON to look like the following

{
  "resources": {
      "grpId1": {
        "additionalAttributes": {
          "resname": "sampleInvocations"
        },
        "groupUnits": {
          "tu11": {
            "source": "Mit assistant app sprechen",
            "target": "Mit assistant app sprechen",
            "note": "Sample invocation phrase displayed as part of app description in the directory of all agents.",
            "additionalAttributes": {
              "resname": "sampleInvocations.1"
            }
          }
        }
      }
    }
  }
}

Which would in turn generate an xml like

<group id="grpId1" resname="sampleInvocations">
  <trans-unit id="tu11" resname="sampleInvocations.1">
    <source xml:lang="de">Mit assistant app sprechen</source>
    <target xml:lang="de">Mit assistant app sprechen</target>
    <note>Sample invocation phrase displayed as part of app description in the directory of all agents.</note>
  </trans-unit>
</group>

Also, seems like the autoformat in my vim config did a little too much, let me know if that's fine or if i should just try and get a smaller diff, still passes all the npm lint checks

adrai commented 4 years ago

Yes, it would be nice, if you could try to keep the existing formatting, so the diff would be better...

adrai commented 4 years ago

Landed in v4.4.0 👍