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

adding localization mvp #364

Open
wants to merge 24 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
08c4ec1
adding localization mvp
User623-crypto Feb 21, 2023
54a0d55
removing de
User623-crypto Feb 28, 2023
adfe3cf
changing the intl file
User623-crypto Feb 28, 2023
cf9b0b0
fix: add manual logging to auth repo
Xazin Mar 4, 2023
649893f
Merge pull request #371 from CollActionteam/fix/manual-logging-auth-repo
Xazin Mar 4, 2023
023d67e
chore: upgrade gradle build tools and dependencies
Xazin Mar 4, 2023
d7926c1
feat: crowdaction description markdown support
Xazin Mar 17, 2023
ba1c98f
Merge pull request #375 from CollActionteam/feat/markdown-support
Xazin Mar 18, 2023
c39f022
fix: amend minor bugs with navigation
Xazin Mar 18, 2023
c5a9ac1
Merge pull request #376 from CollActionteam/fix/rc1.2.0-1/minor-bugs
Xazin Mar 18, 2023
1c65601
fix: analyzer
Xazin Mar 18, 2023
130fb19
Merge pull request #377 from CollActionteam/fix/rc1.2.0-2/analyzer
Xazin Mar 18, 2023
6f68ecd
chore: update pods
Xazin Mar 18, 2023
2da3bd3
Merge pull request #378 from CollActionteam/chore/pod-update
Xazin Mar 18, 2023
33b8a82
refactor: showPasswordModal
Xazin Mar 19, 2023
0ab8494
Merge pull request #379 from CollActionteam/refactor/password-modal
Xazin Mar 19, 2023
4bc6127
cicd: fix info plist into environment
Xazin Mar 19, 2023
e21f736
Merge pull request #380 from CollActionteam/chore/refac-cicd-infoplist
Xazin Mar 19, 2023
2c905c2
chore: try with custom error builder
Xazin Mar 19, 2023
fc61af4
Merge pull request #381 from CollActionteam/chore/custom-error-builder
Xazin Mar 19, 2023
e3e1a56
.
User623-crypto Mar 20, 2023
9c1d209
Merge branch 'development' into HEAD
User623-crypto Mar 20, 2023
6789b9a
removing unused imports
User623-crypto Mar 20, 2023
9025df4
Merge branch 'development' into AddingLocalization
Xazin Apr 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions l10n.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
arb-dir: lib/l10n
template-arb-file: intl_en.arb
output-localization-file: app_localizations.dart
class-name: S
main-locale: en
21 changes: 0 additions & 21 deletions lib/core/utils/ifrebase_crashlytics_extension.dart

This file was deleted.

67 changes: 67 additions & 0 deletions lib/generated/intl/messages_all.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
// This is a library that looks up messages for specific locales by
// delegating to the appropriate library.

// Ignore issues from commonly used lints in this file.
// ignore_for_file:implementation_imports, file_names, unnecessary_new
// ignore_for_file:unnecessary_brace_in_string_interps, directives_ordering
// ignore_for_file:argument_type_not_assignable, invalid_assignment
// ignore_for_file:prefer_single_quotes, prefer_generic_function_type_aliases
// ignore_for_file:comment_references

import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';
import 'package:intl/src/intl_helpers.dart';

import 'messages_en.dart' as messages_en;
import 'messages_nl.dart' as messages_nl;

typedef Future<dynamic> LibraryLoader();
Map<String, LibraryLoader> _deferredLibraries = {
'en': () => new SynchronousFuture(null),
'nl': () => new SynchronousFuture(null),
};

MessageLookupByLibrary? _findExact(String localeName) {
switch (localeName) {
case 'en':
return messages_en.messages;
case 'nl':
return messages_nl.messages;
default:
return null;
}
}

/// User programs should call this before using [localeName] for messages.
Future<bool> initializeMessages(String localeName) {
var availableLocale = Intl.verifiedLocale(
localeName, (locale) => _deferredLibraries[locale] != null,
onFailure: (_) => null);
if (availableLocale == null) {
return new SynchronousFuture(false);
}
var lib = _deferredLibraries[availableLocale];
lib == null ? new SynchronousFuture(false) : lib();
initializeInternalMessageLookup(() => new CompositeMessageLookup());
messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor);
return new SynchronousFuture(true);
}

bool _messagesExistFor(String locale) {
try {
return _findExact(locale) != null;
} catch (e) {
return false;
}
}

MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) {
var actualLocale =
Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null);
if (actualLocale == null) return null;
return _findExact(actualLocale);
}
34 changes: 34 additions & 0 deletions lib/generated/intl/messages_en.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
// This is a library that provides messages for a en locale. All the
// messages from the main program should be duplicated here with the same
// function name.

