Skip to content

Commit

Permalink
feat: Export LanguageUtils
Browse files Browse the repository at this point in the history
Closes shaka-project#3692

Change-Id: I4a60a4aaac0621fcef1c6753e2018687672e7ad2
  • Loading branch information
theodab committed Oct 11, 2021
1 parent 7da2cd5 commit 5783694
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/util/language_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ goog.require('shaka.util.ManifestParserUtils');
/**
* @summary A set of language utility functions.
* @final
* @export
*/
shaka.util.LanguageUtils = class {
/**
Expand All @@ -32,6 +33,7 @@ shaka.util.LanguageUtils = class {
* @param {string} locale1
* @param {string} locale2
* @return {boolean}
* @export
*/
static areLocaleCompatible(locale1, locale2) {
const LanguageUtils = shaka.util.LanguageUtils;
Expand Down Expand Up @@ -62,6 +64,7 @@ shaka.util.LanguageUtils = class {
* @param {string} locale1
* @param {string} locale2
* @return {boolean}
* @export
*/
static areLanguageCompatible(locale1, locale2) {
const LanguageUtils = shaka.util.LanguageUtils;
Expand Down Expand Up @@ -102,6 +105,7 @@ shaka.util.LanguageUtils = class {
* @param {string} possibleParent
* @param {string} possibleChild
* @return {boolean}
* @export
*/
static isParentOf(possibleParent, possibleChild) {
const LanguageUtils = shaka.util.LanguageUtils;
Expand Down Expand Up @@ -146,6 +150,7 @@ shaka.util.LanguageUtils = class {
* @param {string} localeA
* @param {string} localeB
* @return {boolean}
* @export
*/
static isSiblingOf(localeA, localeB) {
const LanguageUtils = shaka.util.LanguageUtils;
Expand Down Expand Up @@ -181,6 +186,7 @@ shaka.util.LanguageUtils = class {
*
* @param {string} locale
* @return {string}
* @export
*/
static normalize(locale) {
const LanguageUtils = shaka.util.LanguageUtils;
Expand Down Expand Up @@ -217,6 +223,7 @@ shaka.util.LanguageUtils = class {
* @param {string} a
* @param {string} b
* @return {boolean}
* @export
*/
static areSiblings(a, b) {
const LanguageUtils = shaka.util.LanguageUtils;
Expand All @@ -235,6 +242,7 @@ shaka.util.LanguageUtils = class {
* @param {string} target
* @param {string} candidate
* @return {number}
* @export
*/
static relatedness(target, candidate) {
const LanguageUtils = shaka.util.LanguageUtils;
Expand Down Expand Up @@ -271,6 +279,7 @@ shaka.util.LanguageUtils = class {
*
* @param {string} lang
* @return {string}
* @export
*/
static getBase(lang) {
const LanguageUtils = shaka.util.LanguageUtils;
Expand Down Expand Up @@ -300,6 +309,7 @@ shaka.util.LanguageUtils = class {
*
* @param {shaka.extern.Stream} stream
* @return {string}
* @export
*/
static getLocaleForText(stream) {
const LanguageUtils = shaka.util.LanguageUtils;
Expand All @@ -322,6 +332,7 @@ shaka.util.LanguageUtils = class {
*
* @param {shaka.extern.Variant} variant
* @return {string}
* @export
*/
static getLocaleForVariant(variant) {
const LanguageUtils = shaka.util.LanguageUtils;
Expand Down Expand Up @@ -356,6 +367,7 @@ shaka.util.LanguageUtils = class {
* @param {string} target
* @param {!Iterable.<string>} searchSpace
* @return {?string}
* @export
*/
static findClosestLocale(target, searchSpace) {
const LanguageUtils = shaka.util.LanguageUtils;
Expand Down

0 comments on commit 5783694

Please sign in to comment.