Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #14

Merged
merged 10 commits into from
Mar 10, 2024
2 changes: 0 additions & 2 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ jobs:
channel: "stable"
- run: flutter pub get
- run: flutter analyze
- run: dart format --set-exit-if-changed lib
- run: dart format --set-exit-if-changed test
- run: flutter test --coverage
- run: flutter test --machine > test-results.json
- uses: dorny/test-reporter@v1
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ jobs:
channel: stable
- run: flutter pub get
- run: flutter analyze
- run: dart format --set-exit-if-changed lib
- run: dart format --set-exit-if-changed test
- run: flutter test --coverage
- run: flutter test --machine > test-results.json
- uses: dorny/test-reporter@v1
Expand Down
58 changes: 36 additions & 22 deletions lib/app/core/l10n/localizations/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';

import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:intl/intl.dart' as intl;

import 'package:site/app/core/l10n/l10n.dart';
import 'app_localizations_en.dart';
import 'app_localizations_es.dart';
import 'app_localizations_pt.dart';

/// Callers can lookup localized strings with an instance of AppLocalizations
/// returned by `AppLocalizations.of(context)`.
Expand Down Expand Up @@ -60,17 +61,15 @@ import 'package:site/app/core/l10n/l10n.dart';
/// be consistent with the languages listed in the AppLocalizations.supportedLocales
/// property.
abstract class AppLocalizations {
AppLocalizations(String locale)
: localeName = intl.Intl.canonicalizedLocale(locale.toString());
AppLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString());

final String localeName;

static AppLocalizations? of(BuildContext context) {
return Localizations.of<AppLocalizations>(context, AppLocalizations);
}

static const LocalizationsDelegate<AppLocalizations> delegate =
_AppLocalizationsDelegate();
static const LocalizationsDelegate<AppLocalizations> delegate = _AppLocalizationsDelegate();

