tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

prefer-formatValues.rst (552B)


      1 prefer-formatValues
      2 ===================
      3 
      4 Rejects multiple calls to document.l10n.formatValue in the same code block, to
      5 reduce localization overheads.
      6 
      7 Examples of incorrect code for this rule:
      8 -----------------------------------------
      9 
     10 .. code-block:: js
     11 
     12    {
     13      document.l10n.formatValue('foobar');
     14      document.l10n.formatValue('foobaz');
     15    }
     16 
     17 Examples of correct code for this rule:
     18 ---------------------------------------
     19 
     20 .. code-block:: js
     21 
     22    document.l10n.formatValue('foobar');
     23    document.l10n.formatValues(['foobar', 'foobaz']);