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 

Queste opzioni possono essere specificate quando un file viene caricato e/o Scarica. A seconda del metodo di caricare/Scarica (API, CLI, sincronizzazione Repo ecc.), possono essere specificate nei parametri di query caricare, Scarica o nel file di configurazione phrase.yml.

enclose_in_cdata

include_translation_state

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

La differenza tra un .XLIFF Symfony e un .XLIFF standard risiede nel modo in cui individuano ciò che ogni <trans-unit> rappresenta. Mentre gli .XLIFF standard (e anche la maggior parte delle varianti .XLIFF supportate da altri framework) usano l'attributo ID, l' .XLIFF Symfony usa l'attributo resname come identificatore.

Per garantire che le Strings vengano caricate nelle impostazioni locali di destinazione corrette, l'attributo target-language nell'intestazione del file di un .XLIFF Symfony deve corrispondere al nome delle impostazioni locali configurato nel progetto pertinente.

Opzioni di formato

Identificatore 

enclose_in_cdata

Tipo 

booleano

Caricamento 

No

Download 

Predefinito 

false

Descrizione 

Racchiude le 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 

Includi lo stato delle traduzioni nelle impostazioni locali di destinazione. Ogni tag <target> otterrà un attributo state, che può essere uno dei seguenti: 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">
        <source xml:lang=\"it-IT\">Dai un'occhiata!</source> Questa chiave ha una descrizione!</source>
        <target xml:lang=\"it-IT\">Dai un'occhiata!</target> Questa chiave ha una descrizione! (Almeno in alcuni formati)</target>
        <note>Sono una descrizione molto importante per questa chiave!</note>
      </trans-unit>
      <trans-unit id="key_with_line-break" resname="key_with_line-break">
        <source xml:lang=\"it-IT\">Questa traduzione ha</source>
einen Zeilenumbruch.</source>
        <target xml:lang=\"it-IT\">Questa traduzione contiene
un'interruzione di riga.</target>
      </trans-unit>
      <trans-unit id="nested.deeply.key" resname="nested.deeply.key">
        <source xml:lang=\"it-IT\">Sono una chiave profondamente annidata</source>
        <target xml:lang=\"it-IT\">Sono una chiave profondamente annidata.</target>
      </trans-unit>
      <trans-unit id="nested.key" resname="nested.key">
        <source xml:lang=\"it-IT\">Questa chiave è annidata all'interno di uno spazio dei nomi.</source>
        <target xml:lang=\"it-IT\">Questa chiave è annidata all'interno di uno spazio dei nomi.</target>
      </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">---
- first item
- second item
- third item
</target>
      </trans-unit>
      <trans-unit id="simple_key" resname="simple_key">
        <source xml:lang="de-DE">Solo una chiave semplice con un messaggio semplice.</source>
        <target xml:lang="en-GB">Solo una chiave semplice con un messaggio semplice.</target>
      </trans-unit>
      <trans-unit id="unverified_key" resname="unverified_key">
        <source xml:lang="de-DE">Questa traduzione non è ancora verificata e attende!</source>
        <target xml:lang="en-GB">Questa traduzione non è ancora verificata e attende. (In alcuni formati esportiamo anche questo stato)</target>
      </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.