-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: setup localization (l10n) and language switcher, add sidebar an…
…d navbar locale
- Loading branch information
Kingkor Roy Tirtho
committed
Apr 28, 2023
1 parent
8432dc6
commit f12d812
Showing
14 changed files
with
161 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
arb-dir: lib/l10n | ||
template-arb-file: app_en.arb | ||
output-localization-file: app_localizations.dart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:spotube/collections/spotube_icons.dart'; | ||
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||
|
||
class SideBarTiles { | ||
final IconData icon; | ||
final String title; | ||
SideBarTiles({required this.icon, required this.title}); | ||
} | ||
|
||
List<SideBarTiles> sidebarTileList = [ | ||
SideBarTiles(icon: SpotubeIcons.home, title: "Browse"), | ||
SideBarTiles(icon: SpotubeIcons.search, title: "Search"), | ||
SideBarTiles(icon: SpotubeIcons.library, title: "Library"), | ||
SideBarTiles(icon: SpotubeIcons.music, title: "Lyrics") | ||
]; | ||
List<SideBarTiles> getSidebarTileList(AppLocalizations l10n) => [ | ||
SideBarTiles(icon: SpotubeIcons.home, title: l10n.browse), | ||
SideBarTiles(icon: SpotubeIcons.search, title: l10n.search), | ||
SideBarTiles(icon: SpotubeIcons.library, title: l10n.library), | ||
SideBarTiles(icon: SpotubeIcons.music, title: l10n.lyrics), | ||
]; | ||
|
||
List<SideBarTiles> navbarTileList = [ | ||
SideBarTiles(icon: SpotubeIcons.home, title: "Browse"), | ||
SideBarTiles(icon: SpotubeIcons.search, title: "Search"), | ||
SideBarTiles(icon: SpotubeIcons.library, title: "Library"), | ||
SideBarTiles(icon: SpotubeIcons.settings, title: "Settings") | ||
]; | ||
List<SideBarTiles> getNavbarTileList(AppLocalizations l10n) => [ | ||
SideBarTiles(icon: SpotubeIcons.home, title: l10n.browse), | ||
SideBarTiles(icon: SpotubeIcons.search, title: l10n.search), | ||
SideBarTiles(icon: SpotubeIcons.library, title: l10n.library), | ||
SideBarTiles(icon: SpotubeIcons.settings, title: l10n.settings) | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||
|
||
extension AppLocale on BuildContext { | ||
AppLocalizations get l10n => AppLocalizations.of(this)!; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"guest": "অতিথি", | ||
"browse": "ব্রাউজ করুন", | ||
"search": "অনুসন্ধান করুন", | ||
"library": "লাইব্রেরী", | ||
"lyrics": "গানের কথা", | ||
"settings": "সেটিংস" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"guest": "Guest", | ||
"browse": "Browse", | ||
"search": "Search", | ||
"library": "Library", | ||
"lyrics": "Lyrics", | ||
"settings": "Settings" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class L10n { | ||
static final all = [ | ||
const Locale('en'), | ||
const Locale('bn', 'BD'), | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.