0.1.18 • Published 3 months ago

@qualweb/locale v0.1.18

Weekly downloads
-
License
ISC
Repository
github
Last release
3 months ago

@qualweb/locale

Translation module for QualWeb reports.

How to install

  $ npm i @qualweb/locale --save

Language support

If you want a translation on your own language, follow these steps:

How to run

The best way to have a translated report is by using the @qualweb/core module, and passing the locale code you want in the options. If you really want to use this package separately bear in mind that the variables in the sentences wont be translated and some meaning can be lost.

'use strict';

import locales, { translateReport } from '@qualweb/locale';

async () => {
  // EvaluationReport only. EARL report is not currently supported. If you need a EARL report, convert the evaluation report after the translation. Check https://github.com/qualweb/earl-reporter
  const report = 'Evaluation report obtained from @qualweb/cli or @qualweb/core';

  const translatedReport = translateReport(report, 'en');
  // OR
  const translatedReport = translateReport(report, locales.en);
  // OR
  const ownLocale = {
    // If you have a compatible locale object
  };
  const translatedReport = translateReport(report, ownLocale);

  console.log(translatedReport);
};

License

ISC

0.1.18

3 months ago

0.1.17

4 months ago

0.1.16

4 months ago

0.1.12

8 months ago

0.1.14

6 months ago

0.1.15

5 months ago

0.1.11

2 years ago

0.1.10

2 years ago

0.1.8

2 years ago

0.1.9

2 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.4

3 years ago

0.1.5

3 years ago

0.1.3-alpha

3 years ago

0.1.2-alpha

3 years ago

0.1.1-alpha

3 years ago

0.1.0-alpha

3 years ago