I am using flutter localization from their official documentation here, and I am using clean architecture in my project. I want to access the app localization class without a context so I can translate the error messages in the repository file.
Here is an example:
class UserRepository{
Future<Either<Failure, Unit>> logOut() async{
try{
return const Right(unit);
}catch(e){
return const Left(AuthFailure('I want to translate this error based on app`s language'));
}
}
}