}
});
- // Set the default download file path if the storage permission has not been granted.
- if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_DENIED) {
+ // Set the initial file paths.
+ if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) { // The storage permission has been granted.
+ // Create a string for the external public path.
+ String EXTERNAL_PUBLIC_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS) + "/" + getString(R.string.privacy_browser_settings);
+
+ // Set the default path.
+ exportFileEditText.setText(EXTERNAL_PUBLIC_PATH);
+ importFileEditText.setText(EXTERNAL_PUBLIC_PATH);
+ } else { // The storage permission has not been granted.
// Create a string for the external private path.
- String EXTERNAL_PRIVATE_PATH = getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS) + "/Privacy Browser Backup";
+ String EXTERNAL_PRIVATE_PATH = getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS) + "/" + getString(R.string.privacy_browser_settings);
// Set the default path.
exportFileEditText.setText(EXTERNAL_PRIVATE_PATH);
intent.setType("*/*");
// Set the initial export file name.
- intent.putExtra(Intent.EXTRA_TITLE, getString(R.string.privacy_browser_backup));
+ intent.putExtra(Intent.EXTRA_TITLE, getString(R.string.privacy_browser_settings));
// Set the initial directory if API >= 26.
if (Build.VERSION.SDK_INT >= 26) {
// Check to see if `unformattedUrlString` is a valid URL. Otherwise, convert it into a search.
if ((Patterns.WEB_URL.matcher(unformattedUrlString).matches()) || (unformattedUrlString.startsWith("http://")) || (unformattedUrlString.startsWith("https://"))) {
- // Add `http://` at the beginning if it is missing. Otherwise the app will segfault.
+ // Add `https://` at the beginning if it is missing. Otherwise the app will segfault.
if (!unformattedUrlString.startsWith("http")) {
- unformattedUrlString = "http://" + unformattedUrlString;
+ unformattedUrlString = "https://" + unformattedUrlString;
}
// Initialize `unformattedUrl`.
<string name="bookmarks">Favoritos</string>
<string name="downloads">Descargas</string>
<string name="settings">Configuración</string>
+ <string name="import_export">Importar/Exportar</string>
<string name="guide">Guía</string>
<string name="about">Acerca de</string>
<string name="clear_and_exit">Borrar y salir</string>
<string name="current_website_ssl_certificate">Certificado SSL actual de la web</string>
<string name="load_an_encrypted_website">Cargar una página web cifrada antes de abrir la configuración de dominio para rellenar el certificado SSL de la página web actual.</string>
+ <!-- Import/Export. -->
+ <string name="browse">Navegar</string>
+ <string name="file_permissions_explanation">Acceder a los archivos en directorios públicos requiere el permiso de almacenamiento. De lo contrario, sólo funcionarán los directorios privados.</string>
+ <string name="export_settings">Exportar los ajustes</string>
+ <string name="import_settings">Importar los ajustes</string>
+ <string name="export_file_name">Exportar nombre de archivo</string>
+ <string name="import_file_name">Importar nombre de archivo</string>
+ <string name="export">Exportar</string>
+ <string name="import_button">Importar</string> <!-- `import` is a reserved word and cannot be used as the name -->
+ <string name="export_successful">Exportación exitosa.</string>
+ <string name="export_failed">Exportación fallida:</string>
+ <string name="import_failed">Importación fallida:</string>
+ <string name="cannot_export">Los ajustes no pueden exportarse a esta ubicación porque no se ha concedido el permiso de almacenamiento.</string>
+ <string name="cannot_import">Los ajustes no pueden importarse a esta ubicación porque no se ha concedido el permiso de almacenamiento.</string>
+ <string name="invalid_location">no es una ubicación válida.</string>
+ <string name="storage_permission">Permiso de almacenamiento</string>
+ <string name="storage_permission_message">Navegador Privado necesita el permiso de almacenamiento para acceder a los directorios públicos.
+ Si se deniega, el directorio privado de la aplicación todavía puede utilizarse.</string>
+
<!-- Guide. -->
<string name="privacy_browser_guide">Guía de Navegador Privado</string>
<string name="overview">Visión general</string>
<!-- Import/Export. -->
<string name="browse">Browse</string>
<string name="file_permissions_explanation">Accessing files in public directories requires the storage permission. Otherwise only private directories will work.</string>
- <string name="privacy_browser_backup">Privacy Browser Backup</string>
<string name="export_settings">Export Settings</string>
<string name="import_settings">Import Settings</string>
<string name="export_file_name">Export file name</string>