Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
49 changes: 48 additions & 1 deletion assets/translations/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,53 @@
"query": "Titel suche",
"scan": "Buchode scannen"
},
"add-manual": {
"title": "Buchtitel",
"authors": "Autor(en)",
"page-count": "Seitenzahl",
"optional-info": "Optionale Informationen",
"subtitle": "Untertitel",
"isbn": "ISBN Buchnummer",
"summary": "Zusammenfassung",
"error": {
"missing-information": "TODO Missing information",
"update": "TODO update",
"create": "TODO create"
}
},
"language-picker": {
"title": "Sprache",
"empty": "Wähle eine Sprache"
},
"date-picker": {
"title": "Veröffentlichungsdatum",
"empty": "Wähle ein Datum"
},
"countries": {
"not-available": "Nicht vorhanden",
"gb": "Englisch",
"de": "Deutsch",
"it": "Italienisch",
"fr": "Französisch",
"es": "Spanisch",
"pt": "Portugiesisch",
"nl": "Holländisch",
"se": "Swedisch",
"dk": "Dänisch",
"no": "Norwegisch",
"fi": "Finnisch",
"tr": "Türkisch",
"ch": "Chinesisch",
"ua": "Ukrainisch",
"ru": "Russisch",
"pl": "Polisch",
"ro": "Rumänisch",
"bg": "Bulgarisch",
"hr": "Kroatisch",
"hu": "Ungarisch",
"id": "Indonesisch",
"th": "Thai"
},
"add_label_bottom_sheet": {
"choose_a_color": "Wähle eine Farbe",
"create_new_label": "Neues Label",
Expand Down Expand Up @@ -130,7 +177,7 @@
"reset": "Zurücksetzen",
"reset_password": "Password zurücksetzen",
"reset_password_text": "Wir versenden ein Email an deine registrierte Adresse, wo du weitere Instruktionen zum Zurücksetzen findest.",
"save": "",
"save": "Speichern",
"search": {
"empty": {
"action": "Online suchen",
Expand Down
47 changes: 47 additions & 0 deletions assets/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,53 @@
"query": "Title search",
"scan": "Scan book"
},
"add-manual": {
"title": "Book Title",
"authors": "Author(s)",
"page-count": "Page Count",
"optional-info": "Optional Information",
"subtitle": "Subtitle",
"isbn": "ISBN number",
"summary": "Summary",
"error": {
"missing-information": "TODO Missing information",
"update": "TODO update",
"create": "TODO create"
}
},
"language-picker": {
"title": "Language",
"empty": "Choose a language"
},
"date-picker": {
"title": "Publish Date",
"empty": "Choose a date"
},
"countries": {
"not-available": "Not specified",
"gb": "English",
"de": "German",
"it": "Italian",
"fr": "French",
"es": "Spanish",
"pt": "Portuguese",
"nl": "Dutch",
"se": "Swedish",
"dk": "Danish",
"no": "Norwegian",
"fi": "Finnish",
"tr": "Turkish",
"ch": "Chinese",
"ua": "Ukrainian",
"ru": "Russian",
"pl": "Polish",
"ro": "Romanian",
"bg": "Bulgarian",
"hr": "Croatian",
"hu": "Hungarian",
"id": "Indonesian",
"th": "Thai"
},
"add_label_bottom_sheet": {
"choose_a_color": "Choose a color",
"create_new_label": "Create new label",
Expand Down
2 changes: 1 addition & 1 deletion ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
117 changes: 117 additions & 0 deletions lib/src/data/core/language.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
enum Language {
na(
countryCode: null,
translationKey: 'countries.not-available',
),
english(
countryCode: 'GB',
translationKey: 'countries.gb',
alternativeCountryCodes: [
'en',
],
),
german(
countryCode: 'DE',
translationKey: 'countries.de',
),
italian(
countryCode: 'IT',
translationKey: 'countries.it',
),
french(
countryCode: 'FR',
translationKey: 'countries.fr',
),
spanish(
countryCode: 'ES',
translationKey: 'countries.es',
),
portuguese(
countryCode: 'PT',
translationKey: 'countries.pt',
),
dutch(
countryCode: 'NL',
translationKey: 'countries.nl',
),
chinese(
countryCode: 'CH',
translationKey: 'countries.ch',
),
ukrainian(
countryCode: 'UA',
translationKey: 'countries.ua',
),
swedish(
countryCode: 'SE',
translationKey: 'countries.se',
),
danish(
countryCode: 'DK',
translationKey: 'countries.dk',
),
norwegian(
countryCode: 'NO',
translationKey: 'countries.no',
),
polish(
countryCode: 'PL',
translationKey: 'countries.pl',
),
rumanian(
countryCode: 'RO',
translationKey: 'countries.ro',
),
bulgarian(
countryCode: 'BG',
translationKey: 'countries.bg',
),
croatian(
countryCode: 'HR',
translationKey: 'countries.hr',
),
hungarian(
countryCode: 'HU',
translationKey: 'countries.hu',
),
turkish(
countryCode: 'TR',
translationKey: 'countries.tr',
),
russian(
countryCode: 'RU',
translationKey: 'countries.ru',
),
indonesian(
countryCode: 'ID',
translationKey: 'countries.id',
),
thai(
countryCode: 'TH',
translationKey: 'countries.th',
);

final String? countryCode;
final String translationKey;
final List<String> alternativeCountryCodes;

List<String?> get countryCodes {
return [
countryCode?.toLowerCase(),
...alternativeCountryCodes.map((a) => a.toLowerCase()),
];
}

const Language({
required this.countryCode,
required this.translationKey,
this.alternativeCountryCodes = const [],
});

static Language fromCountryCode(String countryCode) {
return Language.values.firstWhere(
(element) => element.countryCodes.contains(countryCode.toLowerCase()),
orElse: () => Language.na,
);
}
}
23 changes: 23 additions & 0 deletions lib/src/providers/app_router.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:dantex/src/providers/authentication.dart';
import 'package:dantex/src/ui/add/manual_add_edit_book_page.dart';
import 'package:dantex/src/ui/add/scan_book_page.dart';
import 'package:dantex/src/ui/book/book_detail_page.dart';
import 'package:dantex/src/ui/book/book_notes_page.dart';
Expand Down Expand Up @@ -157,6 +158,18 @@ List<RouteBase> _mainRoutes = [
builder: (BuildContext context, GoRouterState state) =>
const ScanBookPage(),
),
GoRoute(
path: DanteRoute.manualAdd.url,
builder: (BuildContext context, GoRouterState state) =>
const ManualAddEditBookPage(),
),
GoRoute(
path: DanteRoute.editBook.url,
builder: (context, state) {
final bookId = state.pathParameters['bookId'] ?? '';
return ManualAddEditBookPage(bookId: bookId);
},
),
GoRoute(
path: DanteRoute.bookDetail.url,
builder: (context, state) {
Expand Down Expand Up @@ -199,6 +212,16 @@ enum DanteRoute {
mobileUrl: 'scan',
navigationUrl: '/scan',
),
manualAdd(
webUrl: '/add-manual',
mobileUrl: 'add-manual',
navigationUrl: '/add-manual',
),
editBook(
webUrl: '/edit/:bookId',
mobileUrl: 'edit/:bookId',
navigationUrl: '/edit/:bookId',
),
settings(
webUrl: '/settings',
mobileUrl: 'settings',
Expand Down
Loading