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

mozilla / fx-private-relay / 89e6ed14-f657-4c89-81b2-266103aa800a

07 Apr 2025 02:30PM CUT coverage: 85.194% (-0.009%) from 85.203%
89e6ed14-f657-4c89-81b2-266103aa800a

Pull #5492

circleci

web-flow
build(deps-dev): bump typescript from 5.8.2 to 5.8.3

Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.8.2 to 5.8.3.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release-publish.yml)
- [Commits](https://github.com/microsoft/TypeScript/commits)

---
updated-dependencies:
- dependency-name: typescript
  dependency-version: 5.8.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #5492: build(deps-dev): bump typescript from 5.8.2 to 5.8.3

2451 of 3584 branches covered (68.39%)

Branch coverage included in aggregate %.

17216 of 19501 relevant lines covered (88.28%)

9.82 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