# Localization / Internationalization

Wiredash supports several languages out of the box (see the list of supported translation files here (opens new window)). By default Wiredash will be shown in the device language provided it's supported on the current platform.

# Change SDK locale

If you want to override the default locale just pass locale parameter as follows. If the locale is not supported, English will be used by default.

return Wiredash(
  ...
  options: WiredashOptionsData(
    /// You can set your own locale to override device default (`window.locale` by default)
    locale: const Locale.fromSubtags(languageCode: 'pl'),
    textDirection: TextDirection.ltr,
  ),
  ...
);

# Custom strings

You can also provide custom translations. You can choose if you want to provide all the possible terms or only selected (e.g. you want to get rid of the emojis in current locale).

For instance you can provide locale for unsupported language and use this locale by providing proper value to locale property. You can also override default text direction - this is recommended step if your app is using right-to-left language (TextDirection.rtl).

return Wiredash(
  //...
  options: WiredashOptionsData(
    customTranslations: {
      const Locale.fromSubtags(languageCode: 'zh'):
          const DemoCustomTranslations()
    },
    locale: const Locale.fromSubtags(languageCode: 'zh'),
    textDirection: TextDirection.rtl,
  ),
  //...
);

If you want to add new locale the custom translation class should extend WiredashTranslations:

// WiredashTranslations is abstract
class DemoCustomTranslations extends WiredashTranslations {
  const DemoCustomTranslations() : super();

  
  String get feedbackStateIntroTitle => 'Good morning!';
  /// override all the terms
}

Or if you want to override only selected Polish terms you should extend built-in WiredashLocalizedTranslations:

import 'package:wiredash/src/common/translation/l10n/messages_pl.dart' as pl;

class DemoPolishTranslations extends pl.WiredashLocalizedTranslations {
  const DemoPolishTranslations() : super();

  
  String get feedbackStateIntroTitle => 'Dzień dobry!';
}

Then provide the instance of this class to WiredashOptionsData as in the snippet below:

return Wiredash(
  //...
  options: WiredashOptionsData(
    customTranslations: {
      const Locale.fromSubtags(languageCode: 'pl'):
          const DemoPolishTranslations(),
    },
    locale: const Locale('pl'),
  ),
  //...
);

# Contribute

If you want to contribute your own translations you can join our public POEditor project here (opens new window).

# Translation contributors

Thank you so much to following people who helped translate Wiredash! 🙌