HTML

HTML and web template localization.

Translate the visible text of HTML pages and ASP, ASPX, PHP, or eRuby templates, with inline tags kept in the sentence and code protected, preview the translated page, and write de\index.html for each language. Your site keeps its layout, scripts, and language switch.

HTML localization: Professional and higher

Your source HTML index.html Lingobit Localizer New OrderNeue BestellungCustomerKundeCreateErstellen <strings></strings><item>OpenÖffnen</item><item>ExitBeenden</item> The text, translated in place;markup is protected You getindex.htmlde\index.htmlfr\index.htmlja\index.htmlA translated filefor each language;markup stays as it is Your sourceHTMLindex.html Translate in Lingobit New OrderNeue BestellungCustomerKundeCreateErstellen <strings></strings><item>OpenÖffnen</item><item>ExitBeenden</item> You getindex.htmlsourcede\index.htmlfr\index.htmlja\index.html
Input
.html, .xhtml, .asp, .aspx, .php, .erb
Output
The same page for each language, such as de\index.html
Runtime
Your site links or redirects to the language folder
Preview
The page, rendered, with the translation in place
On this page

Tutorial

Localize HTML pages with Lingobit, step by step.

Four steps from your pages to a translated copy for each language.

Your source HTML index.html Project DE FR JA LOC MySite.loc index.htmlHTML New Order Customer: order.phpPHP The order is saved. Send Format HTML HTML Your source HTML index.html Project DE FR JA LOC MySite.loc index.htmlHTML New Order Customer: order.phpPHP The order is saved. Send Format HTML HTML
  1. Your source HTML index.html Project DE FR JA LOC MySite.loc index.htmlHTML New Order Customer: order.phpPHP The order is saved. Send Format HTML HTML Your source HTML index.html Project DE FR JA LOC MySite.loc index.htmlHTML New Order Customer: order.phpPHP The order is saved. Send Format HTML HTML

Your files TMX XLIFF CSV Open file Ship today 100% Print preview Notify the customer. 95% Microsoft terms Cancel Folder Quantity only what matches the project Project Translation memory Ship today Noch heute versenden Notify the customer. Kunde benachrichtigen. Terminology Cancel Abbrechen Quantity Menge Your files TMX XLIFF CSV Open file Ship today100% Print preview Notify the customer.95% Microsoft terms CancelFolderQuantity only what matches the project Project Translation memory Ship today Noch heute versenden Notify the customer. Kunde benachrichtigen. Terminology Cancel→Abbrechen Quantity→Menge
ProjectDEFRJAMySite.locindex.htmlNew Orderorder.php PrepareTranslationTaskImportTranslationResults TranslatorDENew OrderNeue BestellungCustomer:Kunde:CreateErstellenSourceGermanNew OrderNeue BestellungCustomer:Kunde:Quantity:Menge:Validation on save Or their CAT toolXLIFF 1.2for the tool the translatoralready uses ProjectDEFRJAMySite.locindex.htmlNew Orderorder.php PrepareTranslation Task TranslatorDENew OrderNeue BestellungCustomer:Kunde:CreateErstellenSourceGermanNew OrderNeue BestellungCustomer:Kunde:Quantity:Menge:Validation on save Or their CAT toolXLIFF 1.2for the tool the translatoralready uses ImportResults
  1. Your files TMX XLIFF CSV Open file Ship today 100% Print preview Notify the customer. 95% Microsoft terms Cancel Folder Quantity only what matches the project Project Translation memory Ship today Noch heute versenden Notify the customer. Kunde benachrichtigen. Terminology Cancel Abbrechen Quantity Menge Your files TMX XLIFF CSV Open file Ship today100% Print preview Notify the customer.95% Microsoft terms CancelFolderQuantity only what matches the project Project Translation memory Ship today Noch heute versenden Notify the customer. Kunde benachrichtigen. Terminology Cancel→Abbrechen Quantity→Menge
  2. ProjectDEFRJAMySite.locindex.htmlNew Orderorder.php PrepareTranslationTaskImportTranslationResults TranslatorDENew OrderNeue BestellungCustomer:Kunde:CreateErstellenSourceGermanNew OrderNeue BestellungCustomer:Kunde:Quantity:Menge:Validation on save Or their CAT toolXLIFF 1.2for the tool the translatoralready uses ProjectDEFRJAMySite.locindex.htmlNew Orderorder.php PrepareTranslation Task TranslatorDENew OrderNeue BestellungCustomer:Kunde:CreateErstellenSourceGermanNew OrderNeue BestellungCustomer:Kunde:Quantity:Menge:Validation on save Or their CAT toolXLIFF 1.2for the tool the translatoralready uses ImportResults

