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

cloudux-l10n

v1.1.1

Published

Package for providing localization to avid static plugins

Downloads

96

Readme

cloudux-l10n

Package to providing localization for the Avid® MediaCentral UX static plugins.

Getting the localization files

To be able to get the localization files you have to request them through our API. Localization file will be fetched by using our internal mechanism that depends on the current runtime user locale.

Example

import localizationData from 'path/to/your/folder/lang.l10n.json'

Here is the lang.10n.json is the template file name, which will be replaced by the current language in the runtime. For instance, if current locale will be the 'de' name of the required file will be lang.de.json_

To be able to use this API you have to provide the localization files at your project. This is name convention in the name of this files that resolves by API. To be able to obtain the file according to the current runtime localization you should require some-file-name.l10n.json file where In case if German is being active locale, file name request will be resolved to some-string.de.json at runtime level to the name of the current locale. Localization has names according to ISO_639-1

Example of the file system structure

    static-plugin-folder/
    ├── src
    │   ├── index.js
    │   ├── l10n
    │   │   ├── lang.de.json
    │   │   ├── lang.fr.json
    │   │   └── lang.en.json
    │   └── views
    │       ├── settings-view
    │       │   ├── index.js

Localization file structure

Localization file has the flat json object structure. Nesting object is currently unsupported. Example of the lang.en.json:

{
 'hello-msg': 'Hello World'
}

the same file in different language will have the same key6 but localized value. For instance, in Deutch lang.de.json will be

{
 'hello-msg': 'Hallo Welt'
}

Require the localization file

In the above example we placed the three localization files in the folder named l10n. This localization should be required as an external module. For instance, by using AMD module pattern Or, if you are using the webpack, you have to add the path to localization file as an external dependency. See example below.

  //@file "static-plugin-folder/src/views/settings-view/index.js";
  const l10nData = require('../../l10n/lang.l10n.json'); // path relative to this file
  // If current locale is === "de" will be required file named lang.de.json
  // l10nData = { 'submit': 'Einreichen' };
  const localize = l10n.getLocalization(l10nData);
 

Parametrized labels

If you need parametrized labels, add parameters using {}: In your localization file:

{
   "copy-folder-part-of-items-error-message": "{​​​​​​0}​​​​​​ of {​​​​​​1}​​​​​​ items cannot be copied to the destination folder."
}

Usage:

localize('copy-folder-part-of-items-error-message', errorItemsCount, copyItemsCount)

You can check it on our examples on Avid-Technology Github