// Ignore issues from commonly used lints in this file.
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
// ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes
// ignore_for_file:unnecessary_string_interpolations, unnecessary_string_escapes

import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';

final messages = new MessageLookup();

typedef String MessageIfAbsent(String messageStr, List<dynamic> args);

class MessageLookup extends MessageLookupByLibrary {
String get localeName => 'en';

static String m0(name) => "Welcome ${name}";

final messages = _notInlinedMessages(_notInlinedMessages);
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
"demoScreen": MessageLookupByLibrary.simpleMessage("Demo Screen"),
"mainTitle": MessageLookupByLibrary.simpleMessage("Coll Action"),
"name": MessageLookupByLibrary.simpleMessage("Name"),
"next": MessageLookupByLibrary.simpleMessage("Next"),
"pageHomeConfirm": MessageLookupByLibrary.simpleMessage("Confirm"),
"pageHomeWelcome": m0
};
}
37 changes: 37 additions & 0 deletions lib/generated/intl/messages_nl.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
// This is a library that provides messages for a nl locale. All the
// messages from the main program should be duplicated here with the same
// function name.

// Ignore issues from commonly used lints in this file.
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
// ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes
// ignore_for_file:unnecessary_string_interpolations, unnecessary_string_escapes

import 'package:intl/intl.dart';
import 'package:intl/message_lookup_by_library.dart';

final messages = new MessageLookup();

typedef String MessageIfAbsent(String messageStr, List<dynamic> args);

class MessageLookup extends MessageLookupByLibrary {
String get localeName => 'nl';

static String m0(name) => "Welcome ${name}";

final messages = _notInlinedMessages(_notInlinedMessages);
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
"demoScreen":
MessageLookupByLibrary.simpleMessage("Demo Screen in Holland"),
"mainTitle":
MessageLookupByLibrary.simpleMessage("Coll Action in Holland"),
"name": MessageLookupByLibrary.simpleMessage("Name in Holland"),
"next": MessageLookupByLibrary.simpleMessage("Next in Holland"),
"pageHomeConfirm":
MessageLookupByLibrary.simpleMessage("Confirm in Holland"),
"pageHomeWelcome": m0
};
}
139 changes: 139 additions & 0 deletions lib/generated/l10n.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 16 additions & 3 deletions lib/infrastructure/auth/firebase_auth_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:get_it/get_it.dart';
import 'package:injectable/injectable.dart';
import 'package:rxdart/subjects.dart';

import '../../core/utils/ifrebase_crashlytics_extension.dart';
import '../../core/utils/firebase_crashlytics_extension.dart';
import '../../domain/auth/auth_failures.dart';
import '../../domain/auth/auth_success.dart';
import '../../domain/auth/i_auth_repository.dart';
Expand Down Expand Up @@ -53,7 +53,14 @@ class FirebaseAuthRepository implements IAuthRepository, Disposable {

result.add(right(AuthSuccess.codeSent(credential: credential)));
},
verificationFailed: (firebase_auth.FirebaseAuthException error) {
verificationFailed: (firebase_auth.FirebaseAuthException error) async {
await FirebaseCrashlyticsLogger.warn(
error,
error.stackTrace,
message:
'[FirebaseAuthRepository] verifyPhoneNumber().verificationFailed',
);

result.add(left(error.toFailure()));
result.close();
},
Expand Down Expand Up @@ -165,7 +172,13 @@ class FirebaseAuthRepository implements IAuthRepository, Disposable {

result.add(right(AuthSuccess.codeSent(credential: credential)));
},
verificationFailed: (firebase_auth.FirebaseAuthException error) {
verificationFailed: (firebase_auth.FirebaseAuthException error) async {
await FirebaseCrashlyticsLogger.warn(
error,
error.stackTrace,
message: '[FirebaseAuthRepository] resendOTP().verificationFailed',
);

result.add(left(error.toFailure()));
result.close();
},
Expand Down
8 changes: 8 additions & 0 deletions lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"pageHomeConfirm": "Confirm",
"pageHomeWelcome": "Welcome {name}",
"name":"Name",
"next":"Next",
"mainTitle":"Coll Action",
"demoScreen":"Demo Screen"
}
8 changes: 8 additions & 0 deletions lib/l10n/intl_nl.arb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"pageHomeConfirm": "Confirm in Holland",
"pageHomeWelcome": "Welcome {name}",
"name":"Name in Holland",
"next":"Next in Holland",
"mainTitle":"Coll Action in Holland",
"demoScreen":"Demo Screen in Holland"
}
Loading