New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@qualweb/locale

Package Overview
Dependencies
Maintainers
0
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qualweb/locale

Locales for @qualweb/core evaluation reports.

  • 0.0.0-develop-20241204125016
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@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:

  1. Make a copy of src/locales/en.ts and rename it to use the lang code (check 639-1 column)
  2. Translate the modules you want
  3. Update the README.md language support table
  4. Make a pull request with the changes
LanguageCodeModules support
act-ruleswcag-techniquesbest-practices
EnglishenFullFullFull
FinnishfiFullnonenone
SwedishsvFullnonenone
Norwegian BokmålnbFullnonenone
Norwegian NynorsknnFullnonenone

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 = new ReportTranslator('en').translate(report);
  // OR
  const translatedReport = new ReportTranslator(locales.en).translate(report);
  // OR
  const ownLocale = {
    // If you have a compatible locale object
  };
  const translatedReport = new ReportTranslator(ownLocale).translate(report);

  console.log(translatedReport);
};

License

ISC

Keywords

FAQs

Package last updated on 04 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc