Skip to content

elias8/uxd

Repository files navigation

UXD

codecov

A User Experience Design tool built with flutter.

Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.


Working with Translations

This project relies on flutter_localizations and follows the official internationalization guide for Flutter.

Adding Strings

  1. To add a new localized string, open the app_en.arb file at lib/config/l10n/arb/app_en.arb.
{
  "@@locale": "en",
  "appName": "UXD",
  "@appName": {
    "description": "The application name"
  }
}
  1. Then add a new key/value and description
{
  "@@locale": "en",
  "appName": "UXD",
  "@appName": {
    "description": "The application name"
  },
  "toolbar": "Toolbar",
  "@albums": {
    "description": "Text shown on the toolbar widget"
  },
}
  1. Use the new string
import 'package:uxd/l10n/l10n.dart';

@override
Widget build(BuildContext context) {
  final l10n = context.l10n;
  return Text(l10n.albums);
}

Adding Supported Locales

Update the CFBundleLocalizations array in the Info.plist at macos/Runner/Info.plist to include the new locale.

    ...

<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>am</string>
</array>

        ...

Adding Translations

  1. For each supported locale, add a new ARB file in lib/l10n/arb.
├── l10n
│   ├── arb
│   │   ├── app_en.arb
│   │   └── app_am.arb
  1. Add the translated strings to each .arb file:

app_en.arb

{
  "@@locale": "en",
  "appName": "UXD",
  "@appName": {
    "description": "The application name"
  },
}

app_am.arb

{
  "@@locale": "am",
  "appName": "UXD",
  "@appName": {
    "description": "የመተግበሪያ ስም"
  },
}