From 029b3245bdb670e913193e592395b59c667af794 Mon Sep 17 00:00:00 2001 From: canewsin Date: Sun, 15 Aug 2021 01:25:42 +0530 Subject: [PATCH] v 0.8.1 - beta 13 - Language Support for Spanish, Persian, Chinese, Italian v 0.8.1 - beta 12 - Added LICENSE to the project. - Added Small Patch lib to patch file changes. - Updated ZeroNet core with tor v3 patch. - Added stringcontroller.dart to centralise all strings to one place. - Various Bug Fixes and Code Improvements. --- lib/controllers/stringcontroller.dart | 1176 +++++++++---------------- lib/others/common.dart | 27 + lib/others/constants.dart | 10 + lib/widgets/home_page.dart | 6 +- lib/widgets/settings_page.dart | 42 + version.properties | 4 +- 6 files changed, 511 insertions(+), 754 deletions(-) diff --git a/lib/controllers/stringcontroller.dart b/lib/controllers/stringcontroller.dart index 174c556..9418d14 100644 --- a/lib/controllers/stringcontroller.dart +++ b/lib/controllers/stringcontroller.dart @@ -3,264 +3,54 @@ import '../imports.dart'; final strController = Get.put(StrController()); class StrController extends GetxController { - get statusStr => 'Status'.obs; - - set statusStr(String str) { - statusStr.value = str; - } - - get statusNotRunningStr => 'Not Running'.obs; - - set statusNotRunningStr(String str) { - statusNotRunningStr.value = str; - } - - get statusInitializingStr => 'Initializing..'.obs; - - set statusInitializingStr(String str) { - statusInitializingStr.value = str; - } - - get statusStartingStr => 'Starting'.obs; - - set statusStartingStr(String str) { - statusStartingStr.value = str; - } - - get statusRunningStr => 'Running'.obs; - - set statusRunningStr(String str) { - statusRunningStr.value = str; - } - - get statusRunningWithTorStr => 'Running with Tor'.obs; - - set statusRunningWithTorStr(String str) { - statusRunningStr.value = str; - } - - get statusErrorStr => 'Error'.obs; - - set statusErrorStr(String str) { - statusErrorStr.value = str; - } - - get popularSitesStr => 'Popular Sites'.obs; - - set popularSitesStr(String str) { - popularSitesStr.value = str; - } - - get startZeroNetFirstStr => + var statusStr = 'Status'.obs; + var statusNotRunningStr = 'Not Running'.obs; + var statusInitializingStr = 'Initializing..'.obs; + var statusStartingStr = 'Starting'.obs; + var statusRunningStr = 'Running'.obs; + var statusRunningWithTorStr = 'Running with Tor'.obs; + var statusErrorStr = 'Error'.obs; + var popularSitesStr = 'Popular Sites'.obs; + var startZeroNetFirstStr = 'Please Start ZeroNet First to Browse this Zite'.obs; - - set startZeroNetFirstStr(String str) { - startZeroNetFirstStr.value = str; - } - - get createStr => 'Create'.obs; - - set createStr(String str) { - createStr.value = str; - } - - get openStr => 'OPEN'.obs; - - set openStr(String str) { - openStr.value = str; - } - - get downloadStr => 'DOWNLOAD'.obs; - - set downloadStr(String str) { - downloadStr.value = str; - } - - get addToHomeScreenStr => 'Add to HomeScreen'.obs; - - set addToHomeScreenStr(String str) { - addToHomeScreenStr.value = str; - } - - get showLogStr => 'Show Log'.obs; - - set showLogStr(String str) { - showLogStr.value = str; - } - - get pauseStr => 'Pause'.obs; - - set pauseStr(String str) { - pauseStr.value = str; - } - - get resumeStr => 'Resume'.obs; - - set resumeStr(String str) { - resumeStr.value = str; - } - - get deleteZiteStr => 'Delete Zite'.obs; - - set deleteZiteStr(String str) { - deleteZiteStr.value = str; - } - - get shrtAddedToHomeScreenStr => 'shortcut added to HomeScreen'.obs; - - set shrtAddedToHomeScreenStr(String str) { - shrtAddedToHomeScreenStr.value = str; - } - - get startStr => 'Start'.obs; - - set startStr(String str) { - startStr.value = str; - } - - get restartStr => 'Restart'.obs; - - set restartStr(String str) { - restartStr.value = str; - } - - get pleaseWaitStr => 'Please Wait..!'.obs; - - set pleaseWaitStr(String str) { - pleaseWaitStr.value = str; - } - - get stopStr => 'Stop'.obs; - - set stopStr(String str) { - stopStr.value = str; - } - - get closeStr => 'Close'.obs; - - set closeStr(String str) { - closeStr.value = str; - } - - get viewLogStr => 'View Log'.obs; - - set viewLogStr(String str) { - viewLogStr.value = str; - } - - get aboutStr => 'About'.obs; - - set aboutStr(String str) { - aboutStr.value = str; - } - - get settingsStr => 'Settings'.obs; - - set settingsStr(String str) { - settingsStr.value = str; - } - - get browserStr => 'Browser'.obs; - - set browserStr(String str) { - browserStr.value = str; - } - - get logStr => 'Log'.obs; - - set logStr(String str) { - logStr.value = str; - } - - get updateStr => 'Update'.obs; - - set updateStr(String str) { - updateStr.value = str; - } - - get downloadingStr => 'Downloading'.obs; - - set downloadingStr(String str) { - downloadingStr.value = str; - } - - get downloadedStr => 'Downloaded'.obs; - - set downloadedStr(String str) { - downloadedStr.value = str; - } - - get installStr => 'Install'.obs; - - set installStr(String str) { - installStr.value = str; - } - - get restoreStr => 'Restore'.obs; - - set restoreStr(String str) { - restoreStr.value = str; - } - - get installingStr => 'Installing'.obs; - - set installingStr(String str) { - installingStr.value = str; - } - - get installationCompletedStr => 'Installation Completed'.obs; - - set installationCompletedStr(String str) { - installationCompletedStr.value = str; - } - - get notAvaliableStr => 'Not Available'.obs; - - set notAvaliableStr(String str) { - notAvaliableStr.value = str; - } - - get aboutAppDesStr => 'ZeroNet Mobile is a full native client for ZeroNet, ' + var createStr = 'Create'.obs; + var openStr = 'OPEN'.obs; + var downloadStr = 'DOWNLOAD'.obs; + var addToHomeScreenStr = 'Add to HomeScreen'.obs; + var showLogStr = 'Show Log'.obs; + var pauseStr = 'Pause'.obs; + var resumeStr = 'Resume'.obs; + var deleteZiteStr = 'Delete Zite'.obs; + var shrtAddedToHomeScreenStr = 'shortcut added to HomeScreen'.obs; + var startStr = 'Start'.obs; + var restartStr = 'Restart'.obs; + var pleaseWaitStr = 'Please Wait..!'.obs; + var stopStr = 'Stop'.obs; + var closeStr = 'Close'.obs; + var viewLogStr = 'View Log'.obs; + var aboutStr = 'About'.obs; + var settingsStr = 'Settings'.obs; + var browserStr = 'Browser'.obs; + var logStr = 'Log'.obs; + var updateStr = 'Update'.obs; + var downloadingStr = 'Downloading'.obs; + var downloadedStr = 'Downloaded'.obs; + var installStr = 'Install'.obs; + var restoreStr = 'Restore'.obs; + var installingStr = 'Installing'.obs; + var installationCompletedStr = 'Installation Completed'.obs; + var notAvaliableStr = 'Not Available'.obs; + var aboutAppDesStr = 'ZeroNet Mobile is a full native client for ZeroNet, ' 'a platform for decentralized websites using Bitcoin ' .obs; - - set aboutAppDesStr(String str) { - aboutAppDesStr.value = str; - } - - get aboutAppDes1Str => + var aboutAppDes1Str = 'crypto and the BitTorrent network. you can learn more about ZeroNet at ' .obs; - - set aboutAppDes1Str(String str) { - aboutAppDes1Str.value = str; - } - - get developersStr => 'Developers'.obs; - - set developersStr(String str) { - developersStr.value = str; - } - - get donationAddrsStr => 'Donation Addresses'.obs; - - set donationAddrsStr(String str) { - donationAddrsStr.value = str; - } - - get clickAddrToCopyStr => '* Click on Address to copy'.obs; - - set clickAddrToCopyStr(String str) { - clickAddrToCopyStr.value = str; - } - - get donAddrCopiedStr => 'Donation Address Copied to Clipboard'.obs; - - set donAddrCopiedStr(String str) { - donAddrCopiedStr.value = str; - } - - get donationDes => "* Any Donation can activate all pro-features in app, " + var developersStr = 'Developers'.obs; + var donationAddrsStr = 'Donation Addresses'.obs; + var clickAddrToCopyStr = '* Click on Address to copy'.obs; + var donAddrCopiedStr = 'Donation Address Copied to Clipboard'.obs; + var donationDes = "* Any Donation can activate all pro-features in app, " "these are just an encouragement to me to work more on the app. " "Pro-features will be made available to general public after certain time, " "thus you don't need to worry about exclusiveness of a feature. " @@ -268,131 +58,35 @@ class StrController extends GetxController { "just send your transaction id to canews.in@gmail.com / ZeroMail: zeromepro, " "so than I can send activation code to activate pro-features." .obs; - - set donationDes(String str) { - donationDes.value = str; - } - - get contributeStr => 'Contribute'.obs; - - set contributeStr(String str) { - contributeStr.value = str; - } - - get contributeDesStr => "If you want to support project's further development, " + var contributeStr = 'Contribute'.obs; + var contributeDesStr = "If you want to support project's further development, " "you can contribute your time or money, " "If you want to contribute money you can send bitcoin or " "other supported crypto currencies to above addresses or buy in-app purchases, " "if want to contribute translations or code, visit official GitHub repo." .obs; - - set contributeDesStr(String str) { - contributeDesStr.value = str; - } - - get googlePurchasesStr => 'Google Play Purchases'.obs; - - set googlePurchasesStr(String str) { - googlePurchasesStr.value = str; - } - - get googleFeeWarningStr => '(30% taken by Google) :'.obs; - - set googleFeeWarningStr(String str) { - googleFeeWarningStr.value = str; - } - - get oneTimeSubStr => 'One Time'.obs; - - set oneTimeSubStr(String str) { - oneTimeSubStr.value = str; - } - - get monthlySubStr => 'Monthly Subscriptions'.obs; - - set monthlySubStr(String str) { - monthlySubStr.value = str; - } - - get tipStr => 'Tip'.obs; - - set tipStr(String str) { - tipStr.value = str; - } - - get coffeeStr => 'Coffee'.obs; - - set coffeeStr(String str) { - coffeeStr.value = str; - } - - get lunchStr => 'Lunch'.obs; - - set lunchStr(String str) { - lunchStr.value = str; - } - - get usersFileCopied => 'Users.json content copied to Clipboard'.obs; - - set usersFileCopied(String str) { - usersFileCopied.value = str; - } - - get chkBckUpStr => - 'Please check yourself that file back up Successfully.'.obs; - - set chkBckUpStr(String str) { - chkBckUpStr.value = str; - } - - get zeroNetNotInitTitleStr => 'ZeroNet data folder not Exists.'.obs; - - set zeroNetNotInitTitleStr(String str) { - zeroNetNotInitTitleStr.value = str; - } - - get zeroNetNotInitDesStr => + var googlePurchasesStr = 'Google Play Purchases'.obs; + var googleFeeWarningStr = '(30% taken by Google) :'.obs; + var oneTimeSubStr = 'One Time'.obs; + var monthlySubStr = 'Monthly Subscriptions'.obs; + var tipStr = 'Tip'.obs; + var coffeeStr = 'Coffee'.obs; + var lunchStr = 'Lunch'.obs; + var usersFileCopied = 'Users.json content copied to Clipboard'.obs; + var chkBckUpStr = 'Please check yourself that file back up Successfully.'.obs; + var zeroNetNotInitTitleStr = 'ZeroNet data folder not Exists.'.obs; + var zeroNetNotInitDesStr = "ZeroNet should be used atleast once (run it from home screen), " "before using this option" .obs; - - set zeroNetNotInitDesStr(String str) { - zeroNetNotInitDesStr.value = str; - } - - get loadingStr => 'Loading'.obs; - - set loadingStr(String str) { - loadingStr.value = str; - } - - get switchProfileToStr => 'Switch Profile to'.obs; - - set switchProfileToStr(String str) { - switchProfileToStr.value = str; - } - - get switchProfileToDesStr => 'this will delete the existing profile, ' + var loadingStr = 'Loading'.obs; + var switchProfileToStr = 'Switch Profile to'.obs; + var switchProfileToDesStr = 'this will delete the existing profile, ' 'backup existing profile using backup button below' .obs; - - set switchProfileToDesStr(String str) { - switchProfileToDesStr.value = str; - } - - get backupStr => 'Backup'.obs; - - set backupStr(String str) { - backupStr.value = str; - } - - get switchStr => 'Switch'.obs; - - set switchStr(String str) { - switchStr.value = str; - } - - get loadingPageWarningStr => """ + var backupStr = 'Backup'.obs; + var switchStr = 'Switch'.obs; + var loadingPageWarningStr = """ Please Wait! This may take a while, happens only first time, Don't Press Back button. If You Accidentally Pressed Back, @@ -400,454 +94,438 @@ class StrController extends GetxController { Uninstall and Reinstall The App. """ .obs; - - set loadingPageWarningStr(String str) { - loadingPageWarningStr.value = str; - } - - get appUpdateAvailableStr => 'App Update Available : '.obs; - - set appUpdateAvailableStr(String str) { - appUpdateAvailableStr.value = str; - } - - get knowMoreStr => 'Know More'.obs; - - set knowMoreStr(String str) { - knowMoreStr.value = str; - } - - get ratingWgtStr => 'Give Your Rating/Feedback'.obs; - - set ratingWgtStr(String str) { - ratingWgtStr.value = str; - } - - get siteInfoStr => 'SiteInfo'.obs; - - set siteInfoStr(String str) { - siteInfoStr.value = str; - } - - get backupWarningStr => + var appUpdateAvailableStr = 'App Update Available : '.obs; + var knowMoreStr = 'Know More'.obs; + var ratingWgtStr = 'Give Your Rating/Feedback'.obs; + var siteInfoStr = 'SiteInfo'.obs; + var backupWarningStr = 'Always remember to backup users.json before doing anything because, ' 'we are not able to tell when a software will fail. ' 'Click Backup below to backup your Existing users.json file.\n' .obs; - - set backupWarningStr(String str) { - backupWarningStr.value = str; - } - - get usernameStr => 'Username'.obs; - - set usernameStr(String str) { - usernameStr.value = str; - } - - get usernamePhraseStr => 'Username Phrase :'.obs; - - set usernamePhraseStr(String str) { - usernamePhraseStr.value = str; - } - - get usrnameWarning1Str => 'username can\'t be Empty'.obs; - - set usrnameWarning1Str(String str) { - usrnameWarning1Str.value = str; - } - - get usrnameWarning2Str => 'username can\'t contain spaces'.obs; - - set usrnameWarning2Str(String str) { - usrnameWarning2Str.value = str; - } - - get usrnameWarning3Str => 'username can\'t be less than 6 characters.'.obs; - - set usrnameWarning3Str(String str) { - usrnameWarning3Str.value = str; - } - - get usrnameWarning4Str => - 'username already exists, choose different one.'.obs; - - set usrnameWarning4Str(String str) { - usrnameWarning4Str.value = str; - } - - get znNotiRunningTitleStr => 'ZeroNet Mobile is Running'.obs; - - set znNotiRunningTitleStr(String str) { - znNotiRunningTitleStr.value = str; - } - - get znNotiRunningDesStr => 'Click Here on this Notification to open app'.obs; - - set znNotiRunningDesStr(String str) { - znNotiRunningDesStr.value = str; - } - - get znNotiNotRunningTitleStr => 'ZeroNet Mobile is Not Running'.obs; - - set znNotiNotRunningTitleStr(String str) { - znNotiNotRunningTitleStr.value = str; - } - - get znNotiNotRunningDesStr => + var usernameStr = 'Username'.obs; + var usernamePhraseStr = 'Username Phrase :'.obs; + var usrnameWarning1Str = 'username can\'t be Empty'.obs; + var usrnameWarning2Str = 'username can\'t contain spaces'.obs; + var usrnameWarning3Str = 'username can\'t be less than 6 characters.'.obs; + var usrnameWarning4Str = 'username already exists, choose different one.'.obs; + var znNotiRunningTitleStr = 'ZeroNet Mobile is Running'.obs; + var znNotiRunningDesStr = 'Click Here on this Notification to open app'.obs; + var znNotiNotRunningTitleStr = 'ZeroNet Mobile is Not Running'.obs; + var znNotiNotRunningDesStr = 'Open ZeroNet Mobile App and click start to run ZeroNet'.obs; - - set znNotiNotRunningDesStr(String str) { - znNotiNotRunningDesStr.value = str; - } - - get znPluginInstallingTitleStr => 'Installing Plugin'.obs; - - set znPluginInstallingTitleStr(String str) { - znPluginInstallingTitleStr.value = str; - } - - get znPluginInstallingDesStr => + var znPluginInstallingTitleStr = 'Installing Plugin'.obs; + var znPluginInstallingDesStr = 'This Dialog will be automatically closed after installation, ' 'After Installation Restart ZeroNet from Home page' .obs; - - set znPluginInstallingDesStr(String str) { - znPluginInstallingDesStr.value = str; - } - - get zninstallAPluginTitleStr => 'Install A Plugin'.obs; - - set zninstallAPluginTitleStr(String str) { - zninstallAPluginTitleStr.value = str; - } - - get zninstallAPluginDesStr => 'This will load plugin to your ZeroNet repo, ' + var zninstallAPluginTitleStr = 'Install A Plugin'.obs; + var zninstallAPluginDesStr = 'This will load plugin to your ZeroNet repo, ' '\nWarning : Loading Unknown/Untrusted plugins may compromise ZeroNet Installation.' .obs; - - set zninstallAPluginDesStr(String str) { - zninstallAPluginDesStr.value = str; - } - - get restoreProfileTitleStr => 'Restore Profile ?'.obs; - - set restoreProfileTitleStr(String str) { - restoreProfileTitleStr.value = str; - } - - get restoreProfileDesStr => 'this will delete the existing profile, ' + var restoreProfileTitleStr = 'Restore Profile ?'.obs; + var restoreProfileDesStr = 'this will delete the existing profile, ' 'backup existing profile using backup button below\n\n' 'Selected Userfile : \n' .obs; - - set restoreProfileDesStr(String str) { - restoreProfileDesStr.value = str; - } - - get restoreProfileDes1Str => + var restoreProfileDes1Str = 'You can only select users.json file, outside zeronet data folder'.obs; - - set restoreProfileDes1Str(String str) { - restoreProfileDesStr.value = str; - } - - get existingProfileTitleStr => 'Provide A Name for Existing Profile'.obs; - - set existingProfileTitleStr(String str) { - existingProfileTitleStr.value = str; - } - - get createNewProfileStr => 'Create New Profile'.obs; - - set createNewProfileStr(String str) { - createNewProfileStr.value = str; - } - - get importProfileStr => 'Import Profile'.obs; - - set importProfileStr(String str) { - importProfileStr.value = str; - } - - get backupProfileStr => 'Backup Profile'.obs; - - set backupProfileStr(String str) { - backupProfileStr.value = str; - } - - get openPluginManagerStr => 'Open Plugin Manager'.obs; - - set openPluginManagerStr(String str) { - openPluginManagerStr.value = str; - } - - get loadPluginStr => 'Load Plugin'.obs; - - set loadPluginStr(String str) { - loadPluginStr.value = str; - } - - get zerohelloSiteDesStr => 'Say Hello to ZeroNet, a Dashboard to manage ' + var existingProfileTitleStr = 'Provide A Name for Existing Profile'.obs; + var createNewProfileStr = 'Create New Profile'.obs; + var importProfileStr = 'Import Profile'.obs; + var backupProfileStr = 'Backup Profile'.obs; + var openPluginManagerStr = 'Open Plugin Manager'.obs; + var loadPluginStr = 'Load Plugin'.obs; + var zerohelloSiteDesStr = 'Say Hello to ZeroNet, a Dashboard to manage ' 'all your ZeroNet Z(S)ites, You can view feed of other zites like ' 'posts, comments of other users from ZeroTalk as well for your posts ' 'and Stats like Total Requests sent and received from other peers on ZeroNet. ' 'You can also pause, clone or favourite, delete Zites from single page.' .obs; - - set zerohelloSiteDesStr(String str) { - zerohelloSiteDesStr.value = str; - } - - get zeronetMobileSiteDesStr => 'Forum to report ZeroNet Mobile app issues. ' + var zeronetMobileSiteDesStr = 'Forum to report ZeroNet Mobile app issues. ' 'Want a new feature in the app, Request a Feature. ' 'Facing any Bugs while using the app ? ' 'Just report problem here, we will take care of it. ' 'Want to Discuss any topic about app development ? ' 'Just dive into to this Zite.' .obs; - - set zeronetMobileSiteDesStr(String str) { - zeronetMobileSiteDesStr.value = str; - } - - get zeroTalkSiteDesStr => 'Need a forum to discuss something, ' + var zeroTalkSiteDesStr = 'Need a forum to discuss something, ' 'we got covered you here. ZeroTalk fits your need, ' 'just post something to get opinion from others on Network. ' 'Have some queries ? don\'t hesitate to ask here.' 'Tired of Spam ? Who don\'t! You can mute individual users also.' .obs; - - set zeroTalkSiteDesStr(String str) { - zeroTalkSiteDesStr.value = str; - } - - get zeroblogSiteDesStr => 'Want to Know Where ZeroNet is Going ? ' + var zeroblogSiteDesStr = 'Want to Know Where ZeroNet is Going ? ' 'ZeroBlog gives you latest changes and improvements ' 'made to ZeroNet, including Bug Fixes, ' 'Speed Improvements of ZeroNet Core Software. ' 'Also Provides varies links to ZeroNet Protocol and ' 'how ZeroNet works underhood and much more things to know.' .obs; - - set zeroblogSiteDesStr(String str) { - zeroblogSiteDesStr.value = str; - } - - get zeromailSiteDesStr => 'So you need a mail service, use ZeroMail, ' + var zeromailSiteDesStr = 'So you need a mail service, use ZeroMail, ' 'fully end-to-end encrypted mail service on ZeroNet, ' 'don\'t let others scanning your mailbox for their profits ' 'all your data is encrypted and can only opened by you. ' 'Your all mails are backedup, so you can stay calm for your data.' .obs; - - set zeromailSiteDesStr(String str) { - zeromailSiteDesStr.value = str; - } - - get zeromeSiteDesStr => 'Social Network is everywhere, so we made one here too. ' + var zeromeSiteDesStr = 'Social Network is everywhere, so we made one here too. ' 'Twitter like, Peer to Peer Social Networking in your hands without data-tracking, ' 'Follow others and post your thoughts, like, comment on others posts, it\'s that easy-peasy. ' 'Find Like minded people and increase your friend circle beyond the borders.' .obs; - - set zeromeSiteDesStr(String str) { - zeromeSiteDesStr.value = str; - } - - get zeroSitesSiteDesStr => 'Want to know more sites on ZeroNet, ' + var zeroSitesSiteDesStr = 'Want to know more sites on ZeroNet, ' 'visit ZeroSites, listing of community contributed sites under various ' 'categories like Blogs, Services, Forums, Chat, Video, Image, Guides, News and much more. ' 'You can even filter those lists with your preferred language ' 'to get more comprehensive list. Has a New Site to Show, Just Submit here.' .obs; - - set zeroSitesSiteDesStr(String str) { - zeroSitesSiteDesStr.value = str; - } - - get themeSwitcherStr => 'Theme'.obs; - - set themeSwitcherStr(String str) { - themeSwitcherStr.value = str; - } - - get themeSwitcherDesStr => 'Switch App Theme between Light, Dark, Black'.obs; - - set themeSwitcherDesStr(String str) { - themeSwitcherDesStr.value = str; - } - - get profileSwitcherStr => 'Profile Switcher'.obs; - - set profileSwitcherStr(String str) { - profileSwitcherStr.value = str; - } - - get profileSwitcherDesStr => 'Create and Use different Profiles on ZeroNet, ' + var themeSwitcherStr = 'Theme'.obs; + var themeSwitcherDesStr = 'Switch App Theme between Light, Dark, Black'.obs; + var languageSwitcherStr = 'Language'.obs; + var languageSwitcherDesStr = 'Change App Language to your Native Speaks'.obs; + var profileSwitcherStr = 'Profile Switcher'.obs; + var profileSwitcherDesStr = 'Create and Use different Profiles on ZeroNet, ' 'Import Existing Profiles from other devices, or Backup your Profile. ' '\nNote: If Backup Profile doesn\'t work. Long Press the "Backup Profile" Button, ' 'it will copy users.json file contents to clipboard, so that you can save the private keys from this option.' .obs; - - set profileSwitcherDesStr(String str) { - profileSwitcherDesStr.value = str; - } - - get debugZeroNetStr => 'Debug ZeroNet Code'.obs; - - set debugZeroNetStr(String str) { - debugZeroNetStr.value = str; - } - - get debugZeroNetDesStr => + var debugZeroNetStr = 'Debug ZeroNet Code'.obs; + var debugZeroNetDesStr = 'Useful for Developers to find bugs and errors in the code.'.obs; - - set debugZeroNetDesStr(String str) { - debugZeroNetDesStr.value = str; - } - - get enableZeroNetConsoleStr => 'Enable ZeroNet Console'.obs; - - set enableZeroNetConsoleStr(String str) { - enableZeroNetConsoleStr.value = str; - } - - get enableZeroNetConsoleDesStr => + var enableZeroNetConsoleStr = 'Enable ZeroNet Console'.obs; + var enableZeroNetConsoleDesStr = 'Useful for Developers to see the exec of ZeroNet Python code'.obs; - - set enableZeroNetConsoleDesStr(String str) { - enableZeroNetConsoleDesStr.value = str; - } - - get enableZeroNetFiltersStr => 'Enable ZeroNet Filters'.obs; - - set enableZeroNetFiltersStr(String str) { - enableZeroNetFiltersStr.value = str; - } - - get enableZeroNetFiltersDesStr => + var enableZeroNetFiltersStr = 'Enable ZeroNet Filters'.obs; + var enableZeroNetFiltersDesStr = 'Enabling ZeroNet Filters blocks known ametuer content sites and spam users.' .obs; - - set enableZeroNetFiltersDesStr(String str) { - enableZeroNetFiltersDesStr.value = str; - } - - get enableAdditionalTrackersStr => 'Additional BitTorrent Trackers'.obs; - - set enableAdditionalTrackersStr(String str) { - enableAdditionalTrackersStr.value = str; - } - - get enableAdditionalTrackersDesStr => + var enableAdditionalTrackersStr = 'Additional BitTorrent Trackers'.obs; + var enableAdditionalTrackersDesStr = 'Enabling External/Additional BitTorrent Trackers will give more ZeroNet Site Seeders or Clients.' .obs; - - set enableAdditionalTrackersDesStr(String str) { - enableAdditionalTrackersDesStr.value = str; - } - - get pluginManagerStr => 'Plugin Manager'.obs; - - set pluginManagerStr(String str) { - pluginManagerStr.value = str; - } - - get pluginManagerDesStr => 'Enable/Disable ZeroNet Plugins'.obs; - - set pluginManagerDesStr(String str) { - pluginManagerDesStr.value = str; - } - - get vibrateOnZeroNetStartStr => 'Vibrate on ZeroNet Start'.obs; - - set vibrateOnZeroNetStartStr(String str) { - vibrateOnZeroNetStartStr.value = str; - } - - get vibrateOnZeroNetStartDesStr => 'Vibrates Phone When ZeroNet Starts'.obs; - - set vibrateOnZeroNetStartDesStr(String str) { - vibrateOnZeroNetStartDesStr.value = str; - } - - get enableFullScreenOnWebViewStr => 'FullScreen for ZeroNet Zites'.obs; - - set enableFullScreenOnWebViewStr(String str) { - enableFullScreenOnWebViewStr.value = str; - } - - get enableFullScreenOnWebViewDesStr => + var pluginManagerStr = 'Plugin Manager'.obs; + var pluginManagerDesStr = 'Enable/Disable ZeroNet Plugins'.obs; + var vibrateOnZeroNetStartStr = 'Vibrate on ZeroNet Start'.obs; + var vibrateOnZeroNetStartDesStr = 'Vibrates Phone When ZeroNet Starts'.obs; + var enableFullScreenOnWebViewStr = 'FullScreen for ZeroNet Zites'.obs; + var enableFullScreenOnWebViewDesStr = 'This will Enable Full Screen for in app Webview of ZeroNet'.obs; - - set enableFullScreenOnWebViewDesStr(String str) { - enableFullScreenOnWebViewDesStr.value = str; - } - - get batteryOptimisationStr => 'Disable Battery Optimisation'.obs; - - set batteryOptimisationStr(String str) { - batteryOptimisationStr.value = str; - } - - get batteryOptimisationDesStr => + var batteryOptimisationStr = 'Disable Battery Optimisation'.obs; + var batteryOptimisationDesStr = 'This will Helps to Run App even App is in Background for long time.'.obs; - - set batteryOptimisationDesStr(String str) { - batteryOptimisationDesStr.value = str; - } - - get publicDataFolderStr => 'Public DataFolder'.obs; - - set publicDataFolderStr(String str) { - publicDataFolderStr.value = str; - } - - get publicDataFolderDesStr => + var publicDataFolderStr = 'Public DataFolder'.obs; + var publicDataFolderDesStr = 'This Will Make ZeroNet Data Folder Accessible via File Manager.'.obs; - - set publicDataFolderDesStr(String str) { - publicDataFolderDesStr.value = str; - } - - get autoStartZeroNetStr => 'AutoStart ZeroNet'.obs; - - set autoStartZeroNetStr(String str) { - autoStartZeroNetStr.value = str; - } - - get autoStartZeroNetDesStr => + var autoStartZeroNetStr = 'AutoStart ZeroNet'.obs; + var autoStartZeroNetDesStr = 'This Will Make ZeroNet Auto Start on App Start, So you don\'t have to click Start Button Every Time on App Start.' .obs; - - set autoStartZeroNetDesStr(String str) { - autoStartZeroNetDesStr.value = str; - } - - get autoStartZeroNetonBootStr => 'AutoStart ZeroNet on Boot'.obs; - - set autoStartZeroNetonBootStr(String str) { - autoStartZeroNetonBootStr.value = str; - } - - get autoStartZeroNetonBootDesStr => + var autoStartZeroNetonBootStr = 'AutoStart ZeroNet on Boot'.obs; + var autoStartZeroNetonBootDesStr = 'This Will Make ZeroNet Auto Start on Device Boot.'.obs; - - set autoStartZeroNetonBootDesStr(String str) { - autoStartZeroNetonBootDesStr.value = str; - } - - get enableTorLogStr => 'Enable Tor Log'.obs; - - set enableTorLogStr(String str) { - enableTorLogStr.value = str; - } - - get enableTorLogDesStr => + var enableTorLogStr = 'Enable Tor Log'.obs; + var enableTorLogDesStr = 'This will Enable Tor Log in ZeroNet Console helpful for debugging.'.obs; - set enableTorLogDesStr(String str) { - enableTorLogDesStr.value = str; + void updatestatusStr(String str) => statusStr.value = str; + void updatestatusNotRunningStr(String str) => statusNotRunningStr.value = str; + void updatestatusInitializingStr(String str) => + statusInitializingStr.value = str; + void updatestatusStartingStr(String str) => statusStartingStr.value = str; + void updatestatusRunningStr(String str) => statusRunningStr.value = str; + void updatestatusRunningWithTorStr(String str) => + statusRunningStr.value = str; + void updatestatusErrorStr(String str) => statusErrorStr.value = str; + void updatepopularSitesStr(String str) => popularSitesStr.value = str; + void updatestartZeroNetFirstStr(String str) => + startZeroNetFirstStr.value = str; + void updatecreateStr(String str) => createStr.value = str; + void updateopenStr(String str) => openStr.value = str; + void updatedownloadStr(String str) => downloadStr.value = str; + void updateaddToHomeScreenStr(String str) => addToHomeScreenStr.value = str; + void updateshowLogStr(String str) => showLogStr.value = str; + void updatepauseStr(String str) => pauseStr.value = str; + void updateresumeStr(String str) => resumeStr.value = str; + void updatedeleteZiteStr(String str) => deleteZiteStr.value = str; + void updateshrtAddedToHomeScreenStr(String str) => + shrtAddedToHomeScreenStr.value = str; + void updatestartStr(String str) => startStr.value = str; + void updaterestartStr(String str) => restartStr.value = str; + void updatepleaseWaitStr(String str) => pleaseWaitStr.value = str; + void updatestopStr(String str) => stopStr.value = str; + void updatecloseStr(String str) => closeStr.value = str; + void updateviewLogStr(String str) => viewLogStr.value = str; + void updateaboutStr(String str) => aboutStr.value = str; + void updatesettingsStr(String str) => settingsStr.value = str; + void updatebrowserStr(String str) => browserStr.value = str; + void updatelogStr(String str) => logStr.value = str; + void updateupdateStr(String str) => updateStr.value = str; + void updatedownloadingStr(String str) => downloadingStr.value = str; + void updatedownloadedStr(String str) => downloadedStr.value = str; + void updateinstallStr(String str) => installStr.value = str; + void updaterestoreStr(String str) => restoreStr.value = str; + void updateinstallingStr(String str) => installingStr.value = str; + void updateinstallationCompletedStr(String str) => + installationCompletedStr.value = str; + void updatenotAvaliableStr(String str) => notAvaliableStr.value = str; + void updateaboutAppDesStr(String str) => aboutAppDesStr.value = str; + void updateaboutAppDes1Str(String str) => aboutAppDes1Str.value = str; + void updatedevelopersStr(String str) => developersStr.value = str; + void updatedonationAddrsStr(String str) => donationAddrsStr.value = str; + void updateclickAddrToCopyStr(String str) => clickAddrToCopyStr.value = str; + void updatedonAddrCopiedStr(String str) => donAddrCopiedStr.value = str; + void updatedonationDes(String str) => donationDes.value = str; + void updatecontributeStr(String str) => contributeStr.value = str; + void updatecontributeDesStr(String str) => contributeDesStr.value = str; + void updategooglePurchasesStr(String str) => googlePurchasesStr.value = str; + void updategoogleFeeWarningStr(String str) => googleFeeWarningStr.value = str; + void updateoneTimeSubStr(String str) => oneTimeSubStr.value = str; + void updatemonthlySubStr(String str) => monthlySubStr.value = str; + void updatetipStr(String str) => tipStr.value = str; + void updatecoffeeStr(String str) => coffeeStr.value = str; + void updatelunchStr(String str) => lunchStr.value = str; + void updateusersFileCopied(String str) => usersFileCopied.value = str; + void updatechkBckUpStr(String str) => chkBckUpStr.value = str; + void updatezeroNetNotInitTitleStr(String str) => + zeroNetNotInitTitleStr.value = str; + void updatezeroNetNotInitDesStr(String str) => + zeroNetNotInitDesStr.value = str; + void updateloadingStr(String str) => loadingStr.value = str; + void updateswitchProfileToStr(String str) => switchProfileToStr.value = str; + void updateswitchProfileToDesStr(String str) => + switchProfileToDesStr.value = str; + void updatebackupStr(String str) => backupStr.value = str; + void updateswitchStr(String str) => switchStr.value = str; + void updateloadingPageWarningStr(String str) => + loadingPageWarningStr.value = str; + void updateappUpdateAvailableStr(String str) => + appUpdateAvailableStr.value = str; + void updateknowMoreStr(String str) => knowMoreStr.value = str; + void updateratingWgtStr(String str) => ratingWgtStr.value = str; + void updatesiteInfoStr(String str) => siteInfoStr.value = str; + void updatebackupWarningStr(String str) => backupWarningStr.value = str; + void updateusernameStr(String str) => usernameStr.value = str; + void updateusernamePhraseStr(String str) => usernamePhraseStr.value = str; + void updateusrnameWarning1Str(String str) => usrnameWarning1Str.value = str; + void updateusrnameWarning2Str(String str) => usrnameWarning2Str.value = str; + void updateusrnameWarning3Str(String str) => usrnameWarning3Str.value = str; + void updateusrnameWarning4Str(String str) => usrnameWarning4Str.value = str; + void updateznNotiRunningTitleStr(String str) => + znNotiRunningTitleStr.value = str; + void updateznNotiRunningDesStr(String str) => znNotiRunningDesStr.value = str; + void updateznNotiNotRunningTitleStr(String str) => + znNotiNotRunningTitleStr.value = str; + void updateznNotiNotRunningDesStr(String str) => + znNotiNotRunningDesStr.value = str; + void updateznPluginInstallingTitleStr(String str) => + znPluginInstallingTitleStr.value = str; + void updateznPluginInstallingDesStr(String str) => + znPluginInstallingDesStr.value = str; + void updatezninstallAPluginTitleStr(String str) => + zninstallAPluginTitleStr.value = str; + void updatezninstallAPluginDesStr(String str) => + zninstallAPluginDesStr.value = str; + void updaterestoreProfileTitleStr(String str) => + restoreProfileTitleStr.value = str; + void updaterestoreProfileDesStr(String str) => + restoreProfileDesStr.value = str; + void updaterestoreProfileDes1Str(String str) => + restoreProfileDesStr.value = str; + void updateexistingProfileTitleStr(String str) => + existingProfileTitleStr.value = str; + void updatecreateNewProfileStr(String str) => createNewProfileStr.value = str; + void updateimportProfileStr(String str) => importProfileStr.value = str; + void updatebackupProfileStr(String str) => backupProfileStr.value = str; + void updateopenPluginManagerStr(String str) => + openPluginManagerStr.value = str; + void updateloadPluginStr(String str) => loadPluginStr.value = str; + void updatezerohelloSiteDesStr(String str) => zerohelloSiteDesStr.value = str; + void updatezeronetMobileSiteDesStr(String str) => + zeronetMobileSiteDesStr.value = str; + void updatezeroTalkSiteDesStr(String str) => zeroTalkSiteDesStr.value = str; + void updatezeroblogSiteDesStr(String str) => zeroblogSiteDesStr.value = str; + void updatezeromailSiteDesStr(String str) => zeromailSiteDesStr.value = str; + void updatezeromeSiteDesStr(String str) => zeromeSiteDesStr.value = str; + void updatezeroSitesSiteDesStr(String str) => zeroSitesSiteDesStr.value = str; + void updatethemeSwitcherStr(String str) => themeSwitcherStr.value = str; + void updatethemeSwitcherDesStr(String str) => themeSwitcherDesStr.value = str; + void updatelanguageSwitcherStr(String str) => languageSwitcherStr.value = str; + void updatelanguageSwitcherDesStr(String str) => + languageSwitcherDesStr.value = str; + void updateprofileSwitcherStr(String str) => profileSwitcherStr.value = str; + void updateprofileSwitcherDesStr(String str) => + profileSwitcherDesStr.value = str; + void updatedebugZeroNetStr(String str) => debugZeroNetStr.value = str; + void updatedebugZeroNetDesStr(String str) => debugZeroNetDesStr.value = str; + void updateenableZeroNetConsoleStr(String str) => + enableZeroNetConsoleStr.value = str; + void updateenableZeroNetConsoleDesStr(String str) => + enableZeroNetConsoleDesStr.value = str; + void updateenableZeroNetFiltersStr(String str) => + enableZeroNetFiltersStr.value = str; + void updateenableZeroNetFiltersDesStr(String str) => + enableZeroNetFiltersDesStr.value = str; + void updateenableAdditionalTrackersStr(String str) => + enableAdditionalTrackersStr.value = str; + void updateenableAdditionalTrackersDesStr(String str) => + enableAdditionalTrackersDesStr.value = str; + void updatepluginManagerStr(String str) => pluginManagerStr.value = str; + void updatepluginManagerDesStr(String str) => pluginManagerDesStr.value = str; + void updatevibrateOnZeroNetStartStr(String str) => + vibrateOnZeroNetStartStr.value = str; + void updatevibrateOnZeroNetStartDesStr(String str) => + vibrateOnZeroNetStartDesStr.value = str; + void updateenableFullScreenOnWebViewStr(String str) => + enableFullScreenOnWebViewStr.value = str; + void updateenableFullScreenOnWebViewDesStr(String str) => + enableFullScreenOnWebViewDesStr.value = str; + void updatebatteryOptimisationStr(String str) => + batteryOptimisationStr.value = str; + void updatebatteryOptimisationDesStr(String str) => + batteryOptimisationDesStr.value = str; + void updatepublicDataFolderStr(String str) => publicDataFolderStr.value = str; + void updatepublicDataFolderDesStr(String str) => + publicDataFolderDesStr.value = str; + void updateautoStartZeroNetStr(String str) => autoStartZeroNetStr.value = str; + void updateautoStartZeroNetDesStr(String str) => + autoStartZeroNetDesStr.value = str; + void updateautoStartZeroNetonBootStr(String str) => + autoStartZeroNetonBootStr.value = str; + void updateautoStartZeroNetonBootDesStr(String str) => + autoStartZeroNetonBootDesStr.value = str; + void updateenableTorLogStr(String str) => enableTorLogStr.value = str; + void updateenableTorLogDesStr(String str) => enableTorLogDesStr.value = str; + + void loadTranslationsFromFile(String path) { + File translationsFile = File(path); + Map map = json.decode(translationsFile.readAsStringSync()); + updatestatusStr(map['statusStr']); + updatestatusNotRunningStr(map['statusNotRunningStr']); + updatestatusInitializingStr(map['statusInitializingStr']); + updatestatusStartingStr(map['statusStartingStr']); + updatestatusRunningStr(map['statusRunningStr']); + updatestatusRunningWithTorStr(map['statusRunningWithTorStr']); + updatestatusErrorStr(map['statusErrorStr']); + updatepopularSitesStr(map['popularSitesStr']); + updatestartZeroNetFirstStr(map['startZeroNetFirstStr']); + updatecreateStr(map['createStr']); + updateopenStr(map['openStr']); + updatedownloadStr(map['downloadStr']); + updateaddToHomeScreenStr(map['addToHomeScreenStr']); + updateshowLogStr(map['showLogStr']); + updatepauseStr(map['pauseStr']); + updateresumeStr(map['resumeStr']); + updatedeleteZiteStr(map['deleteZiteStr']); + updateshrtAddedToHomeScreenStr(map['shrtAddedToHomeScreenStr']); + updatestartStr(map['startStr']); + updaterestartStr(map['restartStr']); + updatepleaseWaitStr(map['pleaseWaitStr']); + updatestopStr(map['stopStr']); + updatecloseStr(map['closeStr']); + updateviewLogStr(map['viewLogStr']); + updateaboutStr(map['aboutStr']); + updatesettingsStr(map['settingsStr']); + updatebrowserStr(map['browserStr']); + updatelogStr(map['logStr']); + updateupdateStr(map['updateStr']); + updatedownloadingStr(map['downloadingStr']); + updatedownloadedStr(map['downloadedStr']); + updateinstallStr(map['installStr']); + updaterestoreStr(map['restoreStr']); + updateinstallingStr(map['installingStr']); + updateinstallationCompletedStr(map['installationCompletedStr']); + updatenotAvaliableStr(map['notAvaliableStr']); + updateaboutAppDesStr(map['aboutAppDesStr']); + updateaboutAppDes1Str(map['aboutAppDes1Str']); + updatedevelopersStr(map['developersStr']); + updatedonationAddrsStr(map['donationAddrsStr']); + updateclickAddrToCopyStr(map['clickAddrToCopyStr']); + updatedonAddrCopiedStr(map['donAddrCopiedStr']); + updatedonationDes(map['donationDes']); + updatecontributeStr(map['contributeStr']); + updatecontributeDesStr(map['contributeDesStr']); + updategooglePurchasesStr(map['googlePurchasesStr']); + updategoogleFeeWarningStr(map['googleFeeWarningStr']); + updateoneTimeSubStr(map['oneTimeSubStr']); + updatemonthlySubStr(map['monthlySubStr']); + updatetipStr(map['tipStr']); + updatecoffeeStr(map['coffeeStr']); + updatelunchStr(map['lunchStr']); + updateusersFileCopied(map['usersFileCopied']); + updatechkBckUpStr(map['chkBckUpStr']); + updatezeroNetNotInitTitleStr(map['zeroNetNotInitTitleStr']); + updatezeroNetNotInitDesStr(map['zeroNetNotInitDesStr']); + updateloadingStr(map['loadingStr']); + updateswitchProfileToStr(map['switchProfileToStr']); + updateswitchProfileToDesStr(map['switchProfileToDesStr']); + updatebackupStr(map['backupStr']); + updateswitchStr(map['switchStr']); + updateloadingPageWarningStr(map['loadingPageWarningStr']); + updateappUpdateAvailableStr(map['appUpdateAvailableStr']); + updateknowMoreStr(map['knowMoreStr']); + updateratingWgtStr(map['ratingWgtStr']); + updatesiteInfoStr(map['siteInfoStr']); + updatebackupWarningStr(map['backupWarningStr']); + updateusernameStr(map['usernameStr']); + updateusernamePhraseStr(map['usernamePhraseStr']); + updateusrnameWarning1Str(map['usrnameWarning1Str']); + updateusrnameWarning2Str(map['usrnameWarning2Str']); + updateusrnameWarning3Str(map['usrnameWarning3Str']); + updateusrnameWarning4Str(map['usrnameWarning4Str']); + updateznNotiRunningTitleStr(map['znNotiRunningTitleStr']); + updateznNotiRunningDesStr(map['znNotiRunningDesStr']); + updateznNotiNotRunningTitleStr(map['znNotiNotRunningTitleStr']); + updateznNotiNotRunningDesStr(map['znNotiNotRunningDesStr']); + updateznPluginInstallingTitleStr(map['znPluginInstallingTitleStr']); + updateznPluginInstallingDesStr(map['znPluginInstallingDesStr']); + updatezninstallAPluginTitleStr(map['zninstallAPluginTitleStr']); + updatezninstallAPluginDesStr(map['zninstallAPluginDesStr']); + updaterestoreProfileTitleStr(map['restoreProfileTitleStr']); + updaterestoreProfileDesStr(map['restoreProfileDesStr']); + updaterestoreProfileDes1Str(map['restoreProfileDes1Str']); + updateexistingProfileTitleStr(map['existingProfileTitleStr']); + updatecreateNewProfileStr(map['createNewProfileStr']); + updateimportProfileStr(map['importProfileStr']); + updatebackupProfileStr(map['backupProfileStr']); + updateopenPluginManagerStr(map['openPluginManagerStr']); + updateloadPluginStr(map['loadPluginStr']); + updatezerohelloSiteDesStr(map['zerohelloSiteDesStr']); + updatezeronetMobileSiteDesStr(map['zeronetMobileSiteDesStr']); + updatezeroTalkSiteDesStr(map['zeroTalkSiteDesStr']); + updatezeroblogSiteDesStr(map['zeroblogSiteDesStr']); + updatezeromailSiteDesStr(map['zeromailSiteDesStr']); + updatezeromeSiteDesStr(map['zeromeSiteDesStr']); + updatezeroSitesSiteDesStr(map['zeroSitesSiteDesStr']); + updatethemeSwitcherStr(map['themeSwitcherStr']); + updatethemeSwitcherDesStr(map['themeSwitcherDesStr']); + updatelanguageSwitcherStr(map['languageSwitcherStr']); + updatelanguageSwitcherDesStr(map['languageSwitcherDesStr']); + updateprofileSwitcherStr(map['profileSwitcherStr']); + updateprofileSwitcherDesStr(map['profileSwitcherDesStr']); + updatedebugZeroNetStr(map['debugZeroNetStr']); + updatedebugZeroNetDesStr(map['debugZeroNetDesStr']); + updateenableZeroNetConsoleStr(map['enableZeroNetConsoleStr']); + updateenableZeroNetConsoleDesStr(map['enableZeroNetConsoleDesStr']); + updateenableZeroNetFiltersStr(map['enableZeroNetFiltersStr']); + updateenableZeroNetFiltersDesStr(map['enableZeroNetFiltersDesStr']); + updateenableAdditionalTrackersStr(map['enableAdditionalTrackersStr']); + updateenableAdditionalTrackersDesStr(map['enableAdditionalTrackersDesStr']); + updatepluginManagerStr(map['pluginManagerStr']); + updatepluginManagerDesStr(map['pluginManagerDesStr']); + updatevibrateOnZeroNetStartStr(map['vibrateOnZeroNetStartStr']); + updatevibrateOnZeroNetStartDesStr(map['vibrateOnZeroNetStartDesStr']); + updateenableFullScreenOnWebViewStr(map['enableFullScreenOnWebViewStr']); + updateenableFullScreenOnWebViewDesStr( + map['enableFullScreenOnWebViewDesStr']); + updatebatteryOptimisationStr(map['batteryOptimisationStr']); + updatebatteryOptimisationDesStr(map['batteryOptimisationDesStr']); + updatepublicDataFolderStr(map['publicDataFolderStr']); + updatepublicDataFolderDesStr(map['publicDataFolderDesStr']); + updateautoStartZeroNetStr(map['autoStartZeroNetStr']); + updateautoStartZeroNetDesStr(map['autoStartZeroNetDesStr']); + updateautoStartZeroNetonBootStr(map['autoStartZeroNetonBootStr']); + updateautoStartZeroNetonBootDesStr(map['autoStartZeroNetonBootDesStr']); + updateenableTorLogStr(map['enableTorLogStr']); + updateenableTorLogDesStr(map['enableTorLogDesStr']); } } diff --git a/lib/others/common.dart b/lib/others/common.dart index 77c5fb5..796667b 100644 --- a/lib/others/common.dart +++ b/lib/others/common.dart @@ -110,6 +110,19 @@ init() async { } if (!tempDir.existsSync()) tempDir.createSync(recursive: true); Purchases.setup("ShCpAJsKdJrAAQawcMQSswqTyPWFMwXb"); + var translations = loadTranslations(); + if (varStore.settings.keys.contains(languageSwitcher)) { + var setting = varStore.settings[languageSwitcher] as MapSetting; + var language = setting.map['selected']; + var code = translations[language] ?? 'en'; + strController.loadTranslationsFromFile( + getZeroNetDataDir().path + + '/' + + Utils.urlZeroNetMob + + '/translations/' + + 'strings-$code.json', + ); + } } List buildsRequirePatching = [60]; @@ -188,6 +201,20 @@ void zeronetNotInit(BuildContext context) => showDialogC( body: strController.zeroNetNotInitDesStr.value, ); +Map loadTranslations() { + Map langCodesMap = {}; + var translationsDir = Directory( + getZeroNetDataDir().path + '/' + Utils.urlZeroNetMob + '/translations', + ); + if (translationsDir.existsSync()) { + var langCodeFile = File(translationsDir.path + '/language-codes.json'); + if (langCodeFile.existsSync()) { + langCodesMap = json.decode(langCodeFile.readAsStringSync()); + } + } + return langCodesMap; +} + saveDataFile() { Map dataMap = { 'zeroNetNativeDir': zeroNetNativeDir, diff --git a/lib/others/constants.dart b/lib/others/constants.dart index bf4746a..6a65dff 100644 --- a/lib/others/constants.dart +++ b/lib/others/constants.dart @@ -75,6 +75,7 @@ const List appDevelopers = [ ), ]; +const String languageSwitcher = 'Language'; const String themeSwitcher = 'Theme'; const String profileSwitcher = 'Profile Switcher'; const String debugZeroNet = 'Debug ZeroNet Code'; @@ -152,6 +153,15 @@ class Utils { // static const String loadPlugin = 'Load Custom Plugin'; static Map defSettings = { + languageSwitcher: MapSetting( + name: strController.languageSwitcherStr.value, + description: strController.languageSwitcherDesStr.value, + map: { + "selected": '', + "all": [], + }, + options: [], + ), themeSwitcher: MapSetting( name: strController.themeSwitcherStr.value, description: strController.themeSwitcherDesStr.value, diff --git a/lib/widgets/home_page.dart b/lib/widgets/home_page.dart index a3c8789..20ac27b 100644 --- a/lib/widgets/home_page.dart +++ b/lib/widgets/home_page.dart @@ -186,7 +186,7 @@ class ZeroNetStatusWidget extends StatelessWidget { child: Text( uiStore.zeroNetStatus.value.message, style: GoogleFonts.roboto( - fontSize: 20, + fontSize: 18, color: uiStore.currentTheme.value.btnTextColor, ), ), @@ -208,7 +208,7 @@ class ZeroNetStatusWidget extends StatelessWidget { child: Text( uiStore.zeroNetStatus.value.actionText, style: GoogleFonts.roboto( - fontSize: 20, + fontSize: 18, color: uiStore.currentTheme.value.btnTextColor, ), ), @@ -230,7 +230,7 @@ class ZeroNetStatusWidget extends StatelessWidget { child: Text( ZeroNetStatus.NOT_RUNNING.actionText, style: GoogleFonts.roboto( - fontSize: 20, + fontSize: 18, color: Colors.white, ), ), diff --git a/lib/widgets/settings_page.dart b/lib/widgets/settings_page.dart index b0608f3..6cf5014 100644 --- a/lib/widgets/settings_page.dart +++ b/lib/widgets/settings_page.dart @@ -247,6 +247,48 @@ class SettingsCard extends StatelessWidget { ), ); }); + else if ((setting as MapSetting).name == languageSwitcher) + loadTranslations().keys.forEach((language) { + children.insert( + 0, + InkWell( + borderRadius: BorderRadius.circular(24.0), + splashColor: Color(0xFF5380FF), + onTap: () { + String code = loadTranslations()[language]; + strController.loadTranslationsFromFile( + getZeroNetDataDir().path + + '/' + + Utils.urlZeroNetMob + + '/translations/' + + 'strings-$code.json', + ); + varStore.updateSetting((setting as MapSetting) + ..map = {'selected': language}); + saveSettings(varStore.settings); + }, + child: Padding( + padding: + const EdgeInsets.only(left: 3.0, right: 3.0), + child: Chip( + elevation: 2.0, + backgroundColor: + uiStore.currentTheme.value.cardBgColor, + label: Text( + language, + maxLines: 1, + style: GoogleFonts.roboto( + fontSize: 14.0, + fontWeight: FontWeight.w500, + color: uiStore + .currentTheme.value.primaryTextColor, + ), + ), + ), + ), + ), + ); + }); return Wrap( children: children, ); diff --git a/version.properties b/version.properties index 144a4d2..7833351 100644 --- a/version.properties +++ b/version.properties @@ -1,2 +1,2 @@ -flutter.versionName=v 0.8.1 - beta 12 -flutter.versionCode=67 +flutter.versionName=v 0.8.1 - beta 13 +flutter.versionCode=68