Reputation: 167
In the resource XML there are all these values associated with keys.I want to modify a value associated with a key directly from Java.
For instance,I have <entry key="greetingMessage">Welcome to my app</entry>
and this is displayed in the view,but also the message can be modified from the view and I want to be automatically updated in the XML.
I have managed to do this by parsing and changing the XML with javax.xml
and org.w3c
but I feel I am missing something.Does Java internationalization or Wicket framework have a method to achieve this?
Upvotes: 0
Views: 253
Reputation: 11865
Wicket only has facilities to read i18n resources (for example, XmlFilePropertiesLoader
). Properties.storeToXML()
is not used in Wicket 6 code, while Properties.loadFromXML()
is used to read those XML properties files.
To store those translations back to XML files you need to be cautious. At least, synchronization has to be implemented to make sure that simultaneous edits are not lost.
I'd not recommend to store the edits in XML (especially in the original XML files). It seems better to have two levels of properties:
Upvotes: 1