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

Added support for Vietnamese localization ('vi') #13

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
2 changes: 1 addition & 1 deletion lib/src/dialogs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ class _MonthYearPickerDialogState extends State<MonthYearPickerDialog> {
duration: _dialogSizeAnimationDuration,
curve: Curves.easeOut,
left: 0.0,
right: (pickerMaxWidth - (width ?? pickerMaxWidth)),
right: 0.0,
top: _isShowingYear ? constraints.maxHeight : 0.0,
bottom: _isShowingYear ? -constraints.maxHeight : 0.0,
child: SizedBox(
Expand Down
6 changes: 5 additions & 1 deletion lib/src/l10n/month_year_picker_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'month_year_picker_localizations_de.dart';
import 'month_year_picker_localizations_en.dart';
import 'month_year_picker_localizations_id.dart';
import 'month_year_picker_localizations_ms.dart';
import 'month_year_picker_localizations_vi.dart';

/// Callers can lookup localized strings with an instance of MonthYearPickerLocalizations returned
/// by `MonthYearPickerLocalizations.of(context)`.
Expand Down Expand Up @@ -101,6 +102,7 @@ abstract class MonthYearPickerLocalizations {
Locale('ms'),
Locale('de'),
Locale('id'),
Locale('vi'),
];

/// No description provided for @helpText.
Expand Down Expand Up @@ -134,7 +136,7 @@ class _MonthYearPickerLocalizationsDelegate

@override
bool isSupported(Locale locale) =>
<String>['ar', 'en', 'ms', 'de', 'id'].contains(locale.languageCode);
<String>['ar', 'en', 'ms', 'de', 'id', 'vi'].contains(locale.languageCode);

@override
bool shouldReload(_MonthYearPickerLocalizationsDelegate old) => false;
Expand All @@ -153,6 +155,8 @@ MonthYearPickerLocalizations lookupMonthYearPickerLocalizations(Locale locale) {
return MonthYearPickerLocalizationsDe();
case 'id':
return MonthYearPickerLocalizationsId();
case 'vi':
return MonthYearPickerLocalizationsVi();
}

throw FlutterError(
Expand Down
15 changes: 15 additions & 0 deletions lib/src/l10n/month_year_picker_localizations_vi.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'month_year_picker_localizations.dart';

/// The translations for English (`en`).
class MonthYearPickerLocalizationsVi extends MonthYearPickerLocalizations {
MonthYearPickerLocalizationsVi([String locale = 'vi']) : super(locale);

@override
String get helpText => 'Chọn tháng';

@override
String get okButtonLabel => 'OK';

@override
String get cancelButtonLabel => 'Hủy';
}
5 changes: 5 additions & 0 deletions lib/src/l10n/month_year_picker_vi.arb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"helpText": "Chọn tháng",
"okButtonLabel": "OK",
"cancelButtonLabel": "Hủy"
}