Skip to content

Commit

Permalink
chore: add home, genre and personalization translations
Browse files Browse the repository at this point in the history
  • Loading branch information
Kingkor Roy Tirtho committed Apr 28, 2023
1 parent f12d812 commit 09af1aa
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
7 changes: 6 additions & 1 deletion lib/l10n/app_bn.arb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@
"search": "অনুসন্ধান করুন",
"library": "লাইব্রেরী",
"lyrics": "গানের কথা",
"settings": "সেটিংস"
"settings": "সেটিংস",
"genre_categories_filter": "গানের ধরণ বা শ্রেণি খুঁজুন",
"genre": "গানের ধরণ",
"personalized": "আপনার জন্য",
"featured": "বৈশিষ্ট্যযুক্ত",
"new_releases": "সাম্প্রতিক মুক্তি প্রাপ্ত"
}
7 changes: 6 additions & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@
"search": "Search",
"library": "Library",
"lyrics": "Lyrics",
"settings": "Settings"
"settings": "Settings",
"genre_categories_filter": "Filter categories or genres...",
"genre": "Genre",
"personalized": "Personalized",
"featured": "Featured",
"new_releases": "New Releases"
}
3 changes: 2 additions & 1 deletion lib/pages/home/genres.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:spotube/components/genre/category_card.dart';
import 'package:spotube/components/shared/compact_search.dart';
import 'package:spotube/components/shared/shimmers/shimmer_categories.dart';
import 'package:spotube/components/shared/waypoint.dart';
import 'package:spotube/extensions/context.dart';

import 'package:spotube/provider/user_preferences_provider.dart';
import 'package:spotube/services/queries/queries.dart';
Expand Down Expand Up @@ -54,7 +55,7 @@ class GenrePage extends HookConsumerWidget {
onChanged: (value) {
searchText.value = value;
},
placeholder: "Filter categories or genres...",
placeholder: context.l10n.genre_categories_filter,
);

final list = RefreshIndicator(
Expand Down
7 changes: 4 additions & 3 deletions lib/pages/home/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:spotube/components/shared/page_window_title_bar.dart';
import 'package:spotube/components/shared/themed_button_tab_bar.dart';
import 'package:spotube/extensions/context.dart';
import 'package:spotube/pages/home/genres.dart';
import 'package:spotube/pages/home/personalized.dart';

Expand All @@ -10,17 +11,17 @@ class HomePage extends HookConsumerWidget {

@override
Widget build(BuildContext context, ref) {
return const DefaultTabController(
return DefaultTabController(
length: 2,
child: Scaffold(
appBar: PageWindowTitleBar(
centerTitle: true,
leadingWidth: double.infinity,
leading: ThemedButtonsTabBar(
tabs: ["Genres", "Personalized"],
tabs: [context.l10n.genre, context.l10n.personalized],
),
),
body: TabBarView(
body: const TabBarView(
children: [
GenrePage(),
PersonalizedPage(),
Expand Down
5 changes: 3 additions & 2 deletions lib/pages/home/personalized.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:spotube/components/album/album_card.dart';
import 'package:spotube/components/playlist/playlist_card.dart';
import 'package:spotube/components/shared/shimmers/shimmer_playbutton_card.dart';
import 'package:spotube/components/shared/waypoint.dart';
import 'package:spotube/extensions/context.dart';
import 'package:spotube/models/logger.dart';
import 'package:spotube/services/queries/queries.dart';
import 'package:spotube/utils/type_conversion_utils.dart';
Expand Down Expand Up @@ -115,13 +116,13 @@ class PersonalizedPage extends HookConsumerWidget {
PersonalizedItemCard(
playlists:
featuredPlaylistsQuery.pages.whereType<Page<PlaylistSimple>>(),
title: 'Featured',
title: context.l10n.featured,
hasNextPage: featuredPlaylistsQuery.hasNextPage,
onFetchMore: featuredPlaylistsQuery.fetchNext,
),
PersonalizedItemCard(
albums: newReleases.pages.whereType<Page<AlbumSimple>>(),
title: 'New Releases',
title: context.l10n.new_releases,
hasNextPage: newReleases.hasNextPage,
onFetchMore: newReleases.fetchNext,
),
Expand Down

0 comments on commit 09af1aa

Please sign in to comment.