Skip to content

Commit

Permalink
feat(settings): replace all strings with localizable strings
Browse files Browse the repository at this point in the history
  • Loading branch information
JagandeepBrar committed Mar 30, 2023
1 parent 0f4ac9a commit 5ce1279
Show file tree
Hide file tree
Showing 42 changed files with 384 additions and 566 deletions.
56 changes: 56 additions & 0 deletions assets/localization/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
"lunasea.DownloadClient": "Download Client",
"lunasea.Edge": "Edge",
"lunasea.Error": "Error",
"lunasea.EverySecond": "Every Second",
"lunasea.EverySeconds": "Every {} Seconds",
"lunasea.ExternalModules": "External Modules",
"lunasea.Features": "Features",
"lunasea.Fixes": "Fixes",
Expand All @@ -70,6 +72,7 @@
"lunasea.IncorrectEncryptionKey": "Incorrect encryption key",
"lunasea.Internal": "Internal",
"lunasea.InvalidFileTypeSelected": "Invalid File Type Selected",
"lunasea.Items": "{} Items",
"lunasea.JustNow": "Just Now",
"lunasea.Minutes": "{} Minutes",
"lunasea.MinutesAgo": "{} Minutes Ago",
Expand All @@ -85,6 +88,7 @@
"lunasea.OneDayAgo": "1 Day Ago",
"lunasea.OneHour": "1 Hour",
"lunasea.OneHourAgo": "1 Hour Ago",
"lunasea.OneItem": "1 Item",
"lunasea.OneMinute": "1 Minute",
"lunasea.OneMinuteAgo": "1 Minute Ago",
"lunasea.OneMonth": "1 Month",
Expand Down Expand Up @@ -113,6 +117,8 @@
"lunasea.Settings": "Settings",
"lunasea.Stable": "Stable",
"lunasea.StartingView": "Starting View",
"lunasea.ThankYou": "Thank You",
"lunasea.ThankYouMessage": "Thank you for supporting the open-source community!",
"lunasea.Today": "Today",
"lunasea.TransactionFailure": "Transaction Failure",
"lunasea.TryAgain": "Try Again",
Expand Down Expand Up @@ -181,6 +187,8 @@
"radarr.DigitalRelease": "Digital Release",
"radarr.DirectoryNotFound": "Directory Not Found",
"radarr.Discover": "Discover",
"radarr.DiscoverSuggestions": "Discover Suggestions",
"radarr.DiscoverSuggestionsDescription": "Add Suggested Releases in Discover",
"radarr.Disks": "Disks",
"radarr.DownloadFailed": "Download Failed",
"radarr.DownloadIgnored": "Download Ignored",
Expand Down Expand Up @@ -215,6 +223,7 @@
"radarr.MoveFilesDescription": "Would you like to move the files?",
"radarr.MoveFull": "Move Files",
"radarr.Movie": "Movie",
"radarr.MovieDetails": "Movie Details",
"radarr.Movies": "Movies",
"radarr.MovieFileDeleted": "Movie File Deleted",
"radarr.MovieFileRenamed": "Movie File Renamed",
Expand All @@ -237,6 +246,7 @@
"radarr.QualityProfile": "Quality Profile",
"radarr.Queue": "Queue",
"radarr.QueueDescription": "View Active & Queued Content",
"radarr.QueueSize": "Queue Size",
"radarr.Quick": "Quick",
"radarr.RefreshMovie": "Refresh Movie",
"radarr.Rejected": "Rejected",
Expand Down Expand Up @@ -306,25 +316,39 @@
"sabnzbd.ShutdownSABnzbd": "Shutdown SABnzbd",
"sabnzbd.StandbyPC": "Standby PC",
"sabnzbd.Stop": "Stop",
"search.AddIndexer": "Add Indexer",
"search.Age": "Age",
"search.AllSubcategories": "All Subcategories",
"search.Alphabetical": "Alphabetical",
"search.Category": "Category",
"search.Categories": "Categories",
"search.Comments": "Comments",
"search.DeleteIndexer": "Delete Indexer",
"search.Download": "Download",
"search.Downloading": "Downloading…",
"search.DownloadingNZBToDevice": "Downloading NZB to your device",
"search.DownloadToDevice": "Download to Device",
"search.EditIndexer": "Edit Indexer",
"search.FailedToAddIndexer": "Failed to Add indexer",
"search.FailedToDownloadNZB": "Failed to Download NZB",
"search.FailedToSend": "Failed to Send",
"search.HideAdultCategories": "Hide Adult Categories",
"search.HideAdultCategoriesDescription": "Hide Adult Content",
"search.IndexerAPIHost": "Indexer API Host",
"search.IndexerAPIKey": "Indexer API Key",
"search.IndexerAdded": "Indexer Added",
"search.IndexerDeleted": "Indexer Deleted",
"search.IndexerNotFound": "Indexer Not Found",
"search.NoCategoriesFound": "No Categories Found",
"search.NoIndexersFound": "No Indexers Found",
"search.NoResultsFound": "No Results Found",
"search.NoSubcategoriesFound": "No Subcategories Found",
"search.Results": "Results",
"search.Search": "Search",
"search.SentNZBData": "Sent NZB Data",
"search.SentTo": "Sent to {}",
"search.ShowLinks": "Show Links",
"search.ShowLinksDescription": "Show Download and Comments Links",
"search.Size": "Size",
"search.Subcategories": "Subcategories",
"settings.Account": "Account",
Expand All @@ -343,6 +367,8 @@
"settings.AddProfileDescription": "Add a New Profile",
"settings.AddedProfile": "Added Profile",
"settings.AllFieldsAreRequired": "All fields are required",
"settings.AllLogs": "All Logs",
"settings.AllLogsDescription": "View Logs of All Types",
"settings.AmoledTheme": "AMOLED Theme",
"settings.AmoledThemeBorders": "AMOLED Theme Borders",
"settings.AmoledThemeBordersDescription": "Add Subtle Borders Across the UI",
Expand Down Expand Up @@ -381,9 +407,12 @@
"settings.BuildChannels": "Build Channels",
"settings.BuildChannelsDescription": "Learn About Additional Build Channels",
"settings.CalendarSettings": "Calendar Settings",
"settings.CalendarSettingsDescription": "Customize the Unified Calendar",
"settings.ChangedProfile": "Changed Profile",
"settings.Channel": "Channel",
"settings.Class": "Class",
"settings.CleanSlate": "Clean Slate",
"settings.Clear": "Clear",
"settings.ClearConfiguration": "Clear Configuration",
"settings.ClearConfigurationHint1": "Are you sure you want to clear your configuration?",
"settings.ClearConfigurationHint2": "You will be starting from a clean slate, please ensure you backup your current configuration first!",
Expand All @@ -404,6 +433,9 @@
"settings.ConnectionDetails": "Connection Details",
"settings.ConnectionDetailsDescription": "Connection Details for {}",
"settings.ConnectionTestFailed": "Connection Test Failed",
"settings.CopiedURLFor": "Copied URL for {}",
"settings.CopiedDeviceURL": "Copied your device-based URL to the clipboard",
"settings.CopiedUserURL": "Copied your user-based URL to the clipboard",
"settings.CurrentPassword": "Current Password",
"settings.Custom": "Custom…",
"settings.CustomHeader": "Custom Header",
Expand Down Expand Up @@ -444,6 +476,7 @@
"settings.DeleteModuleSuccess": "Module Deleted",
"settings.DeleteProfile": "Delete Profile",
"settings.DeleteProfileDescription": "Delete an Existing Profile",
"settings.Device": "Device",
"settings.DiscordDescription": "Request Features & Get Support",
"settings.DismissBanners": "Dismiss Banners",
"settings.DismissBannersHint1": "Are you sure you want to dismiss all tooltip banners?",
Expand All @@ -467,6 +500,10 @@
"settings.EnableModule": "Enable {}",
"settings.EnabledProfile": "Enabled Profile",
"settings.EncryptionKey": "Encryption Key",
"settings.Exception": "Exception",
"settings.Export": "Export",
"settings.ExportedLogs": "Exported Logs",
"settings.ExportedLogsMessage": "Logs have been successfully exported",
"settings.FailedToClearImageCache": "Failed to Clear Image Cache",
"settings.FailedToClearImageCacheDescription": "The image cache could not be cleared",
"settings.FailedToDeleteAccount": "Failed to Delete Account",
Expand All @@ -477,6 +514,8 @@
"settings.FutureDays": "Future Days",
"settings.General": "General",
"settings.GeneralDescription": "Customize LunaSea",
"settings.GettingStarted": "Getting Started",
"settings.GettingStartedDescription": "Information & Setup Instructions",
"settings.GitHubDescription": "View the Source Code",
"settings.HeaderAdded": "Header Added",
"settings.HeaderDeleted": "Header Deleted",
Expand Down Expand Up @@ -507,7 +546,10 @@
"settings.Localization": "Localization",
"settings.LocalizationDescription": "Customize to your Locale",
"settings.Logs": "Logs",
"settings.LogsCleared": "Logs Cleared",
"settings.LogsClearedDescription": "All recorded logs have been cleared",
"settings.LogsDescription": "View, Export, and Clear Logs",
"settings.Method": "Method",
"settings.MACAddress": "MAC Address",
"settings.MACAddressHint1": "This is the MAC address of the machine that you want to wake up",
"settings.MACAddressHint2": "MAC addresses contain six two-digit hexadecimal nibbles (an octet)",
Expand All @@ -520,12 +562,16 @@
"settings.Network": "Network",
"settings.NetworkDescription": "Customize Network Features",
"settings.NewPassword": "New Password",
"settings.NotAuthorized": "Not Authorized",
"settings.NotAuthorizedMessage": "LunaSea is not authorized to show notifications. Please go to your device's settings to enable notifications.",
"settings.NotAvailable": "Not Available",
"settings.Notifications": "Notifications",
"settings.NotificationsDescription": "Set up Webhooks for Push Notifications",
"settings.NoAdditionalProfilesAdded": "No additional profiles have been added",
"settings.NoBackupsFound": "No Backups Found",
"settings.NoExternalModulesFound": "No External Modules Found",
"settings.NoHeadersAdded": "No Headers Added",
"settings.NoLogsFound": "No Logs Found",
"settings.NoProfilesFound": "No Profiles Found",
"settings.OpenDrawerOnBackAction": "Open Drawer on Back Action",
"settings.OpenDrawerOnBackActionDescription": "Open the drawer instead of closing LunaSea",
Expand Down Expand Up @@ -596,6 +642,7 @@
"settings.UpToDate": "Up To Date",
"settings.Use24HourTime": "Use 24 Hour Time",
"settings.Use24HourTimeDescription": "Show Timestamps in 24 Hour Style",
"settings.User": "User",
"settings.Username": "Username",
"settings.UsernameValidation": "Username Required",
"settings.Version": "Version",
Expand Down Expand Up @@ -738,6 +785,7 @@
"sonarr.Queue": "Queue",
"sonarr.Queued": "Queued",
"sonarr.QueueDescription": "View Active & Queued Content",
"sonarr.QueueSize": "Queue Size",
"sonarr.Reason": "Reason",
"sonarr.RefreshSeries": "Refresh Series",
"sonarr.Rejected": "Rejected",
Expand Down Expand Up @@ -817,6 +865,7 @@
"sonarr.WordScore": "Word Score",
"tautulli.Activity": "Activity",
"tautulli.ActivityDetails": "Activity Details",
"tautulli.ActivityRefreshRate": "Activity Refresh Rate",
"tautulli.Audio": "Audio",
"tautulli.BackingUpConfiguration": "Backing Up Configuration…",
"tautulli.BackingUpConfigurationDescription": "Backing up your configuration in the background",
Expand All @@ -831,6 +880,7 @@
"tautulli.Converting": "Converting",
"tautulli.Container": "Container",
"tautulli.Copy": "Copy",
"tautulli.DefaultTerminationMessage": "Default Termination Message",
"tautulli.DeleteCache": "Delete Cache",
"tautulli.DeleteImageCache": "Delete Image Cache",
"tautulli.DeleteTemporarySessions": "Delete Temporary Sessions",
Expand All @@ -850,9 +900,12 @@
"tautulli.Duration": "Duration",
"tautulli.Episode": "Episode {}",
"tautulli.ETA": "ETA",
"tautulli.Graphs": "Graphs",
"tautulli.History": "History",
"tautulli.Library": "Library",
"tautulli.LibraryDetails": "Library Details",
"tautulli.Location": "Location",
"tautulli.MediaDetails": "Media Details",
"tautulli.Metadata": "Metadata",
"tautulli.More": "More",
"tautulli.None": "None",
Expand All @@ -867,6 +920,8 @@
"tautulli.SessionsOne": "1 Session",
"tautulli.SessionsMany": "{} Sessions",
"tautulli.Speed": "Speed: {}x",
"tautulli.Statistics": "Statistics",
"tautulli.StatisticsItemCount": "Statistics Item Count",
"tautulli.Stream": "Stream",
"tautulli.Subtitle": "Subtitle",
"tautulli.Terminate": "Terminate",
Expand All @@ -882,6 +937,7 @@
"tautulli.Transcodes": "Transcodes",
"tautulli.User": "User",
"tautulli.Users": "Users",
"tautulli.UserDetails": "User Details",
"tautulli.Video": "Video",
"tautulli.ViewWebGUI": "View Web GUI",
"tautulli.Year": "Year",
Expand Down
17 changes: 17 additions & 0 deletions lib/modules.dart
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,23 @@ extension LunaModuleWebhookExtension on LunaModule {
}
}

String? get webhookDocs {
switch (this) {
case LunaModule.LIDARR:
return 'https://docs.lunasea.app/lunasea/notifications/lidarr';
case LunaModule.RADARR:
return 'https://docs.lunasea.app/lunasea/notifications/radarr';
case LunaModule.SONARR:
return 'https://docs.lunasea.app/lunasea/notifications/sonarr';
case LunaModule.OVERSEERR:
return 'https://docs.lunasea.app/lunasea/notifications/overseerr';
case LunaModule.TAUTULLI:
return 'https://docs.lunasea.app/lunasea/notifications/tautulli';
default:
return null;
}
}

Future<void> handleWebhook(Map<String, dynamic> data) async {
switch (this) {
case LunaModule.LIDARR:
Expand Down
10 changes: 5 additions & 5 deletions lib/modules/settings/core/pages/headers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ class _State extends State<SettingsHeaderRoute> with LunaScrollControllerMixin {
Future<void> _resetState() async {
switch (widget.module) {
case LunaModule.DASHBOARD:
throw Exception('Dashboard does not have a headers page');
throw Exception('Dashboard does not have a global state');
case LunaModule.EXTERNAL_MODULES:
throw Exception('External modules do not have a headers page');
throw Exception('External modules do not have a global state');
case LunaModule.LIDARR:
return;
case LunaModule.RADARR:
Expand All @@ -139,11 +139,11 @@ class _State extends State<SettingsHeaderRoute> with LunaScrollControllerMixin {
case LunaModule.NZBGET:
return;
case LunaModule.SEARCH:
throw Exception('Search does not have a headers page');
throw Exception('Search does not have a global state');
case LunaModule.SETTINGS:
throw Exception('Settings does not have a headers page');
throw Exception('Settings does not have a global state');
case LunaModule.WAKE_ON_LAN:
throw Exception('Wake on LAN does not have a headers page');
throw Exception('Wake on LAN does not have a global state');
case LunaModule.TAUTULLI:
return context.read<TautulliState>().reset();
case LunaModule.OVERSEERR:
Expand Down
4 changes: 1 addition & 3 deletions lib/modules/settings/core/utilities/headers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ class HeaderUtility {
await _genericHeader(context, headers, indexer);
break;
default:
LunaLogger().warning(
'Unknown case: ${result.item2}',
);
LunaLogger().warning('Unknown case: ${result.item2}');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class _State extends State<ConfigurationDashboardRoute>

Widget _calendarSettingsPage() {
return LunaBlock(
title: 'Calendar Settings',
body: const [TextSpan(text: 'Customize the Unified Calendar')],
title: 'settings.CalendarSettings'.tr(),
body: [TextSpan(text: 'settings.CalendarSettingsDescription'.tr())],
trailing: const LunaIconButton.arrow(),
onTap: SettingsRoutes.CONFIGURATION_DASHBOARD_CALENDAR.go,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class _State extends State<ConfigurationOverseerrRoute>
Widget _enabledToggle() {
return LunaBox.profiles.listenableBuilder(
builder: (context, _) => LunaBlock(
title: 'Enable ${LunaModule.OVERSEERR.title}',
title: 'settings.EnableModule'.tr(args: [LunaModule.OVERSEERR.title]),
trailing: LunaSwitch(
value: LunaProfile.current.overseerrEnabled,
onChanged: (value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class _State extends State<ConfigurationRadarrDefaultPagesRoute>
const _db = RadarrDatabase.NAVIGATION_INDEX_MOVIE_DETAILS;
return _db.listenableBuilder(
builder: (context, _) => LunaBlock(
title: 'Movie Details',
title: 'radarr.MovieDetails'.tr(),
body: [
TextSpan(text: RadarrMovieDetailsNavigationBar.titles[_db.read()]),
],
Expand All @@ -89,7 +89,7 @@ class _State extends State<ConfigurationRadarrDefaultPagesRoute>
const _db = RadarrDatabase.NAVIGATION_INDEX_ADD_MOVIE;
return _db.listenableBuilder(
builder: (context, _) => LunaBlock(
title: 'Add Movie',
title: 'radarr.AddMovie'.tr(),
body: [TextSpan(text: RadarrAddMovieNavigationBar.titles[_db.read()])],
trailing:
LunaIconButton(icon: RadarrAddMovieNavigationBar.icons[_db.read()]),
Expand All @@ -109,7 +109,7 @@ class _State extends State<ConfigurationRadarrDefaultPagesRoute>
const _db = RadarrDatabase.NAVIGATION_INDEX_SYSTEM_STATUS;
return _db.listenableBuilder(
builder: (context, _) => LunaBlock(
title: 'System Status',
title: 'radarr.SystemStatus'.tr(),
body: [
TextSpan(text: RadarrSystemStatusNavigationBar.titles[_db.read()]),
],
Expand Down

0 comments on commit 5ce1279

Please sign in to comment.