/*
 * Temporarily paused (legacy implementation kept for later re-activation)
 *
 * export const DEFAULT_NEWS_LOCALE = 'de';
 * export const FALLBACK_NEWS_LOCALES = ['de', 'en'];
 *
 * export const getLocaleBase = (locale?: string): string => {
 *   return (locale || DEFAULT_NEWS_LOCALE).toLowerCase().split(/[-_]/)[0];
 * };
 *
 * export const getPreferredLocales = (
 *   langBase: string,
 *   availableLocales: string[],
 * ): string[] => {
 *   const ordered = [langBase, ...FALLBACK_NEWS_LOCALES, ...availableLocales];
 *   return Array.from(new Set(ordered.filter((locale) => locale.trim() !== '')));
 * };
 *
 * export const normalizeStatus = (status: string | null | undefined): string => {
 *   return (status || '').trim().toLowerCase();
 * };
 *
 * export const isStatus = (
 *   status: string | null | undefined,
 *   target: string,
 * ): boolean => {
 *   return normalizeStatus(status) === target;
 * };
 *
 * export const pickLocalizedObject = <T extends object>(
 *   values: Record<string, T | undefined> | undefined,
 *   preferredLocales: string[],
 * ): T | null => {
 *   for (const locale of preferredLocales) {
 *     const candidate = values?.[locale];
 *     if (candidate) {
 *       return candidate;
 *     }
 *   }
 *
 *   return null;
 * };
 *
 * export const pickLocalizedText = (
 *   values: Record<string, string | null | undefined> | undefined,
 *   preferredLocales: string[],
 * ): string | null => {
 *   for (const locale of preferredLocales) {
 *     const candidate = values?.[locale];
 *     if (typeof candidate === 'string' && candidate.trim().length > 0) {
 *       return candidate;
 *     }
 *   }
 *
 *   return null;
 * };
 */

/*
export const DEFAULT_NEWS_LOCALE = 'de';
export const FALLBACK_NEWS_LOCALES = ['de', 'en'];

export const getLocaleBase = (locale?: string): string => {
  return (locale || DEFAULT_NEWS_LOCALE).toLowerCase().split(/[-_]/)[0];
};

export const getPreferredLocales = (
  langBase: string,
  availableLocales: string[],
): string[] => {
  const ordered = [langBase, ...FALLBACK_NEWS_LOCALES, ...availableLocales];
  return Array.from(new Set(ordered.filter((locale) => locale.trim() !== '')));
};

export const normalizeStatus = (status: string | null | undefined): string => {
  return (status || '').trim().toLowerCase();
};

export const isStatus = (
  status: string | null | undefined,
  target: string,
): boolean => {
  return normalizeStatus(status) === target;
};

export const pickLocalizedObject = <T extends object>(
  values: Record<string, T | undefined> | undefined,
  preferredLocales: string[],
): T | null => {
  for (const locale of preferredLocales) {
    const candidate = values?.[locale];
    if (candidate) {
      return candidate;
    }
  }

  return null;
};

export const pickLocalizedText = (
  values: Record<string, string | null | undefined> | undefined,
  preferredLocales: string[],
): string | null => {
  for (const locale of preferredLocales) {
    const candidate = values?.[locale];
    if (typeof candidate === 'string' && candidate.trim().length > 0) {
      return candidate;
    }
  }

  return null;
};
*/
