Supported File Types (Strings)

.HTML (Strings)

File Extensions

.html

API Extension

html

Import

Yes

Export

Yes

Plural forms support

No

Description support

No

Format options

These options that can be specified when a file is uploaded and/or downloaded. Depending on the upload/download method (API, CLI, Repo sync etc.), they can be specified in query parameters Upload, Download or in the phrase.yml configuration file.

document_id

HTML is used in many contexts. Web development has moved away from static HTML files, but HTML content is still present, e.g. in the form of emails.

As with all supported formats, the system tries to extract keys and values from the document based on the XML tags that are used in the background. During this process, simple elements of the .HTML file (headlines, paragraphs, etc.) are detected correctly, but any more complex content is not supported.

All HTML tags are imported into the editor allowing accurate recognition of paragraphs.

Example:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Phrase Strings Example</title>
</head>
<body>
  <h1 data-i18n="page.title">Welcome to Our App</h1>
  <p data-i18n="page.subtitle">We hope you enjoy your stay.</p>

  <!-- XML-style block used to wrap translatable strings -->
  <translations>
    <string key="user.login.button">Log In</string>
    <string key="user.logout.button">Log Out</string>
    <string key="user.greeting">Hello, {{username}}!</string>
    <string key="form.error.required">This field is required.</string>
    <string key="form.error.email">Please enter a valid email address.</string>
  </translations>

  <!-- More UI content that might be identified as strings -->
  <button data-i18n="user.login.button">Log In</button>
  <button data-i18n="user.logout.button">Log Out</button>

  <!-- Embedded SVG (still XML!) -->
  <svg width="100" height="100">
    <text x="10" y="20" data-i18n="graphic.label">Chart</text>
  </svg>
</body>
</html>
  • When present on a translatable element, or its parent element for bare text nodes, the data-i18n attribute value becomes the segment key. When the attribute is absent or empty, Phrase generates a key from the segment's own text content instead.

  • The <translations> block with <string key="...">value</string> is an identifiable custom XML block.

  • Placeholders like {{username}} signal dynamic content.

Format Options

Identifier

document_id

Type

string

Upload

No

Download

Yes

Description

Takes the document ID of the existing HTML documents within the project the export should be based on.

Was this article helpful?

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.