Skip to content

Commit

Permalink
Add Norwegian language support
Browse files Browse the repository at this point in the history
  • Loading branch information
tverra committed Jul 8, 2020
1 parent 96d1ca9 commit 91dac6e
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 11 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ See the example for simple use
- Hebrew (HE)
- Indonesian (ID)
- Turkish (TR)
- Norwegian (NO)

31 changes: 20 additions & 11 deletions lib/i18n/date_picker_i18n.dart
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
import 'dart:math';

part 'strings_en_us.dart';
part 'strings_zh_cn.dart';
part 'strings_pt_br.dart';
part 'strings_es.dart';
part 'strings_ro.dart';
part 'strings_bn.dart';
part 'strings_ar.dart';
part 'strings_jp.dart';
part 'strings_ru.dart';
part 'strings_bn.dart';
part 'strings_de.dart';
part 'strings_ko.dart';
part 'strings_it.dart';
part 'strings_hu.dart';
part 'strings_en_us.dart';
part 'strings_es.dart';
part 'strings_he.dart';
part 'strings_hu.dart';
part 'strings_id.dart';
part 'strings_it.dart';
part 'strings_jp.dart';
part 'strings_ko.dart';
part 'strings_no_nb.dart';
part 'strings_no_nn.dart';
part 'strings_pt_br.dart';
part 'strings_ro.dart';
part 'strings_ru.dart';
part 'strings_tr.dart';
part 'strings_zh_cn.dart';

abstract class _StringsI18n {
const _StringsI18n();
Expand Down Expand Up @@ -85,6 +87,11 @@ enum DateTimePickerLocale {
/// Turkish (TR)
tr,

/// Norwegian Bokmål (NO)
no_nb,

/// Norwegian Nynorsk (NO)
no_nn
}

/// Default value of date locale
Expand All @@ -108,6 +115,8 @@ const Map<DateTimePickerLocale, _StringsI18n> datePickerI18n = {
DateTimePickerLocale.he: const _StringsHe(),
DateTimePickerLocale.id: const _StringsId(),
DateTimePickerLocale.tr: const _StringsTr(),
DateTimePickerLocale.no_nb: const _StringsNoNb(),
DateTimePickerLocale.no_nn: const _StringsNoNn(),
};

class DatePickerI18n {
Expand Down
60 changes: 60 additions & 0 deletions lib/i18n/strings_no_nb.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
part of 'date_picker_i18n.dart';

/// Norwegian Bokmål (NO)
class _StringsNoNb extends _StringsI18n {
const _StringsNoNb();

@override
String getCancelText() {
return 'Avbryt';
}

@override
String getDoneText() {
return 'Ferdig';
}

@override
List<String> getMonths() {
return [
"Januar",
"Februar",
"Mars",
"April",
"Mai",
"Juni",
"Juli",
"August",
"September",
"Oktober",
"November",
"Desember"
];
}

@override
List<String> getWeeksFull() {
return [
"Mandag",
"Tirsdag",
"Onsdag",
"Torsdag",
"Fredag",
"Lørdag",
"Søndag",
];
}

@override
List<String> getWeeksShort() {
return [
"Man",
"Tir",
"Ons",
"Tor",
"Fre",
"Lør",
"Søn",
];
}
}
60 changes: 60 additions & 0 deletions lib/i18n/strings_no_nn.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
part of 'date_picker_i18n.dart';

/// Norwegian Nynorsk (NO)
class _StringsNoNn extends _StringsI18n {
const _StringsNoNn();

@override
String getCancelText() {
return 'Avbryt';
}

@override
String getDoneText() {
return 'Ferdig';
}

@override
List<String> getMonths() {
return [
"Januar",
"Februar",
"Mars",
"April",
"Mai",
"Juni",
"Juli",
"August",
"September",
"Oktober",
"November",
"Desember"
];
}

@override
List<String> getWeeksFull() {
return [
"Måndag",
"Tysdag",
"Onsdag",
"Torsdag",
"Fredag",
"Laurdag",
"Søndag",
];
}

@override
List<String> getWeeksShort() {
return [
"Mån",
"Tys",
"Ons",
"Tor",
"Fre",
"Lau",
"Søn",
];
}
}

0 comments on commit 91dac6e

Please sign in to comment.