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 scaricato. A seconda del metodo di caricamento/scaricamento (API, CLI, sincronizzazione Repo, ecc.), possono essere specificate nei parametri di query Carica, 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 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 .XLIFF 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 siano caricate nella corretta impostazioni locali, l'attributo lingua di destinazione 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 <destinazione> tag avrà un attributo stato, che può essere uno di: nuovo, approvato, tradotto

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="de-DE">Guarda questo! Questa chiave ha una descrizione!</origine>
        <destinazione xml:lang="it-IT">Controllalo! Questa chiave ha una descrizione! (Almeno in alcuni formati)</destinazione>
        <nota>Sono una descrizione molto importante per questa chiave!</nota>
      </trans-unit>
      <trans-unit id="key_with_line-break" resname="key_with_line-break">
        <source xml:lang="de-DE">Diese Übersetzung hat
einen Zeilenumbruch.</source>
        <destinazione xml:lang="it-IT">Questa traduzione contiene
un a capo.</destinazione>
      </trans-unit>
      <trans-unit id="nested.deeply.key" resname="nested.deeply.key">
        <source xml:lang="de-DE">Ich bin ein tief verschachtelter Schlüssel</source>
        <destinazione xml:lang="it-IT">Sono una chiave profondamente annidata.</destinazione>
      </trans-unit>
      <trans-unit id="nested.key" resname="nested.key">
        <origine xml:lang="de-DE">Questa chiave è annidata all'interno di uno spazio dei nomi.</origine>
        <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">---
- first item
- second item
- third item
</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>
        <target xml:lang="it-IT">Solo una chiave semplice con un messaggio semplice.</target>
      </trans-unit>
      <trans-unit id="unverified_key" resname="unverified_key">
        <source xml:lang="de-DE">Diese Übersetzung ist noch nicht bestätigt und wartet drauf!</source>
        <target xml:lang="it-IT">Questa traduzione non è ancora verificata e aspetta di essere confermata. (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.