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

@bbc/psammead-locales

v5.0.7

Published

A collection of locale configs, used in BBC World Service sites

Downloads

71

Readme

psammead-locales - Known Vulnerabilities Dependency Status peerDependencies Status GitHub license npm version PRs Welcome

This package provides a collection of locale configs, used in BBC World Service sites.

Exports

Moment locales

The following Moment.js locales have been added as they do not exist upstream:

  • /moment/am - locale override for Amharic
  • /moment/ha - locale for Hausa
  • /moment/ig - locale for Igbo
  • /moment/om - locale override for Afaan Oromoo
  • /moment/pcm - locale for Pidgin
  • /moment/ps - locale for Pashto
  • /moment/rw - locale for Gahuza
  • /moment/so - locale for Somali
  • /moment/ti - locale for Tigrinya

The following locales have overrides to meet BBC World Service requirements where these differ from the upstream locale. Note that importing them will also cause the upstream locale to be loaded.

  • /moment/ar - locale override for Arabic
  • /moment/az - locale override for Azeri
  • /moment/bn - locale override for Bengali
  • /moment/es - locale override for Spanish (Mundo)
  • /moment/gu - locale override for Gujarati
  • /moment/hi - locale override for Hindi
  • /moment/ky - locale override for Kyrgyz
  • /moment/mr - locale override for Marathi
  • /moment/ne - locale override for Nepali
  • /moment/pa-in - locale override for Punjabi
  • /moment/pt-br - locale override for Brasil
  • /moment/ru - locale override for Russian
  • /moment/si - locale override for Sinhala
  • /moment/sr - locale override for Serbian
  • /moment/sr-cyrl - locale override for Serbian Cyrillic
  • /moment/sw - locale override for Swahili
  • /moment/ta - locale override for Tamil
  • /moment/th - locale override for Thai
  • /moment/uk - locale override for Ukrainian
  • /moment/ur - locale override for Urdu
  • /moment/uz - locale override for Uzbek
  • /moment/yo - locale override for Yoruba

Numerals

Numeral systems

/numerals - Numerals in several different number systems, e.g. Bengali, Burmese, Eastern Arabic, Western Arabic. This can be used for localised numbers for components. Returns arrays of the format ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'];

These can either be imported and used directly or in conjunction with the makeNumeralTranslator helper function below.

makeNumeralTranslator(system)

makeNumeralTranslator is a small helper that returns a function that translates any 'Western' Arabic numerals in the input string into the specified numeral system.

It accepts one argument system which is an array of numeral system symbols such as one of the ones above, and returns a translator function. If the argument is omitted or an invalid numeral system is supplied then the translator returns input strings unchanged. Note that currently only the first 10 symbols from the array are used.

For an example see Usage, below.

Installation

npm install @bbc/psammead-locales --save

Usage

Moment locales

import moment from 'moment';
import '@bbc/psammead-locales/moment/ig';

moment.locale('ig');

Numerals

import { Bengali, makeNumeralTranslator } from '@bbc/psammead-locales/numerals';

const translateNumerals = makeNumeralTranslator(Bengali);
const result = translateNumerals(someInput); // returns someInput with numbers translated to Bengali

Contributing

Psammead is completely open source. We are grateful for any contributions, whether they be new components, bug fixes or general improvements. Please see our primary contributing guide which can be found at the root of the Psammead respository.

Code of Conduct

We welcome feedback and help on this work. By participating in this project, you agree to abide by the code of conduct. Please take a moment to read it.

License

Psammead is Apache 2.0 licensed.