Glover
  • Introduction
  • Video Guide
    • How to Setup Vendor
  • Usage Flows (FlowCharts)
  • Firebase
    • Firebase
    • Firebase firestore database
    • Firebase Security
    • Firebase Storage
    • Firestore indexes
    • Chat & Live tracking
  • Backend
    • NOTICE
    • VPS/Shared Hosting
    • Installation
    • Database Configuration
    • GUI Installer
    • Timezone
    • Firebase
      • Firebase Forgot password
    • Web Notification
    • Reskin Mobile App
    • Change Backend Color
    • Terminal
      • Commands
    • Screenshots
    • Auto-assignment
    • Order schedule
    • CRON job
    • Clear Data (Users/Orders etc)
    • Email Server Settings
    • SMS Gateway
    • Payment Gateways
    • Webhooks - Payment gateway
    • Vendor Subscription
    • Language / Translation
    • HOW TO UPDATE
    • In-App Live chat/support
    • Geocoding and Place search
    • Features
      • Firebase/Notification Delay
      • Fleet Management
      • Loyalty points
      • Home Screen Design
      • Featured Vendors
      • Trip recalculation/Outstanding payments
      • Switch between Taxi/Regular Driver
      • Data Translation - Backend
  • 🔥Supervisor Setup - VPS
    • Introduction
    • Install & Setup Supervisor
    • Taxi Booking
    • How to verify Taxi driver Vehicle
    • Websocket Setup
      • Laravel reverb Config
  • Flutter App
    • Getting Started
    • Steps
    • Directory Structure
    • Change App Name & ID
    • Change App icon & splash
    • App Color / Theme
    • Connect To Backend
    • Firebase
    • Firebase Auth - Phone
    • Firebase Phone OTP - Android
    • Firebase Phone OTP - iOS
    • Firebase Notification iOS
    • Share link - Firebase dynamic link
    • Social Media Login
      • Google login
      • Facebook Login
      • Sign-In with Apple
    • Google Map
    • Change App Language
    • Notification Sound
    • Custom Translation ~ 1.4.8
    • Custom Translation +1.5.0
    • Change App Font
    • Running on VS Code
    • Running on Android Studio
    • Generate Android Release App
    • Upload to Apple App Store
    • Screenshots
  • Demo Accounts
  • FAQs
    • Backend Image not working
    • Backend Backup not working
    • Upgrade without losing data
    • Backend Rollback
    • Blank Home screen
    • Custom Token
    • Product price zero(0) in details
    • Auto-cancel Not working
    • Pharmacy vendor
    • Vendor default rating
    • App logins
    • Error ==> type 'String' is not a subtype of type 'int'
    • NDK version error
    • Push Notification
    • Delivery Zone Map error
    • HOW TO UPDATE ADMINEND
    • Driver app rejected by Google
    • Cron job error
    • Auth pages Not working - App
    • Update App Translation
  • HOW-TO
    • Onboarding Settings
    • Setup Parcel Vendor
    • Set Vendor Custom Fees
    • Digital Products
    • Setup Taxi driver
    • Multiple Currency Taxi support
    • How Prescription Order works
    • Earning
      • Vendors
      • Drivers
    • QR Code Login
    • Single Vendor Mode
    • Enforce CASH Payment For Delivery Fee Only
    • System Contact Email
    • Driver Matching Flow
  • Extensions
    • Driver tracking extensions
    • Paymongo Gateway
    • Mercadopago Gateway
    • Nagad [Bangladeshi]
    • Paytrail
    • Paymaya Gateway
    • Emailer
    • POS
      • Mobile App
        • Requirement
        • Flutter SDK
        • Change App Name & ID
        • Connect To Backend
        • App build & release
      • Change logs
    • Glover Website
    • External Notifier
      • Slack Setup
      • Telegram Setup
    • Instamojo - Payment
  • Upgrades
    • How to update
    • Important: Backend VPS/Shared hosting
    • Older Version Upgrade Instructions
      • Upgrade to 1.2.1
      • to 1.2.3
      • ~ 1.3.2
      • to 1.3.1
      • to 1.3.3
      • to 1.3.4
      • to 1.3.5
      • to 1.3.7
      • to 1.3.8
      • to 1.3.9
      • to 1.4.0
      • to 1.4.1
      • to 1.4.2
      • to 1.4.3
      • to 1.4.5
      • to 1.4.6
      • to 1.4.7
      • 1.4.8
    • 1.5.0 - 1.5.9
      • 1.5.0
      • 1.5.1
      • 1.5.2
      • 1.5.3
      • 1.5.4
      • 1.5.5
      • 1.5.5-fix-1
      • 1.5.6
      • 1.5.7
      • 1.5.8
      • 1.5.9
    • 1.6.0 - 1.6.70
      • 1.6.0
      • 1.6.1
      • 1.6.2
      • 1.6.3
      • 1.6.4
      • 1.6.5
      • 1.6.6
      • 1.6.62
      • 1.6.63
      • 1.6.70
    • 1.7.00 - 1.7.21
      • 1.7.00
      • 1.7.01
      • 1.7.02
      • 1.7.10
      • 1.7.20
      • 1.7.21
    • 1.7.30 - 1.7.60
      • 1.7.30
      • 1.7.31
      • 1.7.40
      • 1.7.41
      • 1.7.42
      • 1.7.43
      • 1.7.44
      • 1.7.45
      • 1.7.50
      • 1.7.51
      • 1.7.60
    • 1.7.70
  • Change logs
Powered by GitBook
On this page
  • Translating App Strings
  • Default Language
  • REMOVE LANGUAGE

Was this helpful?

  1. Flutter App

Custom Translation ~ 1.4.8

You can translate the app to your own language if its not listed as one of the supported languages.

Here is how you can translate it yourself.

  • Go to lib/widgets/cards/language_selector.view.dart

  • Scroll to the bottom of the file, you would see a commented code. like this:

// MenuItem(
//   title: "LANGUAGE_NAME",
//   suffix: Flag('COUNRTY_CODE', height: 24, width: 24),
//   onPressed: () => onSelected('LANGUAGE_CODE'),
// ),
  • Uncomment this code and change variable to match your new translation language. For example if you want to translate app to Yoruba(A local language in Nigeria). Below is the sample of how the code should look like:

MenuItem(
 title: "Yoruba",
 suffix: Flag('NG', height: 24, width: 24),
 onPressed: () => onSelected('yo'),
),

Now Yoruba will be listed as one of the app languages.

Translating App Strings

After setting your custom language option above, all you are left with is to translate all the used strings used in the app to your custom language.

All translatable strings/values used in the app is grouped inside a translation folder. For example if you want to translate the values on the splash page. Navigate to lib/translations/splash.i18n.dart.

Here is a the content of splash.i18n.dart:

import 'package:i18n_extension/i18n_extension.dart';

extension Localization on String {
  //en,fr,es,de
  static var _t = Translations("en") +
      {
        "en": "Loading Please wait...",
        "fr": "",
        "es": "",
        "de": "",
      };

  String get i18n => localize(this, _t);
  String fill(List<Object> params) => localizeFill(this, params);
}

Now you need to set your translated string/value for each object.

Now let us translation the value "Loading Please wait..." to Yoruba. This is how the file would now look like:

import 'package:i18n_extension/i18n_extension.dart';

extension Localization on String {
  //en,fr,es,de
  static var _t = Translations("en") +
      {
        "en": "Loading Please wait...",
        "fr": "",
        "es": "",
        "de": "",
        "yo": "Nbọ Jọwọ duro ...",
      };

  String get i18n => localize(this, _t);
  String fill(List<Object> params) => localizeFill(this, params);
}

That's it, you now have a translated version of that value. You can follow the guide above to translate the rest values in all the translation files.

NOTE: All translation file as an extension of .i18n.dart

Default Language

You can make the newly added language the default language of the app.

Navigate to lib/services/auth.service.dart. Change the code at line 39. Current code from line 39

static String getLocale() { 
    return LocalStorageService.prefs.getString(AppStrings.appLocale) ?? "en"; 
}

To make Yoruba our default language, change the "en" to "yo".

Also add your custom language to list of allowed languages in the MyApp.dart file. Adding Yoruba as one of the supported languages.

supportedLocales: [
    const Locale('en'),
    const Locale('fr'),
    const Locale('es'),
    const Locale('de'),
    //FOR YORUBA
    const Locale('yo'),
],

REMOVE LANGUAGE

If you need to remove unwanted languages, you can simply comment out the MenuItem for the language in the lib/widgets/cards/language_selector.view.dart

PreviousNotification SoundNextCustom Translation +1.5.0

Last updated 10 months ago

Was this helpful?