Skip to content

Commit

Permalink
refactor: rename supported locale type (#7359)
Browse files Browse the repository at this point in the history
**Related Issue:** N/A

## Summary

Renames type to be singular.
  • Loading branch information
jcfranco authored and benelan committed Aug 3, 2023
1 parent 7990a92 commit 69c9831
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import {
LocalizedComponent,
NumberingSystem,
numberStringFormatter,
SupportedLocales,
SupportedLocale,
} from "../../utils/locale";
import {
activateFocusTrap,
Expand Down Expand Up @@ -345,7 +345,7 @@ export class InputTimePicker
@State() effectiveLocale = "";

@Watch("effectiveLocale")
async effectiveLocaleWatcher(locale: SupportedLocales): Promise<void> {
async effectiveLocaleWatcher(locale: SupportedLocale): Promise<void> {
await this.loadDateTimeLocaleData();
this.setInputValue(
localizeTimeString({
Expand Down
4 changes: 2 additions & 2 deletions packages/calcite-components/src/utils/locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const supportedLocales = [...new Set([...t9nLocales, ...locales])] as con

export type NumberingSystem = (typeof numberingSystems)[number];

export type SupportedLocales = (typeof supportedLocales)[number];
export type SupportedLocale = (typeof supportedLocales)[number];

const isNumberingSystemSupported = (numberingSystem: string): numberingSystem is NumberingSystem =>
numberingSystems.includes(numberingSystem as NumberingSystem);
Expand All @@ -150,7 +150,7 @@ export const getSupportedNumberingSystem = (numberingSystem: string): NumberingS
* @param locale – the BCP 47 locale code
* @param context - specifies whether the locale code should match in the context of CLDR or T9N (translation)
*/
export function getSupportedLocale(locale: string, context: "cldr" | "t9n" = "cldr"): SupportedLocales {
export function getSupportedLocale(locale: string, context: "cldr" | "t9n" = "cldr"): SupportedLocale {
const contextualLocales = context === "cldr" ? locales : t9nLocales;

if (!locale) {
Expand Down

0 comments on commit 69c9831

Please sign in to comment.