Parametric phrases
Posted by Gian Luca De Bonis on 10 February 2015 07:12 PM

Parametric phrases are phrases that contain variables (or parameters). A typical case is: "Page @1 of @2", a parametric phrase that can match any string like "Page .* of .*" (regular expression, match PB function syntax).

When a phrase contains parameters and it’s marked as parametric, the engine matches the actual phrase to translate with the parametric phrase, performs the translation, returns the translated phrase:

  • String to translate (EN->ES): Page 2 of 12
  • Engine search for "Page 2 of 12" - failed
  • Engine search for parametric phrases - matches: Page @1 of @2 (@1="2", @2="12")
  • Engine apply the translation (ES): Página @1 de @2
  • Engine substitutes parameters: @1="2", @2="12"
  • Engine returns: Página 2 de 12

In case the translation of "Page @1 of @2" is "Página @2\@1", the engine will translate "Page 2 of 12" as "Página 12\2".

Note: Extractor recognizes parametric phrases, but doesn’t mark all phrases as parametric. For example, is not a parametric phrase.

You can find more details on parametric phrases on the Quick Start guide, either in the Introduction section (point 2: Architecture) and in the Basic implementation section (point 3: Extract strings).




(1 vote(s))
Not helpful

Comments (0)