A comprehensive internationalization (i18n) package for the Mawaqit TV Android application, providing translations in over 40 languages for Islamic prayer times, mosque management, and UI elements.
- 🌍 40+ Languages: Support for major world languages including Arabic, English, French, German, Spanish, Turkish, Urdu, Persian, Indonesian, and many more
- 🕌 Islamic Content: Specialized translations for Islamic terms, prayers, and mosque-related content
- 📱 Flutter Integration: Seamless integration with Flutter's built-in internationalization system
- 🔄 RTL Support: Full right-to-left text support for Arabic, Persian, Hebrew, Kurdish, and Urdu
- 🎯 Type Safety: Generated type-safe localization classes
- 🛠️ Utilities: Helper functions for locale detection, text direction, and language management
The package includes translations for the following languages:
Language | Code | Native Name | RTL/Extended |
---|---|---|---|
Arabic | ar |
العربية | ✓ |
English | en |
English | |
French | fr |
Français | |
German | de |
Deutsch | |
Spanish | es |
Español | |
Turkish | tr |
Türkçe | |
Persian | fa |
فارسی | ✓ |
Urdu | ur |
اردو | ✓ |
Indonesian | id |
Bahasa Indonesia | |
Malay | ms |
Bahasa Melayu | |
Bengali | bn |
বাংলা | |
Hindi | hi |
हिन्दी | |
Chinese | zh |
中文 | |
Japanese | ja |
日本語 | |
Korean | ko |
한국어 | |
Russian | ru |
Русский | |
Portuguese | pt |
Português | |
Italian | it |
Italiano | |
Dutch | nl |
Nederlands | |
Polish | pl |
Polski | |
Montenegrin | cnr |
Crnogorski | Extended |
... and 25+ more languages |
Add this package to your pubspec.yaml
:
dependencies:
mawaqit_tv_l10n: ^1.0.0
Then run:
flutter pub get
- Import the package in your main app file:
import 'package:mawaqit_tv_l10n/mawaqit_tv_l10n.dart';
- Configure your MaterialApp:
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Mawaqit TV',
// Add localization delegates (includes Kurdish and Montenegrin support)
localizationsDelegates: MawaqitTvExtendedLocalizations.localizationsDelegates,
// Specify supported locales
supportedLocales: MawaqitTvExtendedLocalizations.supportedLocales,
// Set locale resolution callback with extended support
localeResolutionCallback: MawaqitTvExtendedLocalizations.localeResolutionCallback,
home: HomeScreen(),
);
}
}
Access translations in your widgets:
class HomeScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
final l10n = MawaqitTvLocalizations.of(context);
return Scaffold(
appBar: AppBar(
title: Text(l10n.home), // "Home" in the selected language
),
body: Column(
children: [
Text(l10n.prayerTimes), // "Prayer Times"
Text(l10n.fajr), // "Fajr"
Text(l10n.duhr), // "Duhr"
Text(l10n.asr), // "Asr"
Text(l10n.maghrib), // "Maghrib"
Text(l10n.isha), // "Isha"
ElevatedButton(
onPressed: () {},
child: Text(l10n.changeMosque), // "Change Mosque"
),
],
),
);
}
}
The package provides utility functions for locale management:
import 'package:mawaqit_tv_l10n/mawaqit_tv_l10n.dart';
// Check if a language uses RTL
bool isArabicRtl = MawaqitTvLocaleUtils.isRtl(const Locale('ar')); // true
// Get text direction
TextDirection direction = MawaqitTvLocaleUtils.getTextDirection(
const Locale('ar')
); // TextDirection.rtl
// Get native language name
String arabicName = MawaqitTvLocaleUtils.getLanguageName('ar'); // "العربية"
// Check if locale is supported
bool isSupported = MawaqitTvLocaleUtils.isLocaleSupported(
const Locale('ar')
); // true
// Get best matching locale
Locale bestMatch = MawaqitTvLocaleUtils.getBestMatchingLocale(
const Locale('ar', 'SA')
); // Locale('ar')
The package includes translations for various categories:
home
,about
,settings
,languages
ok
,cancel
,next
,tryAgain
darkMode
,lightMode
fajr
,duhr
,asr
,maghrib
,isha
imsak
,shuruk
,jumua
prayerTimes
,iqama
,alAdhan
afterAdhanHadith
,afterSalahAzkar
azkarList0
throughazkarList14
(post-prayer remembrances)- Islamic months:
muharram
,safar
,rabiAlawwal
, etc.
changeMosque
,searchMosque
,mosqueIdIsNotValid
announcement
,jumuaaLive
mainScreen
,secondaryScreen
networkStatus
,online
,offline
orientation
,portrait
,landscape
webView
,developersHomeScreen
Create a language selection screen:
class LanguageSelectionScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
final l10n = MawaqitTvLocalizations.of(context);
return Scaffold(
appBar: AppBar(
title: Text(l10n.languages),
),
body: ListView.builder(
itemCount: MawaqitTvLocaleConstants.supportedLocales.length,
itemBuilder: (context, index) {
final locale = MawaqitTvLocaleConstants.supportedLocales[index];
final isRtl = MawaqitTvLocaleUtils.isRtl(locale);
return ListTile(
title: Text(
MawaqitTvLocaleUtils.getLanguageName(locale.languageCode),
textDirection: isRtl ? TextDirection.rtl : TextDirection.ltr,
),
subtitle: Text(locale.languageCode.toUpperCase()),
onTap: () {
// Handle language selection
// You'll need to implement locale changing logic in your app
},
);
},
),
);
}
}
To contribute to this package or generate new translations:
After modifying ARB files, regenerate the localizations:
flutter gen-l10n
- Create a new ARB file in the
l10n/
directory (e.g.,intl_xx.arb
) - Add all required translation keys
- Update
MawaqitTvLocaleConstants.supportedLocales
inlib/src/constants.dart
- Add the language name to
MawaqitTvLocaleConstants.languageNames
- If it's an RTL language, add it to
MawaqitTvLocaleConstants.rtlLanguages
- Regenerate localizations
Run the tests to ensure everything works correctly:
flutter test
This package contains Islamic religious content including:
- Quranic verses (in Arabic with transliterations)
- Hadith texts
- Islamic prayers and supplications (Du'as)
- Prayer time terminology
All Islamic content has been reviewed for accuracy, but users should consult with religious scholars for authoritative guidance.
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
For translation contributions, please ensure:
- Accuracy of Islamic terms
- Cultural appropriateness
- Consistency with existing translations
- Native speaker review when possible
This package is released under the MIT License. See LICENSE for details.
For support, issues, or feature requests, please visit:
- Mawaqit team and contributors
- Muslim community for translations and feedback
- Flutter team for the internationalization framework
Mawaqit - Connecting Muslims to Mosques 🕌