npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@grace-studio/umbraco-translations

v0.1.1

Published

[![npm version](https://badge.fury.io/js/@grace-studio%2Fumbraco-translations.svg)](https://badge.fury.io/js/@grace-studio%2Fumbraco-translations)

Downloads

104

Readme

@grace-studio/umbraco-translations

npm version

Overview

@grace-studio/umbraco-translations is a lightweight tool designed to fetch dictionary files from a custom Umbraco API endpoint and transform them into one JSON file per locale. It's perfect for localization workflows and simplifies integration with pipelines or CI/CD processes.

Installation

Global Installation

Install the package globally for system-wide usage:

npm i -g @grace-studio/umbraco-translations
# or
yarn global add @grace-studio/umbraco-translations

Local Installation

Alternatively, install it locally within your project (e.g., as a dev dependency):

npm i -D @grace-studio/umbraco-translations
# or
yarn add -D @grace-studio/umbraco-translations

Usage

Using CLI Parameters

Run the following command with the appropriate parameters:

umbraco-translations \
  --apiUrl <api-url> \
  --out <output-directory> \
  --default <default-locale> \
  --force

| Parameter | Description | Required | | ------------- | ------------------------------------------- | ------------ | | --apiUrl | The Umbraco API endpoint to fetch data from | Yes | | --out | Output directory for generated JSON files | Yes | | --default | The default locale (e.g., sv, en) | Yes | | --force | Force overwrite without confirmation | No |

Using Configuration File

Instead of passing CLI parameters, you can define a .gracefulrc.json configuration file in your project root:

{
  "umbraco-translations": {
    "apiUrl": "https://example.umbraco.io",
    "out": "./output/dir",
    "default": "sv",
    "force": true
  }
}

Once the configuration file is in place, simply run:

umbraco-translations

Example output

For the configuration above, JSON files for each locale will be saved in the ./output/dir directory.

Environment Variables

To keep sensitive information secure, you can define the API URL and access token in a .env file:

UMBRACO_DICTIONARY_API_URL=https://example.umbraco.io
UMBRACO_DICTIONARY_ACCESS_TOKEN=your-secret-access-token

This approach is especially useful for CI/CD pipelines and avoids hardcoding sensitive data.

Example Workflow

  1. Prepare Configuration: Set up .gracefulrc.json or use CLI parameters to configure the tool.
  2. Run the Tool: Execute the command umbraco-translations to generate JSON files.
  3. Integration: Use the generated locale JSON files in your application or deploy them as needed.

Features

  • Supports fetching dictionary files from any custom Umbraco endpoint.
  • Outputs one JSON file per locale, ready for use in applications.
  • Configurable via CLI, JSON configuration file, or environment variables.
  • Designed for seamless integration into localization workflows and pipelines.