<commit_before># frau-locale-provider
[![NPM version][npm-image]][npm-url]
[![Build status][ci-image]][ci-url]
[![Coverage Status][coverage-image]][coverage-url]

frau-locale-provider is a utility that you can use in your D2L free range
applications in order to get information about the locale of the current user.

##API



[npm-url]: https://npmjs.org/package/return-points
[npm-image]: https://badge.fury.io/js/return-points.png
[ci-image]: https://travis-ci.org/Brightspace/return-points.svg?branch=master
[ci-url]: https://travis-ci.org/Brightspace/return-points
[coverage-image]: https://img.shields.io/coveralls/Brightspace/return-points.svg
[coverage-url]: https://coveralls.io/r/Brightspace/return-points?branch=master<commit_msg>initial documentation<commit_after># frau-locale-provider
[![NPM version][npm-image]][npm-url]
[![Build status][ci-image]][ci-url]
[![Coverage Status][coverage-image]][coverage-url]

frau-locale-provider is a utility that you can use in your D2L free range
applications ([frau](https://www.npmjs.com/browse/keyword/frau)) in order to get information about the locale of the current user.

To install via [NPM](https://www.npmjs.com/):

`npm install frau-locale-provider`

##API

###getLanguageCode()

Gets the current user's language code, as a [RFC 3066](https://www.ietf.org/rfc/rfc3066.txt) value. e.g. "en", "en-us", "fr-ca".

```javascript
var localeProvider = require('frau-locale-provider');

var languageCode = localeProvider.getLanguageCode();
console.log(languageCode); // -> e.g. "en-us"
```

###isRtl()

Used to determine if the current user's locale requires that text be written
in the [right to left (RTL)](http://en.wikipedia.org/wiki/Right-to-left)
direction.

```javascript
var localeProvider = require('frau-locale-provider');

var isRtl = localeProvider.isRtl();
console.log(isRtl); // -> true or false
```

[npm-url]: https://npmjs.org/package/frau-locale-provider
[npm-image]: https://img.shields.io/npm/v/frau-locale-provider.svg
[ci-image]: https://img.shields.io/travis/Brightspace/frau-locale-provider/master.svg
[ci-url]: https://travis-ci.org/Brightspace/frau-locale-provider
[coverage-image]: https://img.shields.io/coveralls/Brightspace/frau-locale-provider/master.svg
[coverage-url]: https://coveralls.io/r/Brightspace/frau-locale-provider?branch=master
{'fraction_non_alphanumeric': 0.17082616179001722, 'fraction_numerical': 0.004302925989672977, 'mean_word_length': 5.2, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 15, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1131579', 'n_tokens_mistral': 847, 'n_tokens_neox': 798, 'n_words': 160}