Skip to content

Commit

Permalink
Add en, de, fr, es language supports
Browse files Browse the repository at this point in the history
  • Loading branch information
GravityDarkLab committed Jan 30, 2024
1 parent f5f6d6e commit 99f3107
Show file tree
Hide file tree
Showing 24 changed files with 204 additions and 127 deletions.
3 changes: 2 additions & 1 deletion l10n.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
output-localization-file: app_localizations.dart
untranslated-messages-file: desiredFileName.txt
20 changes: 17 additions & 3 deletions lib/l10n/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
"pin": "Anheften",
"unpin": "Lösen",
"pinned": "Angeheftet",
"downloads": "Downloads",
"downloads": "Heruntergeladen",
"download": "Herunterladen",
"notification": "Benachrichtigung",
"notifications": "Benachrichtigungen",
"no_downloaded_courses": "Sie haben keine Kurse heruntergeladen.",
"no_notifications_found": "Keine Benachrichtigungen gefunden.",
"banner_notification": "Banner-Benachrichtigung",
"recent_uploads": "Neueste Uploads",
"feature_notifications": "Feature Notifications",
"confirm_unpin_title": "Lösen Bestätigen",
"confirm_unpin_message": "Sind Sie sicher, dass Sie diesen Kurs lösen möchten?",
"newest_first": "Neueste Zuerst",
Expand Down Expand Up @@ -56,6 +58,7 @@
"video_playback_speed": "Videowiedergabegeschwindigkeit",
"playback_speed": "Wiedergabegeschwindigkeit",
"add_custom_playback_speed": "Benutzerdefinierte Wiedergabegeschwindigkeit hinzufügen",
"custom_playback_speed": "Benutzerdefinierte Wiedergabegeschwindigkeit",
"logout": "Abmelden",
"more": "Mehr",
"about_us": "Über Uns",
Expand All @@ -67,7 +70,7 @@
"download_not_allowed": "Download nicht erlaubt",
"download_not_allowed_message": "Sie befinden sich derzeit in einem Mobilfunknetz. Das Video kann aufgrund Ihrer Einstellungen nicht über mobile Daten heruntergeladen werden.",
"auth_required_title": "Authentifizierung erforderlich",
"auth_required_content": "Bitte melden Sie sich an, um auf diese Funktion zuzugreifen.",
"auth_required_message": "Bitte melden Sie sich an, um auf diese Funktion zuzugreifen.",
"add_custom_speed": "Benutzerdefinierte Geschwindigkeit hinzufügen",
"enter_speed": "Geschwindigkeit eingeben (z.B. 1.7)",
"add": "Hinzufügen",
Expand All @@ -79,5 +82,16 @@
"enter_preferred_name": "Geben Sie Ihren bevorzugten Namen ein",
"enter_preferred_name_prompt": "Bitte geben Sie einen bevorzugten Namen ein",
"preferred_name": "Bevorzugter Name",
"save": "Speichern"
"save": "Speichern",
"number_too_long": "Nummer ist zu lang",
"enter_number_between": "Bitte geben Sie eine Zahl zwischen\n0.25 und 2.0 ein",
"turn_on_notifications": "Benachrichtigungen einschalten?",
"notifications_description": "Erhalten Sie sofortige Updates zu Live-Vorlesungen, bevorstehenden Quizzen und wichtigen Ankündigungen. Verpassen Sie keinen Moment Ihrer akademischen Laufbahn.",
"enable_notifications": "Benachrichtigungen aktivieren",
"skip": "Überspringen",
"forgot_password": "Passwort vergessen?",
"username": "Benutzername",
"password": "Passwort",
"enter_your_password": "Geben Sie Ihr Passwort ein",
"home": "Startseite"
}
22 changes: 18 additions & 4 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"notifications": "Notifications",
"no_downloaded_courses": "You have no downloaded courses.",
"no_notifications_found": "No notifications found.",
"banner_notification": "Banner Notification",
"banner_notification": "Banner Alerts",
"recent_uploads": "Recent Uploads",
"feature_notifications": "Feature Notifications",
"confirm_unpin_title": "Confirm Unpin",
"confirm_unpin_message": "Are you sure you want to unpin this course?",
"newest_first": "Newest First",
Expand Down Expand Up @@ -56,6 +58,7 @@
"video_playback_speed": "Video Playback Speed",
"playback_speed": "Playback Speed",
"add_custom_playback_speed": "Add Custom Playback Speed",
"custom_playback_speed": "Custom Playback Speed",
"logout": "Logout",
"more": "More",
"about_us": "About Us",
Expand All @@ -67,7 +70,7 @@
"download_not_allowed": "Download not allowed",
"download_not_allowed_message": "You are currently on mobile data. Video cannot be downloaded over mobile data due to your settings.",
"auth_required_title": "Authentication Required",
"auth_required_message": "You need to be authenticated to access this content.",
"auth_required_message": "You need to be authenticated to access this content.",
"add_custom_speed": "Add Custom Speed",
"enter_speed": "Enter speed (e.g., 1.7)",
"add": "Add",
Expand All @@ -79,5 +82,16 @@
"enter_preferred_name": "Enter your preferred name",
"enter_preferred_name_prompt": "Please enter a preferred name",
"preferred_name": "Preferred Name",
"save": "Save"
}
"save": "Save",
"number_too_long": "Number is too long",
"enter_number_between": "Please enter a number between\n0.25 and 2.0",
"turn_on_notifications": "Turn on Notifications?",
"notifications_description": "Receive instant updates on live lectures, upcoming quizzes, and important announcements. Never miss a beat in your academic journey.",
"enable_notifications": "Enable notifications",
"skip": "Skip",
"forgot_password": "Forgot Password?",
"username": "username",
"password": "password",
"enter_your_password": "Enter your password",
"home": "Home"
}
18 changes: 16 additions & 2 deletions lib/l10n/app_es.arb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"no_downloaded_courses": "No tienes cursos descargados.",
"no_notifications_found": "No se encontraron notificaciones.",
"banner_notification": "Notificación de Banner",
"recent_uploads": "Cargas Recientes",
"feature_notifications": "Feature Notifications",
"confirm_unpin_title": "Confirmar Desanclaje",
"confirm_unpin_message": "¿Estás seguro de que quieres desanclar este curso?",
"newest_first": "Los Más Nuevos Primero",
Expand Down Expand Up @@ -56,6 +58,7 @@
"video_playback_speed": "Velocidad de Reproducción de Video",
"playback_speed": "Velocidad de Reproducción",
"add_custom_playback_speed": "Agregar Velocidad de Reproducción Personalizada",
"custom_playback_speed": "Velocidad de Reproducción Personalizada",
"logout": "Cerrar Sesión",
"more": "Más",
"about_us": "Acerca de Nosotros",
Expand All @@ -67,7 +70,7 @@
"download_not_allowed": "Descarga no permitida",
"download_not_allowed_message": "Actualmente estás en datos móviles. El video no se puede descargar usando datos móviles debido a tus configuraciones.",
"auth_required_title": "Autenticación Requerida",
"auth_required_content": "Por favor, inicia sesión para acceder a esta función.",
"auth_required_message": "Por favor, inicia sesión para acceder a esta función.",
"add_custom_speed": "Agregar Velocidad Personalizada",
"enter_speed": "Ingresa la velocidad (por ejemplo, 1.7)",
"add": "Agregar",
Expand All @@ -79,5 +82,16 @@
"enter_preferred_name": "Ingresa tu nombre preferido",
"enter_preferred_name_prompt": "Por favor, ingresa un nombre preferido",
"preferred_name": "Nombre Preferido",
"save": "Guardar"
"save": "Guardar",
"number_too_long": "El número es demasiado largo",
"enter_number_between": "Por favor, introduce un número entre\n0.25 y 2.0",
"turn_on_notifications": "¿Activar notificaciones?",
"notifications_description": "Recibe actualizaciones instantáneas sobre conferencias en vivo, próximos cuestionarios y anuncios importantes. Nunca te pierdas un detalle en tu trayectoria académica.",
"enable_notifications": "Activar notificaciones",
"skip": "Omitir",
"forgot_password": "¿Olvidaste la contraseña?",
"username": "nombre de usuario",
"password": "contraseña",
"enter_your_password": "Introduce tu contraseña",
"home": "Inicio"
}
20 changes: 17 additions & 3 deletions lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"notifications": "Notifications",
"no_downloaded_courses": "Vous n'avez aucun cours téléchargé.",
"no_notifications_found": "Aucune notification trouvée.",
"banner_notification": "Notification de Bannière",
"banner_notification": "Alertes Bannière",
"recent_uploads": "Derniers Téléchargements",
"feature_notifications": "Notifications de Fonctionnalités",
"confirm_unpin_title": "Confirmer le Détachement",
"confirm_unpin_message": "Êtes-vous sûr de vouloir détacher ce cours?",
"newest_first": "Le Plus Récent en Premier",
Expand Down Expand Up @@ -56,6 +58,7 @@
"video_playback_speed": "Vitesse de Lecture Vidéo",
"playback_speed": "Vitesse de Lecture",
"add_custom_playback_speed": "Ajouter une Vitesse de Lecture Personnalisée",
"custom_playback_speed": "Vitesse de Lecture Personnalisée",
"logout": "Se Déconnecter",
"more": "Plus",
"about_us": "À Propos de Nous",
Expand All @@ -67,7 +70,7 @@
"download_not_allowed": "Téléchargement non autorisé",
"download_not_allowed_message": "Vous utilisez actuellement des données mobiles. La vidéo ne peut pas être téléchargée en utilisant les données mobiles en raison de vos paramètres.",
"auth_required_title": "Authentification requise",
"auth_required_content": "Veuillez vous connecter pour accéder à cette fonctionnalité.",
"auth_required_message": "Veuillez vous connecter pour accéder à cette fonctionnalité.",
"add_custom_speed": "Ajouter une Vitesse Personnalisée",
"enter_speed": "Entrez la vitesse (par exemple, 1.7)",
"add": "Ajouter",
Expand All @@ -79,5 +82,16 @@
"enter_preferred_name": "Entrez votre nom préféré",
"enter_preferred_name_prompt": "Veuillez entrer un nom préféré",
"preferred_name": "Nom Préféré",
"save": "Enregistrer"
"save": "Enregistrer",
"number_too_long": "Le numéro est trop long",
"enter_number_between": "Veuillez entrer un nombre entre\n0.25 et 2.0",
"turn_on_notifications": "Activer les notifications ?",
"notifications_description": "Recevez des mises à jour instantanées sur les conférences en direct, les quiz à venir et les annonces importantes. Ne manquez jamais un moment clé de votre parcours académique.",
"enable_notifications": "Activer les notifications",
"skip": "Passer",
"forgot_password": "Mot de passe oublié ?",
"username": "nom d'utilisateur",
"password": "mot de passe",
"enter_your_password": "Entrez votre mot de passe",
"home": "Accueil"
}
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class App extends ConsumerWidget {
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: L10n.all,
locale: const Locale('fr'),
locale: const Locale('de'),
theme: appTheme, // Your light theme
darkTheme: darkAppTheme, // Define your dark theme
themeMode:
Expand Down
1 change: 1 addition & 0 deletions lib/views/chat_view/chat_view_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:gocast_mobile/providers.dart';
import 'package:gocast_mobile/views/chat_view/chat_view.dart';
import 'package:logger/logger.dart';


class ChatViewState extends ConsumerState<ChatView> {
late ScrollController _scrollController;
Timer? _updateTimer;
Expand Down
6 changes: 4 additions & 2 deletions lib/views/chat_view/inactive_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import 'package:gocast_mobile/providers.dart';
import 'package:gocast_mobile/views/chat_view/suggested_streams_list.dart';
import 'package:gocast_mobile/views/video_view/video_player.dart';
import 'package:gocast_mobile/base/networking/api/gocast/api_v2.pb.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';


class InactiveView extends ConsumerStatefulWidget {
final int? streamID;
Expand Down Expand Up @@ -62,8 +64,8 @@ class InactiveViewState extends ConsumerState<InactiveView> {
),
child: Text(
chatState.accessDenied
? 'Chat is disabled for this lecture'
: 'Chat is Hidden',
? AppLocalizations.of(context)!.chat_is_disabled_for_this_lecture
: AppLocalizations.of(context)!.chat_is_hidden,
textAlign: TextAlign.center,
style: const TextStyle(
color: Colors.black,
Expand Down
38 changes: 16 additions & 22 deletions lib/views/chat_view/poll_view_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:gocast_mobile/base/networking/api/gocast/api_v2.pb.dart';
import 'package:gocast_mobile/providers.dart';
import 'package:gocast_mobile/views/chat_view/poll_view.dart';


class PollViewState extends ConsumerState<PollView> {
Timer? _updateTimer;
Map<int, int> selectedOptions = {};
Expand Down Expand Up @@ -77,7 +78,6 @@ class PollViewState extends ConsumerState<PollView> {
ThemeData themeData = Theme.of(context);
return Opacity(
opacity: 0.5,
// You might want to adjust this value based on your design needs
child: Card(
elevation: 1,
shadowColor: themeData.shadowColor,
Expand All @@ -103,11 +103,10 @@ class PollViewState extends ConsumerState<PollView> {
GridView.builder(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
// to disable GridView's scrolling
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio:
3, // Adjust the aspect ratio to fit the content
3,
),
itemCount: poll.pollOptions.length,
itemBuilder: (context, index) {
Expand All @@ -127,20 +126,19 @@ class PollViewState extends ConsumerState<PollView> {
PollOption option, int? selectedOptionId,) {
bool isSelected = option.id == selectedOptionId;
return Container(
margin: const EdgeInsets.all(4.0), // Add some spacing around each button
margin: const EdgeInsets.all(4.0),
decoration: BoxDecoration(
color: isSelected ? Colors.grey : Colors.white,
// Use grey for the selected option, white for others
borderRadius: BorderRadius.circular(8.0),
border:
Border.all(color: Colors.grey), // Use grey border for all options
Border.all(color: Colors.grey),
),
child: Center(
child: Text(
option.answer,
style: const TextStyle(
color:
Colors.black, // Text color remains black to ensure readability
Colors.black,
),
),
),
Expand Down Expand Up @@ -173,11 +171,10 @@ class PollViewState extends ConsumerState<PollView> {
GridView.builder(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
// to disable GridView's scrolling
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio:
3, // Adjust the aspect ratio to fit the content
3,
),
itemCount: poll.pollOptions.length,
itemBuilder: (context, index) {
Expand Down Expand Up @@ -228,22 +225,19 @@ class PollViewState extends ConsumerState<PollView> {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
// Center the question since there's no subtitle or trailing widget
children: [
Expanded(
child: Text(
poll.question,
style: const TextStyle(
fontSize: 16.0, // Match the font size used in _buildHeader
fontSize: 16.0,
fontWeight: FontWeight
.bold, // Match the font weight used in _buildHeader
.bold,
),
textAlign: TextAlign.center,
// Keep text alignment to center as it's a question
maxLines: 2,
// Optional: Use if you want to limit the number of lines for the question
overflow: TextOverflow
.ellipsis, // Optional: Use to handle text overflow
.ellipsis,
),
),
],
Expand All @@ -269,18 +263,18 @@ class PollViewState extends ConsumerState<PollView> {
}
: null,
style: ElevatedButton.styleFrom(
backgroundColor: Theme.of(context).primaryColor, // Use the primary color of your theme
foregroundColor: Colors.white, // Text color is white for better contrast
backgroundColor: Theme.of(context).primaryColor,
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0), // Less rounded corners for a more rectangular look
borderRadius: BorderRadius.circular(8.0),
),
padding: const EdgeInsets.symmetric(vertical: 14.0, horizontal: 30.0), // Adjust padding to control the button's shape
minimumSize: const Size(double.infinity, 48), // Ensuring full width and a consistent height
elevation: 2, // Slight elevation for a subtle shadow, adjust as needed
padding: const EdgeInsets.symmetric(vertical: 14.0, horizontal: 30.0),
minimumSize: const Size(double.infinity, 48),
elevation: 2,
),
child: const Text(
'Submit',
style: TextStyle(fontSize: 16), // Adjust font size as needed
style: TextStyle(fontSize: 16),
),
),
);
Expand Down
10 changes: 6 additions & 4 deletions lib/views/components/custom_bottom_nav_bar.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:gocast_mobile/providers.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';


class CustomBottomNavBar extends ConsumerWidget {
const CustomBottomNavBar({super.key});
Expand All @@ -25,28 +27,28 @@ class CustomBottomNavBar extends ConsumerWidget {
items: [
_buildNavigationBarItem(
Icons.home,
'Home',
AppLocalizations.of(context)!.home,
context,
currentIndex,
0,
),
_buildNavigationBarItem(
Icons.download,
'Downloads',
AppLocalizations.of(context)!.downloads,
context,
currentIndex,
1,
),
_buildNavigationBarItem(
Icons.push_pin,
'Pinned',
AppLocalizations.of(context)!.pinned,
context,
currentIndex,
2,
),
_buildNavigationBarItem(
Icons.notifications,
'Notifications',
AppLocalizations.of(context)!.notifications,
context,
currentIndex,
3,
Expand Down
Loading

0 comments on commit 99f3107

Please sign in to comment.