plugin_id = 'plugin.video.latelelibre_fr' localized_strings = { 'Next page': 30010, 'Type not suported': 30011, 'Video not located': 30012, 'Previous page': 30013, 'All videos': 30014, 'Search': 30015, } p = Plugin(plugin_id) settings = p.get_plugin_settings() translation = p.get_plugin_translation() debug_flag = settings.getSetting("debug") == "true" p.set_debug_mode(debug_flag) api.set_debug(debug_flag) def get_located_string(string_name): """This function returns the localized string if it is available.""" return translation(localized_strings.get(string_name)).encode( 'utf-8' ) or string_name if string_name in localized_strings else string_name # Entry point
plugin_id = 'plugin.video.latelelibre_fr' localized_strings = { 'Next page' : 30010, 'Type not suported' : 30011, 'Video not located' : 30012, 'Previous page' : 30013, 'All videos' : 30014, 'Search' : 30015, } p = Plugin(plugin_id) settings = p.get_plugin_settings() translation = p.get_plugin_translation() debug_flag = settings.getSetting("debug") == "true" p.set_debug_mode(debug_flag) api.set_debug(debug_flag, p.log) st_release = settings.getSetting('version') current_release = settings.getAddonInfo('version') update_settings = False # This is to make it sure that settings are correctly setup on every addon # update if required or on first time of update settings either. if not st_release: p.log("ltl Warning: First run of update settings.") settings.openSettings()