code: function MapboxLanguage(options) {
    options = Object.assign({}, options);
    if (!(this instanceof MapboxLanguage)) {
      throw new Error('MapboxLanguage needs to be called with the new keyword');
    }
  
    this.setLanguage = this.setLanguage.bind(this);
    this._initialStyleUpdate = this._initialStyleUpdate.bind(this);
  
    this._defaultLanguage = options.defaultLanguage;
    this._isLanguageField = options.languageField || /^\{name/;
    this._getLanguageField = options.getLanguageField || function nameField(language) {
      return language === 'mul' ? '{name}' : '{name_' + language + '}';
    };
    this._languageSource = options.languageSource || null;
    this._languageTransform = options.languageTransform || function (style, language) {
      if (language === 'ar') {
        return noSpacing(style);
      } else {
        return standardSpacing(style);
      }
    };
    this._excludedLayerIds = options.excludedLayerIds || [];
    this.supportedLanguages = options.supportedLanguages || ['ar', 'en', 'es', 'fr', 'de', 'ja', 'ko', 'mul', 'pt', 'ru', 'zh'];
  }
docs: Create a new [Mapbox GL JS plugin](https://www.mapbox.com/blog/build-mapbox-gl-js-plugins/) that
  modifies the layers of the map style to use the 'text-field' that matches the browser language.
  @constructor
  @param {object} options - Options to configure the plugin.
  @param {string[]} [options.supportedLanguages] - List of supported languages
  @param {Function} [options.languageTransform] - Custom style transformation to apply
  @param {RegExp} [options.languageField=/^\{name/] - RegExp to match if a text-field is a language field
  @param {Function} [options.getLanguageField] - Given a language choose the field in the vector tiles
  @param {string} [options.languageSource] - Name of the source that contains the different languages.
  @param {string} [options.defaultLanguage] - Name of the default language to initialize style after loading.
  @param {string[]} [options.excludedLayerIds] - Name of the layers that should be excluded from translation.