Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lunariajs/core

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lunariajs/core

Translation management system for open-source projects

  • 0.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
337
decreased by-33.27%
Maintainers
1
Weekly downloads
 
Created
Source

@lunariajs/core

The @lunariajs/core package contains the base tracking and dashboard generation systems used across its related packages. You should use this package if:

  • You need fine-grained control over your dashboard
  • You want to build a package over it
  • There isn't a framework-specific @lunariajs package for your use-case

Installation

You can install @lunariajs/core using your preferred package manager:

# npm
npm install @lunariajs/core

# pnpm
pnpm add @lunariajs/core

# yarn
yarn add @lunariajs/core

Basic Usage

Start using @lunariajs/core by setting up a script to generate your translation dashboard status.

The example below contains all of the required options to generate a dashboard tracking the status of both the Portuguese and Spanish translations of a site:

// scripts/translation-status.js
import { createTracker } from '@lunariajs/core';

const tracker = await createTracker({
  // Current repository of this script and content
  repository: 'https://github.com/me/cool-docs',
  dashboard: {
    // Generated dashboard URL used in meta tags
    url: 'https://tracker.cool-docs.com',
  },
  // Information about the source locale of your content
  defaultLocale: {
    // User-friendly label/name of the language
    label: 'English',
    // BCP-47 tag of the language
    lang: 'en',
    content: {
      // Glob pattern of where your content is
      location: 'content/en/**/*.md',
    },
  },
  // Array of objects of your translated locales.
  locales: [
    {
      label: 'Português',
      lang: 'pt',
      content: {
        location: 'content/pt/**/*.md',
      },
    },
    {
      label: 'Spanish',
      lang: 'es',
      content: {
        location: 'content/es/**/*.md',
      },
    },
  ],
  /** Property containing a boolean value used in files that support frontmatter to mark that the content should be translated */
  translatableProperty: 'i18nReady',
});

tracker.run();

Want other usage examples? Head over to the examples/ directory and inspect the source code for tips & tricks about using @lunariajs/core with other frameworks and environments.

Keywords

FAQs

Package last updated on 28 Oct 2023

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