2017 © Pedro Peláez
 

typo3-flow-package xliftojson

Add description here

image

itplusx/xliftojson

Add description here

  • Wednesday, June 29, 2016
  • by vjanoch
  • Repository
  • 2 Watchers
  • 0 Stars
  • 352 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 2 % Grown

The README.md

XlifToJson

Description

Parse .xlif translation file to a .json file.

Only tagged translations will be transfered into the .json. The tag is an attribute in the element. It's value is used as the source value in the resulting .json, (*1)

To have a translation transfered to json the trans-unit element has to look like:, (*2)

<trans-unit [...] [attribute-name]="Json source name">
    <source>xlif source name</source>
    <target>xlif target name</target>
</trans-unit>

The above example is converted to json like this:, (*3)

{
    "Json source name": "xlif target name"
}

If in xlif the element <target> is not available the content of <source> is used instead.​, (*4)


Usage

  • Navigate to the project directory where flow is installed.
  • Use the following command with the parameters described below:
./flow xliftojson:parseXLF --pathToInputXlf "[/INPUT/PATH/TO].xlf" --pathToOutputJson "[/OUTPUT/PATH/TO].json" --attribute "[ATTRIBUTE-NAME]"
  • Description of the parameters:, (*5)

    • This is the call of the command controller: ./flow xliftojson:parseXLF
    • This parameter is the absolute path to the .xlf (input) file: --pathToInputXlf "[/INPUT/PATH/TO].xlf"
    • This parameter is the absolute path to the .json (output) file: --pathToOutputJson "[/OUTPUT/PATH/TO].json" Easiest way to get the absolute path is to navigate to the file in the bash and type pwd.
    • This is the attribute-name marking the trans-unit to be transfered (most likely something like 'jsonTranslate'): --attribute "[ATTRIBUTE-NAME]"
  • Alternative: If used without the parameters (just: ./flow xliftojson:parseXLF) you will be asked for the parameters one after another., (*6)

The Versions

29/06 2016

dev-master

9999999-dev

Add description here

  Sources   Download

The Requires