• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / fx-private-relay / cfcc50a8-73df-40f7-a53d-7fa5a875d7b5

17 Mar 2025 01:08AM CUT coverage: 85.137%. Remained the same
cfcc50a8-73df-40f7-a53d-7fa5a875d7b5

Pull #5448

circleci

web-flow
build(deps-dev): bump stylelint from 16.15.0 to 16.16.0

Bumps [stylelint](https://github.com/stylelint/stylelint) from 16.15.0 to 16.16.0.
- [Release notes](https://github.com/stylelint/stylelint/releases)
- [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stylelint/stylelint/compare/16.15.0...16.16.0)

---
updated-dependencies:
- dependency-name: stylelint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #5448: build(deps-dev): bump stylelint from 16.15.0 to 16.16.0

2438 of 3567 branches covered (68.35%)

Branch coverage included in aggregate %.

17089 of 19369 relevant lines covered (88.23%)

9.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/frontend/src/components/waitlist/LocalePicker.tsx
1
import { SelectHTMLAttributes, useEffect, useState } from "react";
×
2
import { getLocale } from "../../functions/getLocale";
×
3
import { useL10n } from "../../hooks/l10n";
×
4

5
type LocaleDisplayNames = Record<string, string>;
6
type Languages = {
7
  main: Record<
8
    string,
9
    {
10
      localeDisplayNames: {
11
        languages: LocaleDisplayNames;
12
      };
13
    }
14
  >;
15
};
16
export type Props = SelectHTMLAttributes<HTMLSelectElement> & {
17
  supportedLocales: string[];
18
};
19
export const LocalePicker = ({ supportedLocales, ...selectProps }: Props) => {
×
20
  const l10n = useL10n();
×
21
  const currentLocale = getLocale(l10n);
×
22
  const [localeDisplayNames, setLocaleDisplayNames] =
23
    useState<LocaleDisplayNames>();
×
24

25
  useEffect(() => {
×
26
    importLanguages(currentLocale).then((localeDisplayNames) => {
×
27
      setLocaleDisplayNames(localeDisplayNames);
×
28
    });
29
  }, [currentLocale]);
30

31
  const options = Object.entries(localeDisplayNames ?? {})
×
32
    .sort(([_codeA, nameA], [_codeB, nameB]) => nameA.localeCompare(nameB))
×
33
    .filter(([code]) => supportedLocales.includes(code))
×
34
    .map(([code, name]) => (
35
      <option key={code} value={code}>
×
36
        {name}
37
      </option>
38
    ));
39

40
  return <select {...selectProps}>{options}</select>;
41
};
42

43
async function importLanguages(locale: string): Promise<LocaleDisplayNames> {
44
  try {
×
45
    const languages: Languages = await import(
×
46
      `cldr-localenames-modern/main/${locale}/languages.json`
×
47
    );
48
    return languages.main[locale].localeDisplayNames.languages;
×
49
  } catch (_e) {
50
    try {
×
51
      // cldr-localenames-modern doesn't include suffixed locale codes for
52
      // locales in their main territory (i.e. it only has `es`, not `es-ES`, or
53
      // `nl` but not `nl-NL`, or `sv` but not `sv-SE`), so try loading a
54
      // truncated version if the full version was not found:
55
      const truncatedLocale = locale.split("-")[0];
×
56
      const languages: Languages = await import(
×
57
        `cldr-localenames-modern/main/${truncatedLocale}/languages.json`
×
58
      );
59
      return languages.main[truncatedLocale].localeDisplayNames.languages;
×
60
    } catch (_e) {
61
      const languagesEn = await import(
×
62
        "cldr-localenames-modern/main/en/languages.json"
63
      );
64
      return languagesEn.main.en.localeDisplayNames.languages;
×
65
    }
66
  }
67
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc