Automatic language choices resolve only to supported languages; community translations are listed apart in Settings and offered as a one-click switch. waybetter i18n check reads `supported` and generates `tier` into languages.json.
10 lines
516 B
TypeScript
10 lines
516 B
TypeScript
// Settings → Language: how the app's languages are grouped. Supported ones come first; community
|
|
// translations (machine drafts nobody has reviewed) are listed apart below them.
|
|
import type { PanelLanguage } from './site.ts';
|
|
|
|
export function groupLanguages(list: readonly PanelLanguage[]): { supported: PanelLanguage[]; community: PanelLanguage[] } {
|
|
return {
|
|
supported: list.filter(language => language.tier !== 'community'),
|
|
community: list.filter(language => language.tier === 'community'),
|
|
};
|
|
}
|