Closed GoogleCodeExporter closed 9 years ago
The JSON Filter is very basic. It extracts objects in the form name/value pairs
and assumes the left side of the group is the resname.
Depending on the type of structure in the JSON file that may or may not
correspond to what you want.
To support more complex structures, for example where the resname is the name
of the parent object rather than the name of the object, like in your case, we
would need to implement some options.
It's certainly doable, along with other patterns (e.g. pairs of objects where
the value of the first object is the resname and the value of the second object
is the value to translate, etc.)
I've changed the issue to a request for enhancement.
Original comment by yves.sav...@gmail.com
on 14 Aug 2013 at 3:35
FYI: a new option to not use the key as the resname has been implemented.
See https://code.google.com/p/okapi/issues/detail?id=360
It'll be in the next snapshots.
It doesn't solve your issue, but may help getting you cleaner files.
Original comment by yves.sav...@gmail.com
on 14 Aug 2013 at 4:37
For the record:
json-path (https://code.google.com/p/json-path/) may be a good solution.
From Chase (http://tech.groups.yahoo.com/group/okapitools/message/3861)
Original comment by yves.sav...@gmail.com
on 28 Aug 2013 at 8:22
Looking at the javadoc for that implementation briefly, one sticking point is
that we may need to do extra work to produce an implementation that can
identify matching nodes, instead of just returning them. Otherwise it's going
to be difficult to produce a proper skeleton. Although I suppose we could just
write a custom merge that parses the JSON tree, applies the translation, and
then re-flattens it from scratch.
Original comment by tingley
on 28 Aug 2013 at 9:06
Looked at it further this morning; I'm not even sure *that* works. The problem
is that if you select a string value by path, you just the strings back, not
any kind of pointer to the location. This makes even replacing the value (ie,
with a reference) seemingly impossible.
So we'd need to write our own implementation, maybe.
Original comment by tingley
on 13 Nov 2013 at 11:36
The JSON files were built with the same flexibility than XML. The best way I
found to handle them, was to convert them to XML, and so, I was able to use
regular XML process.
Original comment by victor.j...@gmail.com
on 14 Nov 2013 at 2:18
Another example of structure requiring support:
"table": [
["Petrol", "51 - 63 kW<br />(69 - 85 PS)"],
["Max. Speed", "171 km/h"],
["Engines", "1.0 or 1.2 litre"],
["Transmission", "4-Speed Automatic or 5-Speed Manual"],
["CO2 Emission", "as low as 95 g/km<br />(1.0 with ISG)"]
]
See email here:
http://groups.yahoo.com/neo/groups/okapitools/conversations/messages/3853
Original comment by yves.sav...@gmail.com
on 6 Jan 2014 at 11:12
You can now enable full key names (off by default). The above key names would
be:
keys/INDX_WELCOME/value
keys/INDX_LOGOUT/value
You can write exception regex that will match on INDX_WELCOME|INDX_LOGOUT
The table structure that Yves sites as an example is also supported by the new
parser.
Original comment by jhargrav...@gmail.com
on 1 Apr 2014 at 12:50
Original issue reported on code.google.com by
victor.j...@gmail.com
on 14 Aug 2013 at 2:39