Tipi di file supportati (Strings)

.XLIFF - Symfony (Strings)

Contenuti tradotti automaticamente dall'inglese con Phrase Language AI.

Estensioni dei file 

.xlf, .xliff

Estensione API 

symfony_xliff

Importa 

Esporta 

Supporto forme plurali 

No

Supporto descrizione 

Opzioni di formato 

enclose_in_cdata

include_translation_state

Symfony è un framework PHP ad alte prestazioni composto da vari componenti PHP predefiniti. La localizzazione per le applicazioni costruite con Symfony può avvenire con formati di file come .XLIFF, .YAML e array PHP. 

La differenza tra un Symfony .XLIFF e un .XLIFF standard risiede nel modo in cui localizzano ciò che ciascun <trans-unit> rappresenta. Mentre gli .XLIFF standard (e anche la maggior parte delle variazioni .XLIFF supportate da altri framework) utilizzano l'attributo id, Symfony .XLIFF utilizza l'attributo resname come identificatore.

Per garantire che le stringhe vengano caricate nel corretto locale, l'attributo target-language nell'intestazione del file di un Symfony .XLIFF deve corrispondere al nome della locale configurato nel progetto pertinente.

Opzioni di formato

Identificatore 

enclose_in_cdata

Tipo 

booleano

Caricamento 

No

Download 

Predefinito 

false

Descrizione 

Includere traduzioni contenenti tag html in CDATA. Se disabilitato, le entità HTML non supportate vengono sostituite con i loro valori decodificati. Ad esempio:

  • &pound; viene sostituito con £.

  • &trade; viene sostituito con .

Identificatore 

include_translation_state

Tipo 

booleano

Caricamento 

No

Download 

Predefinito 

false

Descrizione 

Includere stato delle traduzioni nella locale di destinazione. Ogni <target> tag avrà un attributo state, che può essere uno di: new, signed-off, translated

Campione di codice

<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
  <file original="global" datatype="plaintext" source-language="de-DE" target-language="en-GB">
    <body>
      <trans-unit id="boolean_key" resname="boolean_key">
        <source xml:lang="de-DE">--- true
</source>
        <target xml:lang="en-GB">--- true
</target>
      </trans-unit>
      <trans-unit id="empty_string_translation" resname="empty_string_translation">
        <source xml:lang="de-DE"/>
        <target xml:lang="en-GB"/>
      </trans-unit>
      <trans-unit id="key_with_description" resname="key_with_description">
        <origine xml:lang="it-IT">Guarda mal! Questa chiave ha una descrizione!</chiave>
        <destinazione xml:lang="it-IT">Controllalo! Questa chiave ha una descrizione! (Almeno in alcuni formati)</destinazione>
        <nota>Io sono una descrizione molto importante per questa chiave!</nota>
      </trans-unit>
      <trans-unit id="key_with_line-break" resname="key_with_line-break">
        <origine xml:lang="it-IT">Questa traduzione ha
un'interruzione di riga.</origine>
        <destinazione xml:lang="it-IT">Questa traduzione contiene
a line-break.</target>
      </trans-unit>
      <trans-unit id="nested.deeply.key" resname="nested.deeply.key">
        <origine xml:lang="it-IT">Io sono una chiave profondamente annidata</origine>
        <destinazione xml:lang="it-IT">Io sono una chiave profondamente annidata.</destinazione>
      </trans-unit>
      <trans-unit id="nested.key" resname="nested.key">
        <source xml:lang="de-DE">Dieser Schlüssel ist innerhalb eines Namensraumes verschachtelt.</source>
        <destinazione xml:lang="it-IT">Questa chiave è annidata all'interno di uno spazio dei nomi.</destinazione>
      </trans-unit>
      <trans-unit id="null_translation" resname="null_translation">
        <source xml:lang="de-DE"/>
        <target xml:lang="en-GB"/>
      </trans-unit>
      <trans-unit id="sample_collection" resname="sample_collection">
        <source xml:lang="de-DE">---
- primo elemento
- secondo elemento
</source>
        <target xml:lang="en-GB">---
- primo elemento
- secondo elemento
- terzo elemento
</target>
      </trans-unit>
      <trans-unit id="simple_key" resname="simple_key">
        <source xml:lang="de-DE">Nur ein einfacher Schlüssel mit einer einfachen Nachricht.</source>
        <destinazione xml:lang="en-GB">Solo una chiave semplice con un messaggio semplice.</destinazione>
      </trans-unit>
      <trans-unit id="unverified_key" resname="unverified_key">
        <origine xml:lang="de-DE">Questa traduzione non è ancora verificata e sta aspettando!</origine>
        <destinazione xml:lang="en-GB">Questa traduzione non è ancora verificata e sta aspettando.</destinazione> (In alcuni formati esportiamo anche questo stato)
      </trans-unit>
    </body>
  </file>
</xliff>
Questo articolo ti è stato utile?

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.