From 5779784e0adcf0686ba057d46dee0b2515dcae5c Mon Sep 17 00:00:00 2001 From: Rob Weber Date: Tue, 5 Dec 2017 15:04:20 -0600 Subject: [PATCH] added strings for advanced editor --- .../resource.language.en_gb/strings.po | 88 ++++++++++++++++++- resources/lib/advanced_editor.py | 32 +++---- 2 files changed, 102 insertions(+), 18 deletions(-) diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index e0f9dad..c20810b 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -130,11 +130,11 @@ msgstr "Config Files" msgctxt "#30036" msgid "" -msgstr "" +msgstr "Disclaimer" msgctxt "#30037" msgid "" -msgstr "" +msgstr "Canceling this menu will close and save changes" msgctxt "#30038" msgid "Advanced Settings Detected" @@ -420,3 +420,87 @@ msgstr "Visit https://console.developers.google.com/" msgctxt "#30109" msgid "Run on startup if missed" msgstr "Run on startup if missed" + +msgctxt "#30110" +msgid "Set Name" +msgstr "" + +msgctxt "#30111" +msgid "Root folder selection" +msgstr "" + +msgctxt "#30112" +msgid "Browse Folder" +msgstr "" + +msgctxt "#30113" +msgid "Enter Own" +msgstr "" + +msgctxt "#30114" +msgid "starts in Kodi home" +msgstr "" + +msgctxt "#30115" +msgid "enter path to start there" +msgstr "" + +msgctxt "#30116" +msgid "Enter root path" +msgstr "" + +msgctxt "#30117" +msgid "Path Error" +msgstr "" + +msgctxt "#30118" +msgid "Path does not exist" +msgstr "" + +msgctxt "#30119" +msgid "Select root" +msgstr "" + +msgctxt "#30120" +msgid "Add Exclusion" +msgstr "" + +msgctxt "#30121" +msgid "Root Folder" +msgstr "" + +msgctxt "#30122" +msgid "Edit" +msgstr "" + +msgctxt "#30123" +msgid "Delete" +msgstr "" + +msgctxt "#30124" +msgid "Choose Action" +msgstr "" + +msgctxt "#30125" +msgid "Advanced Editor" +msgstr "" + +msgctxt "#30126" +msgid "Add Set" +msgstr "" + +msgctxt "#30127" +msgid "Delete Set" +msgstr "" + +msgctxt "#30128" +msgid "Are you sure you want to delete?" +msgstr "" + +msgctxt "#30129" +msgid "Exclude" +msgstr "" + +msgctxt "#30130" +msgid "The root folder cannot be changed" +msgstr "" \ No newline at end of file diff --git a/resources/lib/advanced_editor.py b/resources/lib/advanced_editor.py index f066f57..e0261e2 100644 --- a/resources/lib/advanced_editor.py +++ b/resources/lib/advanced_editor.py @@ -78,23 +78,23 @@ class AdvancedBackupEditor: def createSet(self): backupSet = None - name = self.dialog.input("Set Name",defaultt='Backup Set') + name = self.dialog.input(utils.getString(30110),defaultt='Backup Set') - if(name != ''): + if(name != None): #give a choice to start in home or enter a root path - enterHome = self.dialog.yesno('Root folder selection',line1='Browse Folder - starts in Kodi home',line2='Enter Own - enter path to start there',nolabel='Browse Folder',yeslabel='Enter Own') + enterHome = self.dialog.yesno(utils.getString(30111),line1=utils.getString(30112) + " - " + utils.getString(30114),line2=utils.getString(30113) + " - " + utils.getString(30115),nolabel=utils.getString(30112),yeslabel=utils.getString(30113)) rootFolder = 'special://home' if(enterHome): - rootFolder = self.dialog.input('Enter root path',defaultt=rootFolder) + rootFolder = self.dialog.input(utils.getString(30116),defaultt=rootFolder) #check that this path even exists if(not xbmcvfs.exists(xbmc.translatePath(rootFolder))): - self.dialog.ok('Path Error','Path does not exist',rootFolder) + self.dialog.ok(utils.getString(30117),utils.getString(30118),rootFolder) else: #select path to start set - rootFolder = self.dialog.browse(type=0,heading="Select Root",shares='files',defaultt=rootFolder) + rootFolder = self.dialog.browse(type=0,heading=utils.getString(30119),shares='files',defaultt=rootFolder) backupSet = {'name':name,'root':rootFolder} @@ -104,23 +104,23 @@ class AdvancedBackupEditor: optionSelected = '' while(optionSelected != -1): - options = ['Add Exclusion','Root: ' + backupSet['root']] + options = [utils.getString(30120),utils.getString(30121) + ": " + backupSet['root']] for aDir in backupSet['dirs']: if(aDir['type'] == 'exclude'): - options.append('Exclude: ' + aDir['path']) + options.append(utils.getString(30129) + ': ' + aDir['path']) - optionSelected = self.dialog.select('Edit ' + name,options) + optionSelected = self.dialog.select(utils.getString(30122) + ' ' + name,options) if(optionSelected == 0): #add an exclusion - excludeFolder = self.dialog.browse(type=0,heading="Add Exclusion",shares='files',defaultt=backupSet['root']) + excludeFolder = self.dialog.browse(type=0,heading=utils.getString(30120),shares='files',defaultt=backupSet['root']) #will equal root if cancel is hit if(excludeFolder != backupSet['root']): backupSet['dirs'].append({"path":excludeFolder,"type":"exclude"}) elif(optionSelected == 1): - self.dialog.ok('Root Folder','The root folder cannot be changed',backupSet['root']) + self.dialog.ok(utils.getString(30121),utils.getString(30130),backupSet['root']) elif(optionSelected > 1): #remove exclusion folder del backupSet['dirs'][optionSelected - 2] @@ -133,17 +133,17 @@ class AdvancedBackupEditor: customPaths = BackupSetManager() #show this every time - self.dialog.ok('Disclaimer','Canceling this menu will close and save changes') + self.dialog.ok(utils.getString(30036),utils.getString(30037)) while(exitCondition != -1): #load the custom paths - options = ['Add Set'] + options = [utils.getString(30126)] for aPath in customPaths.getSets(): options.append(aPath) #show the gui - exitCondition = self.dialog.select('Advanced Editor',options) + exitCondition = self.dialog.select(utils.getString(30125),options) if(exitCondition >= 0): if(exitCondition == 0): @@ -152,7 +152,7 @@ class AdvancedBackupEditor: customPaths.addSet(newSet) else: #bring up a context menu - menuOption = self.dialog.select(heading="Choose Action",list=['Edit','Delete'],preselect=0) + menuOption = self.dialog.select(heading=utils.getString(30124),list=[utils.getString(30122),utils.getString(30123)],preselect=0) if(menuOption == 0): #get the set @@ -165,7 +165,7 @@ class AdvancedBackupEditor: customPaths.updateSet(aSet['name'],updatedSet) elif(menuOption == 1): - if(self.dialog.yesno(heading="Delete Set",line1="Are you sure you want to delete?")): + if(self.dialog.yesno(heading=utils.getString(30127),line1=utils.getString(30128))): #delete this path - subtract one because of "add" item customPaths.deleteSet(exitCondition -1)