Skip to content

Information for localizers

Max edited this page Mar 29, 2022 · 2 revisions

Escaped tags

You may encounter encoded entities (tags). For example, &lt;b&gt;test&lt;/b&gt; is the encoding of <b>test</b>. Note, that encoded entities start with an ampersand and end with a semicolon. There are no spaces in between any of that. Sometimes, you may encounter incorrectly double-escaped encodings like &amp;lt; (instead of &lt;). Please, leave those as they are.

Placeholders

Sometimes strings have variables (placeholders) which look like the pictures below.

string with placeholders example 1 or string with placeholders example 2

In these cases you should:

  • Use your mouse and click on the placeholder to insert it into the cursor position of your translation. You do not need to modify anything within the placeholder.
  • The text inside the ex tags of the placeholder is an example for you, the translator, of values that would be used in this placeholder.
  • When placeholders contain URLs, you may receive a warning from Transifex about a missing URL:
    Missing URL warning example
    You can ignore such warnings.
  • If you do not use Transifex edit for translating, please, see the Manual handling of placeholders section below.

Sometimes you may encounter other types of placeholders such as double square or double squiggly brackets. Do not translate terms inside these placeholders (for example, [[user]] or {{user}} should be left as is).

Plural strings

Sometimes strings support single/plural versions. Such strings support ICU plural rules and look similar to this:

{COUNT, plural,
          =0 {Open all in &amp;private window}
          =1 {Open in &amp;private window}
          other {Open all ({COUNT}) in &amp;private window}}
Only the bolded text in the above example should be translated. Terms COUNT (or any other term after the initial '{'), plural, other should NOT be translated.

Escaped characters

If you see &#8217; in the text, that is an encoded apostrophe(). For example, you&#8217;re is just you're in which case you don't need to preserve this encoded sequence in the translation.
Other common codes:

  • &#8211; - en dash()
  • &#8212; - em dash()
  • &#8216; - opening single quote()
  • &#8230; - ellipsis()
  • Note: standalone &amp; (or &amp;amp;), &lt; (or &amp;lt;), or &gt; (or &amp;gt;), if needed in the localized string, should be left as they are. For example, Bob &amp; Jim, or System &gt; Settings should stay that way.

Branding

In branded feature names, such as "Brave", "Brave Rewards", and "Brave Ads", do not translate Brave, but do translate the feature name ("Rewards", "Ads", etc.).

Manual handling of placeholders

If you are translating strings containing placeholders outside the Transifex editor the source string would look similar to this:

string with placeholders example

When translating:

  • Use <ph to replace &lt;ph
  • Leave name="EXTENSION_NAME" part as is, then
  • Use > to replace &gt;
  • Leave $1 ($2, etc.) as is
  • If present, replace &lt;ex&gt; with <ex> and &lt;/ex&gt; with </ex>
  • Replace &lt;/ph&gt; with </ph>
  • DO NOT replace &lt; and &gt; when they surround other elements, such as a (&lt;a... and &lt;a/&gt; should not be modified).

The text inside the resulting <ex>...</ex> tags doesn't need to be translated - it's an example for you, the translator, of values that would be used in this variable.

In the example in the graphic above, the translation should look like this:

Source: &lt;ph name="EXTENSION_NAME"&gt;$1&lt;/ph&gt; (extension ID "&lt;ph name="EXTENSION_ID"&gt;$2&lt;ex&lt;abacabadabacabaeabacabadabacabaf&lt;/ex&lt;&lt;/ph&gt;") is not allowed in Brave.
Translation: <ph name="EXTENSION_NAME">$1</ph> (translate this "<ph name="EXTENSION_ID">$2<ex>do not translate this</ex></ph>") translate this too.

As noted above, you may encounter other encoded tags inside the <ph> tags: for example, &lt;ph name="BEGIN_BOLD1"&gt;&amp;lt;b1&amp;gt;&lt;/ph&gt;. These encoded tags inside <ph> tags should be left as they are, in this case resulting in:

Source: &lt;ph name="BEGIN_BOLD1"&gt;&amp;lt;b1&amp;gt;&lt;/ph&gt;
Translation: <ph name="BEGIN_BOLD1">&amp;lt;b1&amp;gt;</ph>
Clone this wiki locally