Skip to content

Commit

Permalink
feat(locale): add bengali translations for search page
Browse files Browse the repository at this point in the history
  • Loading branch information
Kingkor Roy Tirtho committed Apr 29, 2023
1 parent 09af1aa commit a1cdbad
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 19 deletions.
9 changes: 8 additions & 1 deletion lib/l10n/app_bn.arb
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,12 @@
"genre": "গানের ধরণ",
"personalized": "আপনার জন্য",
"featured": "বৈশিষ্ট্যযুক্ত",
"new_releases": "সাম্প্রতিক মুক্তি প্রাপ্ত"
"new_releases": "সাম্প্রতিক মুক্তি প্রাপ্ত",
"songs": "গান",
"playing_track": "{track} চালানো হচ্ছে",
"queue_clear_alert": "এটি বর্তমান প্লেলিষ্ট সাফ করে দিবে। {track_length}টি গান বাদ দেওয়া হবে\nআপনি কি চালিয়ে যেতে চান?",
"load_more": "আরো লোড করুন",
"playlists": "প্লেলিস্ট",
"artists": "শিল্পী",
"albums": "অ্যালবাম"
}
9 changes: 8 additions & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,12 @@
"genre": "Genre",
"personalized": "Personalized",
"featured": "Featured",
"new_releases": "New Releases"
"new_releases": "New Releases",
"songs": "Songs",
"playing_track": "Playing {track}",
"queue_clear_alert": "This will clear the current queue. {track_length} tracks will be removed\nDo you want to continue?",
"load_more": "Load more",
"playlists": "Playlists",
"artists": "Artists",
"albums": "Albums"
}
41 changes: 24 additions & 17 deletions lib/pages/search/search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'package:spotube/components/shared/track_table/track_tile.dart';
import 'package:spotube/components/shared/waypoint.dart';
import 'package:spotube/components/artist/artist_card.dart';
import 'package:spotube/components/playlist/playlist_card.dart';
import 'package:spotube/extensions/context.dart';
import 'package:spotube/hooks/use_breakpoints.dart';
import 'package:spotube/provider/authentication_provider.dart';
import 'package:spotube/provider/playlist_queue_provider.dart';
Expand Down Expand Up @@ -77,9 +78,9 @@ class SearchPage extends HookConsumerWidget {
),
color: theme.scaffoldBackgroundColor,
child: TextField(
decoration: const InputDecoration(
prefixIcon: Icon(SpotubeIcons.search),
hintText: "Search...",
decoration: InputDecoration(
prefixIcon: const Icon(SpotubeIcons.search),
hintText: "${context.l10n.search}...",
),
onSubmitted: (value) async {
ref.read(searchTermStateProvider.notifier).state =
Expand Down Expand Up @@ -134,15 +135,17 @@ class SearchPage extends HookConsumerWidget {
children: [
if (tracks.isNotEmpty)
Text(
"Songs",
context.l10n.songs,
style: theme.textTheme.titleLarge!,
),
if (searchTrack.isLoadingPage)
const CircularProgressIndicator()
else if (searchTrack.hasPageError)
Text(searchTrack.errors.lastOrNull
?.toString() ??
"")
Text(
searchTrack.errors.lastOrNull
?.toString() ??
"",
)
else
...tracks.asMap().entries.map((track) {
String duration =
Expand All @@ -165,12 +168,16 @@ class SearchPage extends HookConsumerWidget {
20
? await showPromptDialog(
context: context,
title:
"Playing ${currentTrack.name}",
message:
"This will clear the current queue. "
"${playlist?.tracks.length ?? 0} tracks will be removed\n"
"Do you want to continue?",
title: context.l10n
.playing_track(
currentTrack.name!,
),
message: context.l10n
.queue_clear_alert(
playlist?.tracks
.length ??
0,
),
)
: true;

Expand All @@ -191,12 +198,12 @@ class SearchPage extends HookConsumerWidget {
: () => searchTrack.fetchNext(),
child: searchTrack.isRefreshingPage
? const CircularProgressIndicator()
: const Text("Load more"),
: Text(context.l10n.load_more),
),
),
if (playlists.isNotEmpty)
Text(
"Playlists",
context.l10n.playlists,
style: theme.textTheme.titleLarge!,
),
const SizedBox(height: 10),
Expand Down Expand Up @@ -254,7 +261,7 @@ class SearchPage extends HookConsumerWidget {
const SizedBox(height: 20),
if (artists.isNotEmpty)
Text(
"Artists",
context.l10n.artists,
style: theme.textTheme.titleLarge!,
),
const SizedBox(height: 10),
Expand Down Expand Up @@ -311,7 +318,7 @@ class SearchPage extends HookConsumerWidget {
const SizedBox(height: 20),
if (albums.isNotEmpty)
Text(
"Albums",
context.l10n.albums,
style: theme.textTheme.titleMedium!,
),
const SizedBox(height: 10),
Expand Down

0 comments on commit a1cdbad

Please sign in to comment.