@shopify/translation-platform-utilities

Utilities for working with Shopify's translation platform configuration files.

Usage no npm install needed!

<script type="module">
  import shopifyTranslationPlatformUtilities from 'https://cdn.skypack.dev/@shopify/translation-platform-utilities';
</script>

README

@shopify/translation-platform-utilities

License: MIT npm version

Utilities for working with Shopify's translation platform configuration files.

Installation

$ yarn add @shopify/translation-platform-utilities

Usage

import {loadLocales} from '@shopify/translation-platform-utilities';

const locales = await loadLocales({
  rootDirectory: this.rootPath,
});

locales.forEach((locale) => {
  console.log(locale);
});

CLI Usage

In shopify-build with parallelism enabled , sewing-kit-locale can be used to determine the locale for the current build job, e.g.:

$ yarn --silent shopify-build-locale
> en