Format reference

⌘K
  1. Home
  2. Translator++ Developer&#8...
  3. .trans file
  4. Format reference

Format reference

Examples

Below is the working example of .trans file :

{
   "columns":[
      {
         "readOnly":false
      },
      {
         "readOnly":false
      },
      {
         "readOnly":false
      },
      {
         "readOnly":false
      },
      {
         "readOnly":false
      },
      {

      },
      {

      },
      {

      }
   ],
   "colHeaders":[
      "Original Text",
      "Initial",
      "Machine translation",
      "Better translation",
      "Best translation",
      "E",
      "F",
      "G"
   ],
   "project":{
      "indexOriginal":0,
      "indexTranslation":1,
      "skipElement":[
         "note",
         "Comment",
         "Script"
      ],
      "gameEngine":"spreadsheet",
      "gameTitle":"sheets",
      "projectId":"6d321d41db04f8ef0949d8a22adf13d4",
      "cache":{
         "cacheID":"6d321d41db04f8ef0949d8a22adf13d4",
         "cachePath":"\\path\\to\\Translator++\\www\\php\\cache\\6d321d41db04f8ef0949d8a22adf13d4"
      },
      "buildOn":"2019-12-19 06:52:14",
      "appVersion":"0.9",
      "loc":"F:\\test\\sheets",
      "files":{
         "test.xlsx":{
            "dirname":"data",
            "basename":"test.xlsx",
            "extension":"xlsx",
            "filename":"test",
            "path":"data/test.xlsx",
            "data":[
               [
                  "keyword2",
                  "translation",
                  "better translation",
                  "even better translation",
                  "best translation",
                  "",
                  "",
                  null
               ],
               [
                  "keyword1",
                  "translation",
                  null,
                  null,
                  null,
                  null,
                  null,
                  null
               ],
               [
                  "keyword2",
                  null,
                  null,
                  null,
                  null,
                  null,
                  null,
                  null
               ],
               [
                  "keyword3",
                  null,
                  null,
                  null,
                  null,
                  null,
                  null,
                  null
               ],
               [
                  "keyword4",
                  null,
                  null,
                  null,
                  null,
                  null,
                  null,
                  null
               ],
               [
                  "keyword5",
                  null,
                  null,
                  null,
                  null,
                  null,
                  null,
                  null
               ],
               [
                  "keyword6",
                  null,
                  null,
                  null,
                  null,
                  null,
                  null,
                  null
               ],
               [
                  "keyword7",
                  null,
                  null,
                  null,
                  null,
                  null,
                  null,
                  null
               ]
            ],
            "type":null,
            "relPath":"test.xlsx",
            "context":[
               ["sheet1/0/0", "sheet2/0/1"],
               ["sheet1/0/2"],
               null,
               null,
               null,
               null,
               null,
               null
            ]
         }
      }
   }
}

columns:

Configuration of the columns.

value : array of object

example:

"columns": [
      {
         "readOnly":false
      },
      {
         "readOnly":false
      },
      {
         "readOnly":false
      },
      {
         "readOnly":false
      },
      {
         "readOnly":false
      }
]

colHeaders :

Label of the columns

value : array of string

Example :

"colHeaders":[
      "Original Text",
      "Initial",
      "Machine translation",
      "Better translation",
      "Best translation",
      "E",
      "F",
      "G"
   ]

The length of colHeaders must be same with column value.

project:

the object that hold the translation informations

value : object

example :

"project":{
  "indexOriginal":0,
  "indexTranslation":1,
  "skipElement":[
	 "note",
	 "Comment",
	 "Script"
  ],
  "gameEngine":"spreadsheet",
  "gameTitle":"sheets",
  "projectId":"6d321d41db04f8ef0949d8a22adf13d4",
  "cache":{
	 "cacheID":"6d321d41db04f8ef0949d8a22adf13d4",
	 "cachePath":"\\path\\to\\Translator++\\www\\php\\cache\\6d321d41db04f8ef0949d8a22adf13d4"
  },
  "buildOn":"2019-12-19 06:52:14",
  "appVersion":"0.9",
  "loc":"F:\\test\\sheets",
  "files":{
	 "test.xlsx":{
		"dirname":"data",
		"basename":"test.xlsx",
		"extension":"xlsx",
		"filename":"test",
		"path":"data/test.xlsx",
		"data":[
		   [
			  "keyword2",
			  "translation",
			  "better translation"
		   ],
		   [
			  "keyword1",
			  "translation",
			  null
		   ],
		   [
			  "keyword2",
			  null,
			  null
		   ]
		],
		"type":null,
		"relPath":"test.xlsx",
		"context":[
		   ["sheet1/0/0", "sheet2/0/1"],
		   ["sheet1/0/2"],
		   null
		]
	 }
  }
}

project.gameEngine:

Engine description

value : string

project.files:

Enclosure of files data

Value: object

project.files.data:

Two dimensional array representation of rows and columns.

value: two dimensional array of strings

"data":[
   [
	  "keyword2",
	  "translation",
	  "better translation",
	  "even better translation",
	  "best translation",
	  "",
	  "",
	  null
   ],
   [
	  "keyword1",
	  "translation",
	  null,
	  null,
	  null,
	  null,
	  null,
	  null
   ],
   [
	  "keyword2",
	  null,
	  null,
	  null,
	  null,
	  null,
	  null,
	  null
   ]
]

project.files.context:

Two dimensional array representation of row and their corresponding array of context.

Value : two dimensional array of string

Example :

		"context":[
		   ["sheet1/0/0", "sheet2/0/1"],
		   ["sheet1/0/2"],
		   null
		]

project.files[].keyColumn:

key column. Default is 0. Not implemented yet

project.files[].preferredTranslationColumn:

Prefered translation column. Default is null which is automatic. Not implemented yet

Was this article helpful to you? No Yes

How can we help?