BabelShark Knowledge Base
  • Introduction
  • BabelShark basics
    • Getting started
    • Project modes
    • Project languages
    • Code snippets
    • Source string markup
    • Setting visitor's language
    • Project associated texts
  • Setup
    • Recommended approach
    • Coexistence with other translators
    • Scopes
    • Performance
  • FAQ
  • Site owner's manual
    • Introduction
    • Real-time language statistics
    • Working in a team
  • Developer's manual
    • Embed BabelShark script
    • API Reference
      • BabelShark config
      • Language drop-down specs
    • HTML markup
      • Variables
      • Issues
    • Integrations
      • Tilda Publishing
        • Tilda website setup
        • Elements to localize
  • Manager's manual
    • Introduction
    • Community proofreaders
  • Proofreader's manual
    • Introduction
    • How to proofread
    • Checking translations
    • Translation types
    • Request of re-checks
Powered by GitBook
On this page
  1. Developer's manual
  2. HTML markup

Variables

PreviousHTML markupNextIssues

Last updated 1 year ago

It is often desirable to translate string with a variable value inside, like:

<p>Today is July 8th.</p>

or

<p>Deleting 80 of 200</p>

Obviously, you can not mark the whole HTML element (<p>) with __ class because it will generate infinite amount of source strings (for every date or every number used).

Use variables

Mark variable value of the string with __var class:

<p>
    Deleting <span class="__var">80</span> of
    <span class="__var">200</span>
</p>

This will exclude variable values from the source string. They will be replaced by {{VAR#}} value in a source string: