Skip to content

Commit

Permalink
feat: localize settings, about, login, player queue with Bengali and …
Browse files Browse the repository at this point in the history
…English translations
  • Loading branch information
Kingkor Roy Tirtho committed Apr 29, 2023
1 parent c55133d commit a5c36bb
Show file tree
Hide file tree
Showing 10 changed files with 307 additions and 145 deletions.
19 changes: 10 additions & 9 deletions lib/components/desktop_login/login_form.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:spotube/extensions/context.dart';

import 'package:spotube/provider/authentication_provider.dart';

Expand All @@ -27,18 +28,18 @@ class TokenLoginForm extends HookConsumerWidget {
children: [
TextField(
controller: directCodeController,
decoration: const InputDecoration(
hintText: "Spotify \"sp_dc\" Cookie",
labelText: "sp_dc Cookie",
decoration: InputDecoration(
hintText: context.l10n.spotify_cookie("\"sp_dc\""),
labelText: context.l10n.cookie_name_cookie("sp_dc"),
),
keyboardType: TextInputType.visiblePassword,
),
const SizedBox(height: 10),
TextField(
controller: keyCodeController,
decoration: const InputDecoration(
hintText: "Spotify \"sp_key\" Cookie",
labelText: "sp_key Cookie",
decoration: InputDecoration(
hintText: context.l10n.spotify_cookie("\"sp_key\""),
labelText: context.l10n.cookie_name_cookie("sp_key"),
),
keyboardType: TextInputType.visiblePassword,
),
Expand All @@ -48,8 +49,8 @@ class TokenLoginForm extends HookConsumerWidget {
if (keyCodeController.text.isEmpty ||
directCodeController.text.isEmpty) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text("Please fill in all fields"),
SnackBar(
content: Text(context.l10n.fill_in_all_fields),
behavior: SnackBarBehavior.floating,
),
);
Expand All @@ -65,7 +66,7 @@ class TokenLoginForm extends HookConsumerWidget {
onDone?.call();
}
},
child: const Text("Submit"),
child: Text(context.l10n.submit),
)
],
),
Expand Down
11 changes: 6 additions & 5 deletions lib/components/player/player_queue.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:scroll_to_index/scroll_to_index.dart';
import 'package:spotube/collections/spotube_icons.dart';
import 'package:spotube/components/shared/fallbacks/not_found.dart';
import 'package:spotube/components/shared/track_table/track_tile.dart';
import 'package:spotube/extensions/context.dart';
import 'package:spotube/hooks/use_auto_scroll_controller.dart';
import 'package:spotube/provider/playlist_queue_provider.dart';
import 'package:spotube/utils/primitive_utils.dart';
Expand Down Expand Up @@ -79,7 +80,7 @@ class PlayerQueue extends HookConsumerWidget {
children: [
const SizedBox(width: 10),
Text(
"${tracks.length} tracks in Queue",
context.l10n.tracks_in_queue(tracks.length),
style: TextStyle(
color: headlineColor,
fontWeight: FontWeight.bold,
Expand All @@ -94,10 +95,10 @@ class PlayerQueue extends HookConsumerWidget {
foregroundColor: theme.textTheme.headlineSmall?.color,
),
child: Row(
children: const [
Icon(SpotubeIcons.playlistRemove),
SizedBox(width: 5),
Text("Clear All"),
children: [
const Icon(SpotubeIcons.playlistRemove),
const SizedBox(width: 5),
Text(context.l10n.clear_all),
],
),
onPressed: () {
Expand Down
3 changes: 2 additions & 1 deletion lib/components/player/sibling_tracks_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

import 'package:spotube/components/shared/image/universal_image.dart';
import 'package:spotube/extensions/context.dart';
import 'package:spotube/models/spotube_track.dart';
import 'package:spotube/provider/playlist_queue_provider.dart';
import 'package:spotube/utils/primitive_utils.dart';
Expand Down Expand Up @@ -58,7 +59,7 @@ class SiblingTracksSheet extends HookConsumerWidget {
appBar: AppBar(
centerTitle: true,
title: Text(
'Alternative Tracks Sources',
context.l10n.alternative_track_sources,
style: theme.textTheme.headlineSmall,
),
automaticallyImplyLeading: false,
Expand Down
87 changes: 85 additions & 2 deletions lib/l10n/app_bn.arb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"artist_url_copied": "শিল্পীর URL কপি করা হয়েছে",
"added_to_queue": "{tracks}টি গানের ট্র্যাক কিউতে যোগ করা হয়েছে",
"filter_albums": "অ্যালবাম অনুসন্ধান করুন...",
"synced": "সময়ের সাথে সুসংগত",
"synced": "সময় সুসংগত",
"plain": "অসুসংগত",
"shuffle": "অদলবদল",
"search_tracks": "গান অনুসন্ধান করুন...",
Expand Down Expand Up @@ -98,5 +98,88 @@
"repeat_playlist": "প্লেলিস্ট শেষে পুনরায় চালান",
"queue": "গানের কিউ",
"alternative_track_sources": "বিকল্প গানের উৎস",
"download_track": "গান ডাউনলোড করুন"
"download_track": "গান ডাউনলোড করুন",
"tracks_in_queue": "{tracks}টি গান কিউতে রয়েছে",
"clear_all": "সব মুছে ফেলুন",
"show_hide_ui_on_hover": "হভার করলে UI দেখান/লুকান",
"always_on_top": "সর্বদা উপরে",
"exit_mini_player": "মিনি প্লেয়ার থেকে বের হয়ে যান",
"download_location": "ডাউনলোড স্থান",
"account": "অ্যাকাউন্ট",
"login_with_spotify": "আপনার Spotify account দিয়ে লগইন করুন",
"connect_with_spotify": "Spotify লগইন",
"logout": "লগআউট করুন",
"logout_of_this_account": "অ্যাকাউন্ট থেকে লগআউট করুন",
"language_region": "ভাষা ও অঞ্চল",
"language": "ভাষা",
"system_default": "সিস্টেম ডিফল্ট",
"market_place_region": "মার্কেটপ্লেস অঞ্চল",
"recommendation_country": "দেশভিত্তিক সঙ্গীত পরামর্শের জন্য দেশ",
"appearance": "রুপ",
"layout_mode": "UI বিন্যাস রূপ",
"override_layout_settings": "প্রতিক্রিয়াশীল UI বিন্যাস রূপের সেটিংস পরিবর্তন করুন",
"adaptive": "অভিযোজিত",
"compact": "আঁটসাঁট UI",
"extended": "বিস্তৃত UI",
"theme": "থিম",
"dark": "অন্ধকার",
"light": "উজ্জল",
"system": "সিস্টেম থিম",
"accent_color": "প্রভাবশালী রং",
"sync_album_color": "অ্যালবাম সুসংগত UI এর রং",
"sync_album_color_description": "অ্যালবাম কভারের প্রভাবশালী রঙ UI অ্যাকসেন্ট রঙ হিসাবে ব্যবহার করে",
"playback": "সংগীতের প্লেব্যাক",
"audio_quality": "শব্দের গুণমান",
"high": "উচ্চ",
"low": "নিম্ন",
"pre_download_play": "আগে গান ডাউনলোড করে পরে চালান ",
"pre_download_play_description": "গান স্ট্রিম করার পরিবর্তে, ডাউনলোড করুন এবং প্লে করুন (উচ্চ ব্যান্ডউইথ ব্যবহারকারীদের জন্য প্রস্তাবিত)",
"skip_non_music": "গানের নন-মিউজিক সেগমেন্ট এড়িয়ে যান (SponsorBlock)",
"blacklist_description": "কালো তালিকাভুক্ত গানের ট্র্যাক এবং শিল্পী",
"wait_for_download_to_finish": "ডাউনলোড শেষ হওয়ার জন্য অপেক্ষা করুন",
"download_lyrics": "গানের সাথে লিরিক্স ডাউনলোড করুন",
"desktop": "ডেস্কটপ",
"close_behavior": "বন্ধ করার প্রক্রিয়া",
"close": "বন্ধ করুন",
"minimize_to_tray": "সিস্টেম ট্রেতে রাখুন",
"show_tray_icon": "সিস্টেম ট্রে আইকন দেখান",
"about": "বিস্তারিত",
"u_love_spotube": "আমরা জানি আপনি Spotube কে ভালবাসেন",
"check_for_updates": "আপডেট চেক করুন",
"about_spotube": "Spotube সম্পর্কে বিস্তারিত",
"blacklist": "কালো তালিকা",
"please_sponsor": "স্পনসর/সহায়তা করুন",
"spotube_description": "Spotube, একটি কর্মদক্ষ, ক্রস-প্ল্যাটফর্ম, বিনামূল্যের জন্য Spotify ক্লায়েন্ট",
"version": "সংস্করণ",
"build_number": "বিল্ড নম্বর",
"founder": "প্রতিষ্ঠাতা",
"repository": "সংগ্রহস্থল",
"bug_issues": "বাগ/সমস্যা",
"made_with": "❤️ দিয়ে বাংলাদেশে🇧🇩 তৈরি",
"kingkor_roy_tirtho": "কিংকর রায় তীর্থ",
"copyright": "© 2021-{current_year} কিংকর রায় তীর্থ",
"license": "লাইসেন্স",
"add_spotify_credentials": "আপনার Spotify লগইন তথ্য যোগ করুন",
"credentials_will_not_be_shared_disclaimer": "চিন্তা করবেন না, আপনার কোনো লগইন তথ্য সংগ্রহ করা হবে না বা কারো সাথে শেয়ার করা হবে না",
"know_how_to_login": "আপনি কিভাবে লগইন করবেন তা জানেন না?",
"follow_step_by_step_guide": "ধাপে ধাপে নির্দেশিকা অনুসরণ করুন",
"spotify_cookie": "Spotify {name} কুকি",
"cookie_name_cookie": "{name} কুকি",
"fill_in_all_fields": "সমস্ত ফর্ম ক্ষেত্র পূরণ করুন",
"submit": "জমা দিন",
"exit": "প্রস্থান",
"previous": "পূর্ববর্তী",
"next": "পরবর্তী",
"done": "সম্পন্ন",
"step_1": "ধাপ 1",
"first_go_to": "প্রথমে যান",
"login_if_not_logged_in": "এবং যদি আপনি লগইন/সাইন-আপ না থাকেন তবে লগইন/সাইন-আপ করুন",
"step_2": "ধাপ 2",
"step_2_steps": "১. একবার আপনি লগ ইন করলে, ব্রাউজার ডেভটুল খুলতে F12 বা মাউসের রাইট ক্লিক > \"Inspect to open Browser DevTools\" টিপুন।\n২. তারপর \"Application\" ট্যাবে যান (Chrome, Edge, Brave etc..) অথবা \"Storage\" Tab (Firefox, Palemoon etc..)\n৩. \"Cookies \" বিভাগে যান তারপর \"https://accounts.spotify.com\" উপবিভাগে যান",
"step_3": "ধাপ 3",
"step_3_steps": "\"sp_dc\" এবং \"sp_key\" কুকিজের মান কপি করুন",
"success_emoji": "আমরা সফল🥳",
"success_message": "এখন আপনি সফলভাবে আপনার Spotify অ্যাকাউন্ট দিয়ে লগ ইন করেছেন। সাধুভাত আপনাকে",
"step_4": "ধাপ 4",
"step_4_steps": "কপি করা \"sp_dc\" এবং \"sp_key\" এর মান সংশ্লিষ্ট ফিল্ডে পেস্ট করুন"
}
85 changes: 84 additions & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,88 @@
"repeat_playlist": "Repeat playlist",
"queue": "Queue",
"alternative_track_sources": "Alternative track sources",
"download_track": "Download track"
"download_track": "Download track",
"tracks_in_queue": "{tracks} tracks in queue",
"clear_all": "Clear all",
"show_hide_ui_on_hover": "Show/Hide UI on hover",
"always_on_top": "Always on top",
"exit_mini_player": "Exit Mini player",
"download_location": "Download location",
"account": "Account",
"login_with_spotify": "Login with your Spotify account",
"connect_with_spotify": "Connect with Spotify",
"logout": "Logout",
"logout_of_this_account": "Logout of this account",
"language_region": "Language & Region",
"language": "Language",
"system_default": "System Default",
"market_place_region": "Marketplace Region",
"recommendation_country": "Recommendation Country",
"appearance": "Appearance",
"layout_mode": "Layout Mode",
"override_layout_settings": "Override responsive layout mode settings",
"adaptive": "Adaptive",
"compact": "Compact",
"extended": "Extended",
"theme": "Theme",
"dark": "Dark",
"light": "Light",
"system": "System",
"accent_color": "Accent Color",
"sync_album_color": "Sync album color",
"sync_album_color_description": "Uses the dominant color of the album art as the accent color",
"playback": "Playback",
"audio_quality": "Audio Quality",
"high": "High",
"low": "Low",
"pre_download_play": "Pre-download and play",
"pre_download_play_description": "Instead of streaming audio, download bytes and play instead (Recommended for higher bandwidth users)",
"skip_non_music": "Skip non-music segments (SponsorBlock)",
"blacklist_description": "Blacklisted tracks and artists",
"wait_for_download_to_finish": "Please wait for the current download to finish",
"download_lyrics": "Download lyrics along with tracks",
"desktop": "Desktop",
"close_behavior": "Close Behavior",
"close": "Close",
"minimize_to_tray": "Minimize to tray",
"show_tray_icon": "Show System tray icon",
"about": "About",
"u_love_spotube": "We know you love Spotube",
"check_for_updates": "Check for updates",
"about_spotube": "About Spotube",
"blacklist": "Blacklist",
"please_sponsor": "Please Sponsor/Donate",
"spotube_description": "Spotube, a light-weight, cross-platform, free-for-all spotify client",
"version": "Version",
"build_number": "Build Number",
"founder": "Founder",
"repository": "Repository",
"bug_issues": "Bug+Issues",
"made_with": "Made with ❤️ in Bangladesh🇧🇩",
"kingkor_roy_tirtho": "Kingkor Roy Tirtho",
"copyright": "© 2021-{current_year} Kingkor Roy Tirtho",
"license": "License",
"add_spotify_credentials": "Add your spotify credentials to get started",
"credentials_will_not_be_shared_disclaimer": "Don't worry, any of your credentials won't be collected or shared with anyone",
"know_how_to_login": "Don't know how to do this?",
"follow_step_by_step_guide": "Follow along the Step by Step guide",
"spotify_cookie": "Spotify {name} Cookie",
"cookie_name_cookie": "{name} Cookie",
"fill_in_all_fields": "Please fill in all the fields",
"submit": "Submit",
"exit": "Exit",
"previous": "Previous",
"next": "Next",
"done": "Done",
"step_1": "Step 1",
"first_go_to": "First, Go to",
"login_if_not_logged_in": "and Login/Signup if you are not logged in",
"step_2": "Step 2",
"step_2_steps": "1. Once you're logged in, press F12 or Mouse Right Click > Inspect to Open the Browser devtools.\n2. Then go the \"Application\" Tab (Chrome, Edge, Brave etc..) or \"Storage\" Tab (Firefox, Palemoon etc..)\n3. Go to the \"Cookies\" section then the \"https://accounts.spotify.com\" subsection",
"step_3": "Step 3",
"step_3_steps": "Copy the values of \"sp_dc\" and \"sp_key\" Cookies",
"success_emoji": "Success🥳",
"success_message": "Now you're successfully Logged In with your Spotify account. Good Job, mate!",
"step_4": "Step 4",
"step_4_steps": "Paste the copied \"sp_dc\" and \"sp_key\" values in the respective fields"
}
11 changes: 6 additions & 5 deletions lib/pages/desktop_login/desktop_login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:spotube/collections/assets.gen.dart';
import 'package:spotube/components/desktop_login/login_form.dart';
import 'package:spotube/components/shared/page_window_title_bar.dart';
import 'package:spotube/extensions/context.dart';
import 'package:spotube/hooks/use_breakpoints.dart';

class DesktopLoginPage extends HookConsumerWidget {
Expand Down Expand Up @@ -37,11 +38,11 @@ class DesktopLoginPage extends HookConsumerWidget {
(breakpoint <= Breakpoints.md ? .5 : .3),
),
Text(
"Add your spotify credentials to get started",
context.l10n.add_spotify_credentials,
style: theme.textTheme.titleMedium,
),
Text(
"Don't worry, any of your credentials won't be collected or shared with anyone",
context.l10n.credentials_will_not_be_shared_disclaimer,
style: theme.textTheme.labelMedium,
),
const SizedBox(height: 10),
Expand All @@ -53,10 +54,10 @@ class DesktopLoginPage extends HookConsumerWidget {
alignment: WrapAlignment.center,
crossAxisAlignment: WrapCrossAlignment.center,
children: [
const Text("Don't know how to do this?"),
Text(context.l10n.know_how_to_login),
TextButton(
child: const Text(
"Follow along the Step by Step guide",
child: Text(
context.l10n.follow_step_by_step_guide,
),
onPressed: () => GoRouter.of(context).push(
"/login-tutorial",
Expand Down
Loading

0 comments on commit a5c36bb

Please sign in to comment.