-
Notifications
You must be signed in to change notification settings - Fork 92
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
Spanish language support #283
Labels
good first issue
Good for newcomers
Comments
I don't speak Spanish, so I'm leaving this for someone who does. |
2 tasks
You can create a custom class, this way you can add any language you want. This is the class I am using in my application. I am using easy_localization for the translations. import 'package:easy_localization/easy_localization.dart';
import 'package:feedback/feedback.dart';
import 'package:flutter/material.dart';
class CustomFeedbackLocalizations implements FeedbackLocalizations {
@override
String get draw => tr('feedBackPage.draw');
@override
String get feedbackDescriptionText => tr('feedBackPage.description');
@override
String get navigate => tr('feedBackPage.navigate');
@override
String get submitButtonText => tr('feedBackPage.submit');
}
class CustomFeedbackLocalizationsDelegate
extends GlobalFeedbackLocalizationsDelegate {
@override
// ignore: overridden_fields
final supportedLocales = <Locale, FeedbackLocalizations>{
const Locale('de'): CustomFeedbackLocalizations(),
const Locale('en'): CustomFeedbackLocalizations(),
const Locale('es'): CustomFeedbackLocalizations(),
const Locale('fr'): CustomFeedbackLocalizations(),
const Locale('nl'): CustomFeedbackLocalizations(),
const Locale('pt'): CustomFeedbackLocalizations(),
const Locale('ru'): CustomFeedbackLocalizations(),
const Locale('uk'): CustomFeedbackLocalizations(),
};
} In your return BetterFeedback(
localizationsDelegates: [
...context.localizationDelegates,
CustomFeedbackLocalizationsDelegate(),
],
localeOverride: context.locale,
child: MaterialApp(
locale: context.locale,
localizationsDelegates: context.localizationDelegates,
supportedLocales: context.supportedLocales,
),
), It could be possible that I have forgotten something, please let me know if you need some help @as-stefit . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In my app I'm using spanish language, would be nice to have it as well :)
The text was updated successfully, but these errors were encountered: