Skip to content

Commit

Permalink
Merge pull request #385 from jaivsh/fifth
Browse files Browse the repository at this point in the history
Added support for hindi language
  • Loading branch information
avinashkranjan authored Aug 8, 2023
2 parents ef05574 + f51bbb4 commit 5e51d3d
Show file tree
Hide file tree
Showing 16 changed files with 253 additions and 62 deletions.
45 changes: 45 additions & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"friday": "Friday",
"@friday": {
"description": "App's name"
},
"hellosir": "Hello, Sir!",
"recentalerts": "Recent Alerts",
"viewall": "View all",
"seefavourites": "SEE FAVOURITES",
"search": "search",
"recenthomework": "Recent Homework",
"favourites": "Favourites",
"clearallfavourites": "CLEAR ALL FAVOURITES",
"hoursleft": "hours left",
"addnewclass": "Add New Class",
"mode": "Mode",
"teachername": "Teacher Name",
"date": "Date",
"time": "Time",
"joinlink": "Join Link",
"subject": "वSubject",
"save": "Save",
"yourprofile": "Your Profile",
"loading": "Loading...",
"email": "Email",
"bio": "Bio",
"college": "College",
"course": "Course",
"departmentmajor": "Department/Major",
"currentacademicyear": "Current Academic Year",
"gender": "Gender",
"age": "Age",
"settings": "Settings",
"common": "Common",
"language": "Language",
"lightmode": "Light Mode",
"notifications": "Notifications",
"notificationsdesc": "Turn your app notifications on or off",
"help": "Help",
"helpdesc": "See our help modules for queries",
"faqs": "FAQs",
"faqsdesc": "Basic usage guidelines",
"supportdevelopment": "Support Development",
"supportdevelopmentdesc": "See latest issues and contribute to the project!"
}
43 changes: 43 additions & 0 deletions lib/l10n/app_hi.arb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"friday": "शुक्रवार",
"hellosir": "नमस्ते महोदय!",
"recentalerts": "हालिया अलर्ट",
"viewall": "सभी देखें",
"seefavourites": "पसंदीदा देखें",
"search": "खोजो",
"recenthomework": "हालिया होमवर्क",
"favourites": "पसंदीदा",
"clearallfavourites": "सभी पसंदीदा साफ़ करें",
"hoursleft": "घंटे बाकी है",
"addnewclass": "नई कक्षा जोड़ें",
"mode": "प्रकार",
"teachername": "शिक्षक का नाम",
"date": "तारीख",
"time": "समय",
"joinlink": "लिंक से जुड़ें",
"subject": "विषय",
"save": "इसे जोड़ें",
"yourprofile": "आपकी प्रोफ़ाइल",
"loading": "लोड हो रहा है...",
"email": "ईमेल",
"bio": "बायो",
"college": "कॉलेज",
"course": "पाठ्यक्रम प्रकार",
"departmentmajor": "विभाग",
"currentacademicyear": "वर्तमान शैक्षणिक वर्ष",
"gender": "लिंग",
"age": "आयु",
"logout": "लॉग आउट",
"settings": "सेटिंग",
"common": "सामान्य",
"language": "भाषा",
"lightmode": "प्रकाश मोड",
"notifications": "सूचनाएं",
"notificationsdesc": "ऐप के नोटिफिकेशन को चालू या बंद करें",
"help": "मदद",
"helpdesc": "प्रश्नों के लिए हमारे सहायता मॉड्यूल देखें",
"faqs": "सामान्य प्रश्न",
"faqsdesc": "बुनियादी उपयोग दिशानिर्देश",
"supportdevelopment": "ऐप के विकास का समर्थन करें",
"supportdevelopmentdesc": "समस्याओं का समाधान करें, बग की रिपोर्ट करें, इत्यादि|"
}
19 changes: 19 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:friday/models/alert.dart';
import 'package:friday/screens/faqs_screen.dart';
import 'package:friday/screens/onboarding_page.dart';
Expand Down Expand Up @@ -27,9 +30,12 @@ import 'screens/help_screen.dart';
import 'screens/contact_us_screen.dart';
import 'screens/app_info_screen.dart';
import 'onboarding/introslider.dart';
import 'utils/notifications.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();
NotificationService().initNotification();
NotificationService().showNotification(title: 'olalalaaa', body: 'it works');
await Firebase.initializeApp();
runApp(MyApp());
}
Expand All @@ -48,6 +54,8 @@ class _MyAppState extends State<MyApp> {
void initState() {
super.initState();
checkFirstRun();


loadpref();
}

Expand Down Expand Up @@ -116,6 +124,17 @@ class _MyAppState extends State<MyApp> {
child: WillPopScope(
onWillPop:onWillPop,
child: MaterialApp(
localizationsDelegates: [
AppLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
locale: Locale('en'),
supportedLocales: [
Locale('en'), // English
Locale('hi'), // Hindi
],
debugShowCheckedModeBanner: false,
title: 'Friday',
theme: ThemeData(
Expand Down
3 changes: 2 additions & 1 deletion lib/screens/alert_screen.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:friday/widgets/recents_alerts.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

class AlertScreen extends StatefulWidget {
@override
Expand All @@ -17,7 +18,7 @@ class _AlertScreenState extends State<AlertScreen> {
children: <Widget>[
SizedBox(height: 30.0),
Text(
"Recent Alerts",
AppLocalizations.of(context).recentalerts,
style: TextStyle(
color: Colors.white,
fontSize: 30.0,
Expand Down
5 changes: 3 additions & 2 deletions lib/screens/favourites_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_icons_null_safety/flutter_icons_null_safety.dart';
import 'package:intl/intl.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import '../constants.dart';
import '../models/alert.dart';
import '../widgets/countdown_painter.dart';
Expand Down Expand Up @@ -42,7 +43,7 @@ class _FavouritesScreenState extends State<FavouritesScreen> {

SizedBox(height: 30.0),
Text(
"Favourites",
AppLocalizations.of(context).favourites,
style: TextStyle(
color: Colors.white,
fontSize: 30.0,
Expand All @@ -53,7 +54,7 @@ class _FavouritesScreenState extends State<FavouritesScreen> {
Center(child: TextButton(onPressed: () {
removeall();
},
child: Text('CLEAR ALL FAVOURITES')),),
child: Text(AppLocalizations.of(context).clearallfavourites)),),
SizedBox(height: 30.0),
Container(
padding: EdgeInsets.all(35.0),
Expand Down
11 changes: 6 additions & 5 deletions lib/screens/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter_icons_null_safety/flutter_icons_null_safety.dart';
import 'package:friday/models/alert.dart';
import 'package:friday/models/homework.dart';
import 'package:friday/screens/favourites_screen.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:friday/widgets/countdown_painter.dart';
import 'package:flutter/material.dart';
import 'package:friday/constants.dart';
Expand Down Expand Up @@ -112,7 +113,7 @@ class _HomeScreenState extends State<HomeScreen> with WidgetsBindingObserver {
border: InputBorder.none,
fillColor: Theme.of(context).primaryColor,
filled: true,
hintText: "Search",
hintText: AppLocalizations.of(context).search,
hintStyle: TextStyle(color: kTextColor),
prefixIcon: Icon(Icons.search, color: kTextColor, size: 26.0),
enabledBorder: OutlineInputBorder(
Expand All @@ -129,7 +130,7 @@ class _HomeScreenState extends State<HomeScreen> with WidgetsBindingObserver {
SizedBox(height: 10,),
Center(child: TextButton(onPressed: () {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => FavouritesScreen()));
},child: Text('SEE FAVOURITES', style: TextStyle(color: Theme.of(context).colorScheme.secondary),),),),
},child: Text( AppLocalizations.of(context).seefavourites, style: TextStyle(color: Theme.of(context).colorScheme.secondary),),),),
SizedBox(height: 15.0),
Container(
padding: EdgeInsets.all(35.0),
Expand All @@ -144,7 +145,7 @@ class _HomeScreenState extends State<HomeScreen> with WidgetsBindingObserver {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
"Recent Alerts",
AppLocalizations.of(context).recentalerts,
style: TextStyle(
color: Colors.white,
fontSize: 20.0,
Expand All @@ -155,15 +156,15 @@ class _HomeScreenState extends State<HomeScreen> with WidgetsBindingObserver {
RecentsAlerts(),
Center(
child: Text(
"View all",
AppLocalizations.of(context).viewall,
style: TextStyle(
color: Theme.of(context).colorScheme.secondary,
fontSize: 15.0),
),
),
SizedBox(height: 20.0),
Text(
"Recent Homework",
AppLocalizations.of(context).recenthomework,
style: TextStyle(
color: Colors.white,
fontSize: 20.0,
Expand Down
3 changes: 2 additions & 1 deletion lib/screens/homework_screen.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:friday/widgets/recents_homeworks.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

class HomeworkScreen extends StatefulWidget {
@override
Expand All @@ -17,7 +18,7 @@ class _HomeworkScreenState extends State<HomeworkScreen> {
children: <Widget>[
SizedBox(height: 30.0),
Text(
"Recent Homework",
AppLocalizations.of(context).recenthomework,
style: TextStyle(
color: Colors.white,
fontSize: 30.0,
Expand Down
37 changes: 19 additions & 18 deletions lib/screens/profile_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter_share/flutter_share.dart';
import 'package:friday/constants.dart';
import 'package:friday/models/users.dart';
import 'package:friday/screens/onboarding_page.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:friday/screens/settings_screen.dart';
import 'package:friday/services/authentication.dart';
import 'package:friday/services/facebookAuthentication.dart';
Expand Down Expand Up @@ -133,7 +134,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
Column(
children: [
Text(
"Your Profile",
AppLocalizations.of(context).yourprofile,
style: TextStyle(
color: Colors.white,
fontSize: 30.0,
Expand Down Expand Up @@ -164,7 +165,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
child: Text(
userInfo.hasData
? currentUser['name']
: "Loading...",
: AppLocalizations.of(context).loading,
style: TextStyle(
fontSize: 20,
color: Colors.blue[200],
Expand All @@ -175,17 +176,17 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
SizedBox(height: 20),
buildDetails(
"Email",
AppLocalizations.of(context).email,
userInfo.hasData
? currentUser['email']
: "Loading...",
: AppLocalizations.of(context).loading,
true),
SizedBox(height: 20),
buildDetails(
"Bio",
AppLocalizations.of(context).bio,
userInfo.hasData
? currentUser['bio']
?? 'No bio available' : "Loading...",
?? 'No bio available' : AppLocalizations.of(context).loading,
true),
SizedBox(height: 20),
Visibility(
Expand Down Expand Up @@ -226,50 +227,50 @@ class _ProfileScreenState extends State<ProfileScreen> {
),
),
buildDetails(
"College",
AppLocalizations.of(context).college,
userInfo.hasData
? currentUser['university']
: "Loading...",
: AppLocalizations.of(context).loading,
true),
SizedBox(height: 20),
buildDetails(
"Course",
AppLocalizations.of(context).course,
userInfo.hasData
? currentUser['course']
: "Loading...",
: AppLocalizations.of(context).loading,
true),
SizedBox(height: 20),
buildDetails(
"Deptartment/Major",
AppLocalizations.of(context).departmentmajor,
userInfo.hasData
? currentUser['department']
: "Loading...",
: AppLocalizations.of(context).loading,
true),
SizedBox(height: 20),
buildDetails(
"Current Academic Year",
AppLocalizations.of(context).currentacademicyear,
userInfo.hasData
? currentUser['year'].toString()
: "Loading...",
: AppLocalizations.of(context).loading,
true),
SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
buildDetails(
"Gender",
AppLocalizations.of(context).gender,
userInfo.hasData
? enumToString(currentUser['gender'])
: "Loading...",
: AppLocalizations.of(context).loading,
true),
SizedBox(width: 20),
Visibility(
visible: !visibilityFields,
child: buildDetails(
"Age",
AppLocalizations.of(context).age,
userInfo.hasData
? currentUser['age'].toString()
: "Loading...",
: AppLocalizations.of(context).loading,
visibilityName),
),
Visibility(
Expand Down
Loading

0 comments on commit 5e51d3d

Please sign in to comment.