/// A list of this localizations delegate along with the default localizations
/// delegates.
Expand All @@ -82,8 +81,7 @@ abstract class AppLocalizations {
/// Additional delegates can be added by appending to this list in
/// MaterialApp. This list does not have to be used at all if a custom list
/// of delegates is preferred or required.
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =
<LocalizationsDelegate<dynamic>>[
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates = <LocalizationsDelegate<dynamic>>[
delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
Expand Down Expand Up @@ -397,6 +395,12 @@ abstract class AppLocalizations {
/// **'Insira um nome maior.'**
String get insertABiggerName;

/// No description provided for @insertALittleName.
///
/// In pt, this message translates to:
/// **'Insira um nome menor.'**
String get insertALittleName;

/// No description provided for @thisNameIsNotValid.
///
/// In pt, this message translates to:
Expand Down Expand Up @@ -427,6 +431,12 @@ abstract class AppLocalizations {
/// **'Insira uma mensagem maior.'**
String get insertABiggerMessage;

/// No description provided for @insertALittleMessage.
///
/// In pt, this message translates to:
/// **'Insira uma mensagem menor.'**
String get insertALittleMessage;

/// No description provided for @thisMessageIsNotValid.
///
/// In pt, this message translates to:
Expand All @@ -445,15 +455,20 @@ abstract class AppLocalizations {
/// **'Insira um assunto maior.'**
String get insertABiggerSubject;

/// No description provided for @insertALittleSubject.
///
/// In pt, this message translates to:
/// **'Insira um assunto menor.'**
String get insertALittleSubject;

/// No description provided for @thisSubjectIsNotValid.
///
/// In pt, this message translates to:
/// **'Este assunto não é válido.'**
String get thisSubjectIsNotValid;
}

class _AppLocalizationsDelegate
extends LocalizationsDelegate<AppLocalizations> {
class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
const _AppLocalizationsDelegate();

@override
Expand All @@ -462,27 +477,26 @@ class _AppLocalizationsDelegate
}

@override
bool isSupported(Locale locale) =>
<String>['en', 'es', 'pt'].contains(locale.languageCode);
bool isSupported(Locale locale) => <String>['en', 'es', 'pt'].contains(locale.languageCode);

@override
bool shouldReload(_AppLocalizationsDelegate old) => false;
}

AppLocalizations lookupAppLocalizations(Locale locale) {


// Lookup logic when only language code is specified.
switch (locale.languageCode) {
case 'en':
return AppLocalizationsEn();
case 'es':
return AppLocalizationsEs();
case 'pt':
return AppLocalizationsPt();
case 'en': return AppLocalizationsEn();
case 'es': return AppLocalizationsEs();
case 'pt': return AppLocalizationsPt();
}

throw FlutterError(
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
'an issue with the localizations generation tool. Please file an issue '
'on GitHub with a reproducible sample app and the gen-l10n configuration '
'that was used.');
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
'an issue with the localizations generation tool. Please file an issue '
'on GitHub with a reproducible sample app and the gen-l10n configuration '
'that was used.'
);
}
17 changes: 12 additions & 5 deletions lib/app/core/l10n/localizations/app_localizations_en.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:site/app/core/l10n/l10n.dart';
import 'app_localizations.dart';

/// The translations for English (`en`).
class AppLocalizationsEn extends AppLocalizations {
Expand All @@ -17,8 +17,7 @@ class AppLocalizationsEn extends AppLocalizations {
String get hiIAmFelipeSales => 'Hi, I\'m Felipe Sales';

@override
String get developerFocused =>
'Developer focused on applying his knowledge in practice and building amazing things through lines of code.';
String get developerFocused => 'Developer focused on applying his knowledge in practice and building amazing things through lines of code.';

@override
String get appsDeveloper => '> Apps Developer';
Expand Down Expand Up @@ -48,8 +47,7 @@ class AppLocalizationsEn extends AppLocalizations {
String get seeProjectsUpper => 'SEE PROJECTS';

@override
String get projectAreInMyGitHub =>
'Most of the projects I have developed are completely open-source on my GitHub.';
String get projectAreInMyGitHub => 'Most of the projects I have developed are completely open-source on my GitHub.';

@override
String get experience => 'Experience';
Expand Down Expand Up @@ -156,6 +154,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get insertABiggerName => 'Please enter a longer name.';

@override
String get insertALittleName => 'Please enter a shorter name.';

@override
String get thisNameIsNotValid => 'This name is not valid.';

Expand All @@ -171,6 +172,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get insertABiggerMessage => 'Please enter a longer message.';

@override
String get insertALittleMessage => 'Please enter a shorter message.';

@override
String get thisMessageIsNotValid => 'This message is not valid.';

Expand All @@ -180,6 +184,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get insertABiggerSubject => 'Please enter a longer subject.';

@override
String get insertALittleSubject => 'Please enter a shorter subject.';

@override
String get thisSubjectIsNotValid => 'This subject is not valid.';
}
23 changes: 14 additions & 9 deletions lib/app/core/l10n/localizations/app_localizations_es.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:site/app/core/l10n/l10n.dart';
import 'app_localizations.dart';

/// The translations for Spanish Castilian (`es`).
class AppLocalizationsEs extends AppLocalizations {
Expand All @@ -11,15 +11,13 @@ class AppLocalizationsEs extends AppLocalizations {
String get felipeSales => 'Felipe Sales';

@override
String get flutterDeveloperInstructor =>
'Instructor de Desarrollador Flutter';
String get flutterDeveloperInstructor => 'Instructor de Desarrollador Flutter';

@override
String get hiIAmFelipeSales => 'Hola, soy Felipe Sales';

@override
String get developerFocused =>
'Desarrollador enfocado en aplicar sus conocimientos en la práctica y construir cosas increíbles a través de líneas de código.';
String get developerFocused => 'Desarrollador enfocado en aplicar sus conocimientos en la práctica y construir cosas increíbles a través de líneas de código.';

@override
String get appsDeveloper => '> Desarrollador de aplicaciones';
Expand Down Expand Up @@ -49,8 +47,7 @@ class AppLocalizationsEs extends AppLocalizations {
String get seeProjectsUpper => 'VER PROYECTOS';

@override
String get projectAreInMyGitHub =>
'La mayoría de los proyectos que he desarrollado son completamente de código abierto en mi GitHub.';
String get projectAreInMyGitHub => 'La mayoría de los proyectos que he desarrollado son completamente de código abierto en mi GitHub.';

@override
String get experience => 'Experiencia';
Expand Down Expand Up @@ -137,8 +134,7 @@ class AppLocalizationsEs extends AppLocalizations {
String get dot => '.';

@override
String get flutterProjectOpenSource =>
'Un proyecto Flutter de código abierto.';
String get flutterProjectOpenSource => 'Un proyecto Flutter de código abierto.';

@override
String get seeInGitHub => 'Ver en GitHub';
Expand All @@ -158,6 +154,9 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get insertABiggerName => 'Ingrese un nombre más largo.';

@override
String get insertALittleName => 'Ingrese un nombre más corto.';

@override
String get thisNameIsNotValid => 'Este nombre no es válido.';

Expand All @@ -173,6 +172,9 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get insertABiggerMessage => 'Ingrese un mensaje más largo.';

@override
String get insertALittleMessage => 'Ingrese un mensaje más corto.';

@override
String get thisMessageIsNotValid => 'Este mensaje no es válido.';

Expand All @@ -182,6 +184,9 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get insertABiggerSubject => 'Ingrese un asunto más largo.';

@override
String get insertALittleSubject => 'Ingrese un asunto más corto.';

@override
String get thisSubjectIsNotValid => 'Este asunto no es válido.';
}
17 changes: 12 additions & 5 deletions lib/app/core/l10n/localizations/app_localizations_pt.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:site/app/core/l10n/l10n.dart';
import 'app_localizations.dart';

/// The translations for Portuguese (`pt`).
class AppLocalizationsPt extends AppLocalizations {
Expand All @@ -17,8 +17,7 @@ class AppLocalizationsPt extends AppLocalizations {
String get hiIAmFelipeSales => 'Olá, sou Felipe Sales';

@override
String get developerFocused =>
'Desenvolvedor focado em aplicar seus conhecimentos em prática e construir coisas incríveis através de linhas de código.';
String get developerFocused => 'Desenvolvedor focado em aplicar seus conhecimentos em prática e construir coisas incríveis através de linhas de código.';

@override
String get appsDeveloper => '> Desenvolvedor de Apps';
Expand Down Expand Up @@ -48,8 +47,7 @@ class AppLocalizationsPt extends AppLocalizations {
String get seeProjectsUpper => 'VER PROJETOS';

@override
String get projectAreInMyGitHub =>
'Grande parte dos projetos que já desenvolvi estão no meu GitHub de forma completamente open-source.';
String get projectAreInMyGitHub => 'Grande parte dos projetos que já desenvolvi estão no meu GitHub de forma completamente open-source.';

@override
String get experience => 'Experiência';
Expand Down Expand Up @@ -156,6 +154,9 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get insertABiggerName => 'Insira um nome maior.';

@override
String get insertALittleName => 'Insira um nome menor.';

@override
String get thisNameIsNotValid => 'Este nome não é válido.';

Expand All @@ -171,6 +172,9 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get insertABiggerMessage => 'Insira uma mensagem maior.';

@override
String get insertALittleMessage => 'Insira uma mensagem menor.';

@override
String get thisMessageIsNotValid => 'Esta mensagem não é válida.';

Expand All @@ -180,6 +184,9 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get insertABiggerSubject => 'Insira um assunto maior.';

@override
String get insertALittleSubject => 'Insira um assunto menor.';

@override
String get thisSubjectIsNotValid => 'Este assunto não é válido.';
}
3 changes: 3 additions & 0 deletions lib/app/core/l10n/templates/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@
"createdByFelipeCastroSales": "Created by @felipecastrosales™",
"insertValidName": "Please enter a valid name.",
"insertABiggerName": "Please enter a longer name.",
"insertALittleName": "Please enter a shorter name.",
"thisNameIsNotValid": "This name is not valid.",
"insertValidEmail": "Please enter a valid email address.",
"thisEmailIsNotValid": "This email address is not valid.",
"insertValidMessage": "Please enter a valid message.",
"insertABiggerMessage": "Please enter a longer message.",
"insertALittleMessage": "Please enter a shorter message.",
"thisMessageIsNotValid": "This message is not valid.",
"insertValidSubject": "Please enter a valid subject.",
"insertABiggerSubject": "Please enter a longer subject.",
"insertALittleSubject": "Please enter a shorter subject.",
"thisSubjectIsNotValid": "This subject is not valid."
}
3 changes: 3 additions & 0 deletions lib/app/core/l10n/templates/app_es.arb
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@
"createdByFelipeCastroSales": "Creado por @felipecastrosales™",
"insertValidName": "Ingrese un nombre válido.",
"insertABiggerName": "Ingrese un nombre más largo.",
"insertALittleName": "Ingrese un nombre más corto.",
"thisNameIsNotValid": "Este nombre no es válido.",
"insertValidEmail": "Ingrese un email válido.",
"thisEmailIsNotValid": "Este email no es válido.",
"insertValidMessage": "Ingrese un mensaje válido.",
"insertABiggerMessage": "Ingrese un mensaje más largo.",
"insertALittleMessage": "Ingrese un mensaje más corto.",
"thisMessageIsNotValid": "Este mensaje no es válido.",
"insertValidSubject": "Ingrese un asunto válido.",
"insertABiggerSubject": "Ingrese un asunto más largo.",
"insertALittleSubject": "Ingrese un asunto más corto.",
"thisSubjectIsNotValid": "Este asunto no es válido."
}
3 changes: 3 additions & 0 deletions lib/app/core/l10n/templates/app_pt.arb
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@
"createdByFelipeCastroSales": "Criado por @felipecastrosales™",
"insertValidName": "Insira um nome válido.",
"insertABiggerName": "Insira um nome maior.",
"insertALittleName": "Insira um nome menor.",
"thisNameIsNotValid": "Este nome não é válido.",
"insertValidEmail": "Insira um e-mail válido.",
"thisEmailIsNotValid": "Este e-mail não é válido.",
"insertValidMessage": "Insira uma mensagem válida.",
"insertABiggerMessage": "Insira uma mensagem maior.",
"insertALittleMessage": "Insira uma mensagem menor.",
"thisMessageIsNotValid": "Esta mensagem não é válida.",
"insertValidSubject": "Insira um assunto válido.",
"insertABiggerSubject": "Insira um assunto maior.",
"insertALittleSubject": "Insira um assunto menor.",
"thisSubjectIsNotValid": "Este assunto não é válido."
}
Loading
Loading