Output · Validation HTML Tags mismatch index.html · p Fixed Resource index.html · p Source Export {0} pages to {1}. Export %d pages to %s. Export <b>all</b> pages. Export %1 pages to %2. German {0} Seiten nach {2} exportieren. %d Seiten nach %d exportieren. <b>Alle</i> Seiten exportieren. %1 Seiten nach %3 exportieren. {0} Seiten nach {1} exportieren. %d Seiten nach %s exportieren. <b>Alle</b> Seiten exportieren. %1 Seiten nach %2 exportieren. Output · Validation HTML Tags mismatch index.html · p Fixed index.html · p Source Export {0} pages to {1}. Export %d pages to %s. Export <b>all</b> pages. Export %1 pages to %2. German {0} Seiten nach {2} exportieren. %d Seiten nach %d exportieren. <b>Alle</i> Seiten exportieren. %1 Seiten nach %3 exportieren. {0} Seiten nach {1} exportieren. %d Seiten nach %s exportieren. <b>Alle</b> Seiten exportieren. %1 Seiten nach %2 exportieren.
  1. Output · Validation HTML Tags mismatch index.html · p Fixed Resource index.html · p Source Export {0} pages to {1}. Export %d pages to %s. Export <b>all</b> pages. Export %1 pages to %2. German {0} Seiten nach {2} exportieren. %d Seiten nach %d exportieren. <b>Alle</i> Seiten exportieren. %1 Seiten nach %3 exportieren. {0} Seiten nach {1} exportieren. %d Seiten nach %s exportieren. <b>Alle</b> Seiten exportieren. %1 Seiten nach %2 exportieren. Output · Validation HTML Tags mismatch index.html · p Fixed index.html · p Source Export {0} pages to {1}. Export %d pages to %s. Export <b>all</b> pages. Export %1 pages to %2. German {0} Seiten nach {2} exportieren. %d Seiten nach %d exportieren. <b>Alle</i> Seiten exportieren. %1 Seiten nach %3 exportieren. {0} Seiten nach {1} exportieren. %d Seiten nach %s exportieren. <b>Alle</b> Seiten exportieren. %1 Seiten nach %2 exportieren.

Project Open Öffnen Save Speichern Print Drucken Export Exportieren Removed Help Hilfe Scan for Changes New build Open Öffnen Save Speichern Print all Updated Help Hilfe Share New Project Öffnen Speichern Drucken Exportieren Hilfe Removed Scan for Changes New build Open Öffnen Save Speichern Print all Updated Help Hilfe Share New
  1. Project Open Öffnen Save Speichern Print Drucken Export Exportieren Removed Help Hilfe Scan for Changes New build Open Öffnen Save Speichern Print all Updated Help Hilfe Share New Project Öffnen Speichern Drucken Exportieren Hilfe Removed Scan for Changes New build Open Öffnen Save Speichern Print all Updated Help Hilfe Share New

A sentence stays whole, its tags stay protected.

Lingobit reads the text of the page, not the markup. A sentence with <b> or <i> inside is one string, with the tags shown as protected parts the translator can move but not break. Visible attributes, such as alt and title, are translated too; scripts, styles, and server code are not offered.

Your HTML <p>Click <b>Save</b> to keep <i>all</i> changes.</p> <img src="logo.png" alt="Company logo"> ProjectSourceClick <b>Save</b> to keep <i>all</i> changes.GermanKlicken Sie auf <b>Speichern</b>, um <i>alle</i> Änderungen zu behalten.altCompany logoGermanFirmenlogo One sentence with its inline tags, not five fragments. The tags are protected and may move where German needs them. Selected attributes such as alt are translated too. Your HTML <p>Click <b>Save</b> to keep <i>all</i> changes.</p> <img alt="Company logo"> ProjectSourceClick <b>Save</b> to keep <i>all</i> changes.GermanKlicken Sie auf <b>Speichern</b>, um<i>alle</i> Änderungen zu behalten.altCompany logoGermanFirmenlogo One sentence with its tags, not five fragments; the tags are protected and may move.

Lingobit does

  • Translates visible text, whole sentences with their inline tags, and the attributes your rules select.
  • Shows the page in the preview, with the translation in place.
  • Checks HTML tags, entities, placeholders, and more.
  • Writes the same page for each language, markup and code unchanged.

Your site keeps

  • Layout, styles, and scripts.
  • Server code in ASP, PHP, or eRuby, and the text it prints.
  • The language switch and the links between language folders.
  • Deployment and the final test in the browser.

Reference

What Lingobit reads in a page.

The settings are on the Parser page of each file: Do not break text on following tags, Parse attributes, Parse comments, and Parse named entities.

