Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Commit

Permalink
feat: add pt_br language support and tooltips on menu side bar
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleKun committed Oct 17, 2021
1 parent 42b8c1e commit e0f92af
Show file tree
Hide file tree
Showing 11 changed files with 415 additions and 6 deletions.
11 changes: 7 additions & 4 deletions lib/components/side_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,13 @@ class _SideBarState extends State<SideBar> {
padding: EdgeInsets.symmetric(
vertical: remToPx(0.25),
),
child: Icon(
x.icon,
size: remToPx(1.25),
color: color,
child: Tooltip(
message: x.name,
child: Icon(
x.icon,
size: remToPx(1.25),
color: color,
),
),
),
),
Expand Down
2 changes: 2 additions & 0 deletions lib/components/trackers/media_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ class _MediaListState extends State<MediaList> with DidLoadStater {
}
: null,
icon: const Icon(Icons.arrow_back),
tooltip: Translator.t.back(),
),
SizedBox(
width: remToPx(0.8),
Expand All @@ -170,6 +171,7 @@ class _MediaListState extends State<MediaList> with DidLoadStater {
}
: null,
icon: const Icon(Icons.arrow_forward),
tooltip: Translator.t.next(),
),
],
),
Expand Down
1 change: 1 addition & 0 deletions lib/components/trackers/trackers_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ class _TrackersTileItemState extends State<TrackersTileItem>
Navigator.of(context).pop();
},
icon: const Icon(Icons.arrow_back),
tooltip: Translator.t.back(),
),
SizedBox(width: remToPx(1)),
Text(
Expand Down
2 changes: 2 additions & 0 deletions lib/core/models/translations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ abstract class TranslationSentences {
String defaultTheme();
String darkMode();
String close();
String back();
String of();
String chooseTheme();
String language();
String chooseLanguage();
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/anime_page/watch_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ class WatchPageState extends State<WatchPage>
icon: const Icon(
Icons.arrow_back,
),
tooltip: Translator.t.back(),
onPressed: pop,
padding: EdgeInsets.only(
right: remToPx(1),
Expand Down Expand Up @@ -603,7 +604,7 @@ class WatchPageState extends State<WatchPage>
),
),
Text(
'${Translator.t.episode()} ${widget.episode.episode} of ${widget.totalEpisodes}',
'${Translator.t.episode()} ${widget.episode.episode} ${Translator.t.of()} ${widget.totalEpisodes}',
style: const TextStyle(
color: Colors.white,
),
Expand Down
4 changes: 3 additions & 1 deletion lib/pages/home_page/anime_section.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import 'package:flutter/material.dart';

import './home_page.dart';
import '../../core/provisions/model.dart' as provisions;
import '../../core/provisions/myanimelist/home.dart' as myanimelist;
import '../../core/provisions/myanimelist/utils.dart' as myanimelist;
import '../../core/trackers/myanimelist/myanimelist.dart' as myanimelist;
import '../../plugins/database/database.dart';
import '../../plugins/helpers/stateful_holder.dart';
import '../../plugins/helpers/ui.dart';
import '../../plugins/translator/translator.dart';
Expand Down Expand Up @@ -84,7 +86,7 @@ class _PageState extends State<Page> with DidLoadStater {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
_cache.hasResolved
_cache.hasResolved && DataStore.settings.locale! == 'en'
? _cache.value!.seasonName
: Translator.t.seasonalAnimes(),
style: Theme.of(context).textTheme.headline5?.copyWith(
Expand Down
1 change: 1 addition & 0 deletions lib/pages/manga_page/list_reader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class _ListReaderState extends State<ListReader> with FullscreenMixin {
appBar: AppBar(
leading: IconButton(
icon: const Icon(Icons.arrow_back),
tooltip: Translator.t.back(),
onPressed: widget.onPop,
),
actions: <Widget>[
Expand Down
1 change: 1 addition & 0 deletions lib/pages/manga_page/page_reader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ class _PageReaderState extends State<PageReader>
elevation: 0,
leading: IconButton(
icon: const Icon(Icons.arrow_back),
tooltip: Translator.t.back(),
onPressed: widget.onPop,
),
actions: <Widget>[
Expand Down
6 changes: 6 additions & 0 deletions lib/plugins/translator/translations/en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ class Sentences extends TranslationSentences {
@override
String close() => 'Close';

@override
String back() => 'Back';

@override
String of() => 'of';

@override
String chooseTheme() => 'Choose Theme';

Expand Down

0 comments on commit e0f92af

Please sign in to comment.