INNER CODE UNIT · TypeScript

isAuto

arc53/DocsGPT · extensions/react-widget/src/locale/index.ts:70

const isAuto = (setting: string | undefined) =>
  !setting || setting.trim().toLowerCase() === 'auto';

/** The first of `languages` the widget supports, or null. */
const firstSupported = (languages: readonly string[]) => {
  for (const language of languages) {
    const match = matchLocale(language);
    if (match) return match;
  }
  return null;
};

/**
 * The locale to show. `auto` (or nothing) takes the first of `languages`
 * the widget supports; an explicit code is matched the same way. Anything
 * unsupported is English.
 */
export const resolveLocale = (

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…