Parts of an HTML page and how Lingobit treats them
In the pageIn Lingobit
Text of elementsTranslated, one sentence at a time
<b>, <i>, <strong>, <sub> and similarKept inside the sentence as protected tags
<em>, <a>, <span>Kept inside the sentence too in a new project; a project from an earlier version keeps its list in Do not break text on following tags
AttributesThose the attribute rules select; alt, title, placeholder, aria-label, and META description by default in a new project
langOffered, so each language can set its own code
Scripts, styles, server codeNot offered; text that code prints is not translated
CommentsNot offered, unless Parse comments is on

Attribute rules.

Each rule in Parse attributes is a condition on the tag, the attribute, and other attributes of the element. The defaults cover alt, title, META title, description, and keywords, input and button values, and option labels; links and image paths are there but off. A new project also has rules for placeholder and aria-label; a project from an earlier version needs them added:

Attribute rules and what they translate
RuleTranslates
Tag="IMG" and Attr="Alt"Image alternative text (on by default)
Tag="META" and Attr="content" and @Name="description"The page description (on by default)
Attr="placeholder"Placeholder text in fields (on in a new project)
Attr="aria-label"Labels for screen readers (on in a new project)
Tag="IMG" and Attr="Src"Image paths, for images with text in them (off by default)

Do and don't.

Do

  • In a project from an earlier version, add EM, A, and SPAN to Do not break text on following tags, and rules for placeholder and aria-label: a new project has them.
  • Keep text out of scripts and server code, or move it into the page.
  • Check translated pages in the preview, then in the browser.

Don't

  • Build sentences in code from translated pieces.
  • Edit de\index.html by hand: the next Create overwrites it.
  • Turn on rules for links and image paths unless each language has its own.
  • Send page source or templates to translators: they work in Lingobit.

Troubleshooting.

Symptoms, causes, and what to do
SymptomLikely causeWhat to do
A sentence arrives in piecesIt contains server code, or a tag that is not in Do not break text on following tags, as in a project from an earlier versionAdd the tag to Do not break text on following tags; move code out of the sentence
Placeholders and screen reader labels stay in EnglishThe project was created with an earlier version, without these rulesAdd Attr="placeholder" and Attr="aria-label" to Parse attributes
Some text stays in English on the pageA script or server code prints itMove the text into the page, or into a resource your code reads
A translated page looks brokenA translation changed or dropped an inline tagRun Validation: it reports HTML tags that differ from the source

The HTML sample.

Localizer installs an HTML website sample with its project, so you can try the steps above without your own site.

  • Five pages in the en folder, with styles, images, and a script menu, in German and French.
  • Create Localized Files writes the de and fr folders next to en; the start page links to all three.

More about HTML and template localization.

PHP, ASP, ASPX, and ERB templates

HTML-based application files often contain server-side code. Lingobit filters the code out and offers only the page text: in this PHP file translators get Welcome to your account. and Change settings, not <?php echo $pageTitle; ?>.

<h1><?php echo $pageTitle; ?></h1>
<p>Welcome to your account.</p>
<a href="../../settings">Change settings</a>

In ERB, <%= @title %> and the control flow stay protected the same way. Template localization suits file-based and legacy workflows; it does not replace the internationalization of a modern web framework.

Where the translated pages go

By default de\index.html is written in the language folder next to each page. The output pattern of the format, for the project or one file, sets another layout:

$(OutputDir)\$(CultureName)\$(SrcFileName)$(SrcFileExt)    de\index.html   (default)
$(OutputDir)\$(SrcFileName).$(CultureName)$(SrcFileExt)    index.de.html

To keep the structure of a whole site, add its folder to the project (Add Folder, Enterprise) and set the output folder to $(ProjectDir)\out\$(CultureName) with the pattern $(OutputDir)\$(SrcFileName)$(SrcFileExt): about\index.html becomes out\de\sitebout\index.html. Pages of the same name added as separate files share one output folder and overwrite each other.

JavaScript and modern frameworks

Do not give whole JavaScript files to translators: they mix text with logic, framework code, and build output. Bundled or minified files, React, Vue, Angular, or Svelte components, and runtime-generated text are not a good localization source. When an application already uses i18n resource files, localize those files instead of the components.

Protected attributes

Attributes that define structure and behavior stay out of translation unless a project deliberately adds a rule:

id  class  style  href  src  data-*  onclick  onchange  name  for  role  type
Which files fit

Good candidates are static HTML files, help pages, legacy ASP, PHP, or ERB templates with clear text, and files that keep stable relative paths between releases. Take care with files that mix heavy code and visible text, generated files that will be overwritten, and HTML assembled from many runtime fragments.