Difference between revisions of "Translating JSON"

From Apertium
Jump to navigation Jump to search
(Created page with "TODO: simple method to translate json files (like the ones in apertium-html-tools) this halfway works: jq 'to_entries|.[]|{ (.key):("</apertium-notrans>\(.value)<apertium-...")
 
 
(3 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
this halfway works:
 
this halfway works:
   
jq 'to_entries|.[]|{ (.key):("</apertium-notrans>\(.value)<apertium-notrans>") }'
+
<infile.json jq 'to_entries|.[]|{ (.key):("</apertium-notrans>\(.value)<apertium-notrans>") }' <nn/translation.json |
  +
grep -v '^[{}]$' |
  +
sed -e 's/$/,/' -e '$a }</apertium-notrans>' -e '1i <apertium-notrans>{' |
  +
apertium -u nob-nno -f html-noent >outfile.json
  +
  +
   
   
Line 10: Line 15:
 
==See also==
 
==See also==
 
* [[Format handling]]
 
* [[Format handling]]
  +
* [[Tips for translators]]
 
   
 
[[Category:Tools]]
 
[[Category:Tools]]

Latest revision as of 09:13, 30 May 2014

TODO: simple method to translate json files (like the ones in apertium-html-tools)


this halfway works:

<infile.json jq 'to_entries|.[]|{ (.key):("</apertium-notrans>\(.value)<apertium-notrans>") }' <nn/translation.json |
grep -v '^[{}]$' |
sed -e 's/$/,/' -e '$a }</apertium-notrans>' -e '1i <apertium-notrans>{' |
apertium -u nob-nno -f html-noent >outfile.json



See also[edit]