How to use the bootstrap/api/i18n/async-locale-data.AsyncLocaleData function in bootstrap

To help you get started, we’ve selected a few bootstrap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RequestPolicyContinued / requestpolicy / tests / mocha / unit / bootstrap-api / test-i18n-async-locale-data.ts View on Github external
it("Should return normalized BCP 47 tag", function() {
      asyncLocaleData = new AsyncLocaleData(
          log,
          createMockTryCatchUtils("fr-FR") as any,
          chromeFileService,
          mockServices as any,
      );

      let result = asyncLocaleData.getAppLocale();
      expect(result).to.equal("fr-fr");
    });
github RequestPolicyContinued / requestpolicy / tests / mocha / unit / bootstrap-api / test-i18n-async-locale-data.ts View on Github external
it("Should throw RangeError if not a valid BCP 47 tag", function() {
      asyncLocaleData = new AsyncLocaleData(
          log,
          createMockTryCatchUtils("-invalid tag") as any,
          chromeFileService,
          mockServices as any,
      );

      let fn = function() {
        return asyncLocaleData.getAppLocale();
      };
      expect(fn).to.throws(RangeError);
    });
  });
github RequestPolicyContinued / requestpolicy / tests / mocha / unit / bootstrap-api / test-i18n-async-locale-data.ts View on Github external
beforeEach(function() {
    asyncLocaleData = new AsyncLocaleData(
        log, mockTryCatchUtils, chromeFileService, mockServices as any,
    );
  });