Thanks to visit codestin.com
Credit goes to lunaria.dev

Skip to content

Getting Started

Lunaria is an localization management toolchain for open-source projects, giving the tools necessary for both maintainers and contributors to build a seamless and efficient localization workflow.

As a maintainer, managing localization efforts has never been easy, you’d always have to sacrifice the ownership of your content by moving into a localization platform or give up on reliably tracking your content for changes, until now. Lunaria solves both of these problems by enabling an entirely new workflow, powered by Git.

Every commit to select files is used to build a localization dashboard, giving each file its respective done/outdated/missing status. From the dashboard, maintainers get a detailed overview of their project’s localization status while contributors receive all the information they need to efficiently help, including links to the missing files and a list of commits that need to be added to the outdated content.

You can add Lunaria in your existing project by installing @lunariajs/core in your project’s dependencies using your preferred package manager:

Terminal window
npm install @lunariajs/core

Then, you can run lunaria init to setup Lunaria, prompting you with a few questions and automatically filling your answers in a new lunaria.config.mjs file:

Terminal window
npx lunaria init

Before building your first localization dashboard, you still need to fill in the sourceLocale, locales, and files fields of your Lunaria configuration file.

Visit the Configuration Reference guide to set them up and then follow the instructions below.

To build your localization dashboard, you can run the lunaria:build script added by lunaria init:

Terminal window
npm run lunaria:build

By default, the localization dashboard will be built to an index.html file in the ./dist/lunaria/ directory. This file can then be deployed to the hosting platform of your choice and shared across your contributors.

After building your dashboard, you should be able to run lunaria:preview to open a new preview server on http://localhost:3000/.

Terminal window
npm run lunaria:preview

Hooray! Your project’s localization is now fully tracked by Lunaria! 🌛

Lunaria comes with several features you can explore to make it suit your project best. Here are a few pages you can read next, in any order, to learn more about it: