Skip to main content

Localization and Translations

FDC UI text is represented by the typed FdcTranslations model. Translation resolution is separate from formatting resolution: UI language and date/number formatting can be configured together or independently.

Built-in FDC UI translation bundles are available for:

LanguageFactoryLocale
EnglishFdcTranslations.enUs()en_US
CroatianFdcTranslations.hrHr()hr_HR
ItalianFdcTranslations.itIt()it_IT
GermanFdcTranslations.deDe()de_DE
FrenchFdcTranslations.frFr()fr_FR
SpanishFdcTranslations.esEs()es_ES

The default resolver selects by language code and falls back to English for unsupported languages.

Explicit translation bundle

For an application-controlled language switcher, pass a bundle directly to FdcApp:

FdcApp(
translations: FdcTranslations.deDe(),
child: const CustomersPage(),
)

When the value changes and the subtree rebuilds, descendant FDC controls receive the new translations.

Flutter localization integration

FDC provides a localization delegate:

MaterialApp(
locale: currentLocale,
supportedLocales: FdcLocalizations.supportedLocales,
localizationsDelegates: const [
FdcLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
home: FdcApp(
child: const CustomersPage(),
),
)

FdcLocalizations.supportedLocales contains the built-in FDC translation locales.

When FdcApp.translations is not explicitly set, FDC resolves translations in this order:

FdcLocalizations from Flutter localization tree
→ FdcApp.translationResolver for active locale
→ English fallback in the default resolver

Typed translation groups

FdcTranslations is grouped by component responsibility:

FdcTranslations(
common: FdcCommonTranslations(...),
dialogs: FdcDialogTranslations(...),
grid: FdcGridTranslations(...),
validation: FdcValidationTranslations(...),
)

This typed model keeps overrides discoverable and refactor-safe.

Common text

FdcCommonTranslations includes shared actions and labels such as:

OK, Yes, No, Cancel, Apply, Clear, Search,
All, Delete, Close, Pick date, Lookup, No results

Dialog text

FdcDialogTranslations contains dialog-specific resources such as delete confirmation text.

Grid text

FdcGridTranslations contains grid UI resources for areas such as:

  • filters and filter operators,
  • sorting,
  • pinning,
  • paging,
  • search,
  • grid menus,
  • export labels,
  • range filter labels,
  • selection and status text.

Validation text

FdcValidationTranslations contains field and precision/limit validation messages and message builders.

Override selected text

Translation group constructors provide defaults, so you can build a focused custom bundle without specifying every string:

final translations = FdcTranslations(
common: const FdcCommonTranslations(
search: 'Find',
),
grid: FdcGridTranslations(
searchHint: 'Find customers...',
),
);

FdcApp(
translations: translations,
child: const CustomersPage(),
)

Be aware that supplying a custom FdcTranslations object replaces the resolved bundle for that scope. Construct the groups you need with their desired values; constructor defaults fill unspecified fields in each group.

Custom translation resolver

For application-owned localization architecture, implement FdcTranslationResolver:

class AppTranslationResolver implements FdcTranslationResolver {
const AppTranslationResolver();

@override
FdcTranslations resolve(Locale locale) {
switch (locale.languageCode) {
case 'de':
return FdcTranslations.deDe();
case 'fr':
return FdcTranslations.frFr();
default:
return FdcTranslations.enUs();
}
}
}

Register it on FdcApp:

FdcApp(
translationResolver: const AppTranslationResolver(),
child: const CustomersPage(),
)

The resolver contract is synchronous and deterministic.

Reading translations in custom UI

Custom widgets that should use the same FDC translation scope can read:

final t = FdcApp.translationsOf(context);

Text(t.common.search);

Use translationsOf for normal UI code so the widget reacts to inherited configuration changes.

Translations and formats are independent

A locale can have a built-in format preset without having a built-in FDC UI translation bundle.

For example, an application can use locale-specific date and decimal formatting while keeping English FDC UI text:

FdcApp(
formatSettings: FdcFormatSettings.fromLocale(
const Locale('pt', 'BR'),
),
translations: FdcTranslations.enUs(),
child: const OrdersPage(),
)

This separation is useful for applications that manage product language and regional formatting independently.