Tipos de arquivos aceitos (Strings)

.XML - Propriedades Java (Strings)

O conteúdo de toda a Central de Ajuda é traduzido automaticamente de inglês pelo Phrase Language AI.

Extensões de arquivo 

.xml

Extensão de API 

properties_xml

Importar 

Sim

Exportar 

Sim

Suporte para formas plurais 

Não

Suporte para descrição 

Sim

Propriedades XML Java é o equivalente XML do arquivo de Propriedades Java. As chaves de um arquivo de Propriedades Java existem como um atributo para o elemento entrada no XML, enquanto os valores são Strings de texto em linha aninhadas dentro das tags de entrada. Comparado com os arquivos de Propriedades Java padrão, o tipo XML oferece maior flexibilidade, pois você pode adicionar mais atributos ao elemento entrada. Por exemplo, você pode decidir que apenas chaves com um atributo class='traduzível' sejam selecionadas para tradução.

Amostra de código

<?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! This key has a description! (At least in some formats)</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 some formats we also export this status)</entry>
</properties>
Esse artigo foi útil?

Sorry about that! In what way was it not helpful?

The article didn’t address my problem.
I couldn’t understand the article.
The feature doesn’t do what I need.
Other reason.

Note that feedback is provided anonymously so we aren't able to reply to questions.
If you'd like to ask a question, submit a request to our Support team.
Thank you for your feedback.