feat(i18n): expand catalog runtime and developer tooling
- add Intl-backed locale definitions, formatters, catalog loaders, and runtime hooks\n- compile hashed production catalogs from package-scoped catalog sources\n- drive Lingui extraction and compilation directly from project JSON config\n- redesign the devtool with localized controls, draggable persistence, settings, navigation, copy actions, ANSI output, and fullscreen support\n- extend repository APIs, CLI coverage, documentation, and runtime tests
This commit is contained in:
@@ -40,19 +40,26 @@ export function DevtoolApp() {
|
||||
)
|
||||
}
|
||||
|
||||
const locale = state.project.locales[0]
|
||||
const locale =
|
||||
state.project.locales.find(
|
||||
(locale) => locale !== state.project.sourceLocale
|
||||
) ?? state.project.sourceLocale
|
||||
|
||||
if (!locale) {
|
||||
if (!state.project.locales.includes(locale)) {
|
||||
return (
|
||||
<main className="devtool-app__state">
|
||||
Add a locale with <code>workspace-i18n new <locale></code>.
|
||||
Add a target locale with <code>workspace-i18n new <locale></code>.
|
||||
</main>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<I18nProvider locale={locale} locales={state.project.locales}>
|
||||
<I18nDevtool defaultOpen mode="standalone" />
|
||||
<I18nDevtool
|
||||
defaultOpen
|
||||
mode="standalone"
|
||||
sourceLocale={state.project.sourceLocale}
|
||||
/>
|
||||
</I18nProvider>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user