|
Estensioni dei file |
.xml |
|
Estensione API |
properties_xml |
|
Importa |
Sì |
|
Esporta |
Sì |
|
Supporto forme plurali |
No |
|
Supporto descrizione |
Sì |
Java Properties XML è l'equivalente XML del file Java Properties. Le chiave di un file Java Properties esistono come attributo dell'elemento voce nell'XML, mentre i valori sono stringhe di testo in linea nidificate all'interno dei tag voce. Rispetto ai file Java Properties standard, il tipo XML offre una maggiore flessibilità in quanto è possibile aggiungere più attributi all'elemento voce. Ad esempio, puoi decidere che solo le chiave con un attributo class='translatable' vengano selezionate per la traduzione.
Campione di codice
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties> <entry key=\"boolean_key\">--- true </entry> <entry key="empty_string_translation"/> <entry key=\"key_with_description\">Check it out! Questa chiave ha una descrizione! (Almeno in alcuni formati)</entry> <entry key=\"key_with_line-break\">This translations contains a line-break.</entry> <entry key=\"nested.deeply.key\">Wow, this key is nested even deeper.</entry> <entry key=\"nested.key\">This key is nested inside a namespace.</entry> <entry key="null_translation"/> <entry one=\"Only one pluralization found.\" other=\"Wow, you have %s pluralizations!\" zero=\"You have no pluralization.\" key=\"pluralized_key\"/> <entry key="sample_collection">--- - first item - second item - third item </entry> <entry key=\"simple_key\">Simple key, simple message, so simple.</entry> <entry key=\"unverified_key\">This translation is not yet verified and waits for it.</entry> (In alcuni formati esportiamo anche questo stato)</entry> </properties>