Clean up translations and strings in import routine.

This commit is contained in:
James Cole
2018-04-29 19:28:07 +02:00
parent d2bb65bf04
commit fa41d6df04
7 changed files with 205 additions and 184 deletions

View File

@@ -162,7 +162,7 @@ class IndexController extends Controller
$providers[$name]['prereq_complete'] = $result;
}
$subTitle = trans('firefly.import_index_sub_title');
$subTitle = trans('import.index_breadcrumb');
$subTitleIcon = 'fa-home';
return view('import.index', compact('subTitle', 'subTitleIcon', 'providers'));

View File

@@ -1,6 +1,6 @@
<?php
/**
* ConfigurationController.php
* JobConfigurationController.php
* Copyright (c) 2017 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
@@ -32,9 +32,9 @@ use Illuminate\Http\Request;
use Log;
/**
* Class ConfigurationController
* Class JobConfigurationController
*/
class ConfigurationController extends Controller
class JobConfigurationController extends Controller
{
/** @var ImportJobRepositoryInterface */
public $repository;

View File

@@ -52,6 +52,8 @@ class PrerequisitesController extends Controller
app('view')->share('mainTitleIcon', 'fa-archive');
app('view')->share('title', trans('firefly.import_index_title'));
app('view')->share('subTitleIcon', 'fa-check');
$this->repository = app(ImportJobRepositoryInterface::class);
return $next($request);
@@ -73,6 +75,7 @@ class PrerequisitesController extends Controller
*/
public function index(string $importProvider, ImportJob $importJob = null)
{
app('view')->share('subTitle', trans('import.prerequisites_breadcrumb_' . $importProvider));
$class = (string)config(sprintf('import.prerequisites.%s', $importProvider));
if (!class_exists($class)) {
throw new FireflyException(sprintf('No class to handle configuration for "%s".', $importProvider)); // @codeCoverageIgnore
@@ -134,7 +137,7 @@ class PrerequisitesController extends Controller
}
// session flash!
$request->session()->flash('success', (string)trans('firefly.prerequisites_saved_for_' . $importProvider));
$request->session()->flash('success', (string)trans('import.prerequisites_saved_for_' . $importProvider));
// if has job, redirect to global config for provider
// if no job, back to index!
@@ -142,8 +145,8 @@ class PrerequisitesController extends Controller
return redirect(route('import.index'));
}
// redirect to global config:
return redirect(route('import.index'));
// redirect to job config:
return redirect(route('import.job.configuration.index', [$importJob->key]));
}

View File

@@ -1149,51 +1149,9 @@ return [
'no_edit_multiple_left' => 'You have selected no valid transactions to edit.',
'cannot_convert_split_journal' => 'Cannot convert a split transaction',
// import bread crumbs and titles:
'import' => 'Import',
'import_data' => 'Import data',
'import_general_index_file' => 'Import a file',
'import_from_bunq' => 'Import from bunq',
'import_using_spectre' => 'Import using Spectre',
'import_using_plaid' => 'Import using Plaid',
'import_config_bread_crumb' => 'Set up your import',
// import index page:
// Import page (general strings only)
'import_index_title' => 'Import data into Firefly III',
'import_index_sub_title' => 'Index',
'import_general_index_intro' => 'Welcome to Firefly III\'s import routine. There are a few ways of importing data into Firefly III, displayed here as buttons.',
'upload_error' => 'The file you have uploaded could not be processed. Possibly it is of an invalid file type or encoding. The log files will have more information.',
'reset_import_settings_title' => 'Reset import configuration',
'reset_import_settings_text' => 'You can use these links to reset your import settings for specific providers. This is useful when bad settings stop you from importing data.',
'reset_settings_bunq' => 'Remove bunq API key, local external IP address and bunq related RSA keys.',
'reset_settings_spectre' => 'Remove Spectre secrets and ID\'s. This will also remove your Spectre keypair. Remember to update the new one.',
'settings_reset_for_bunq' => 'Bunq settings reset.',
'settings_reset_for_spectre' => 'Spectre settings reset.',
'import_need_prereq_title' => 'Import prerequisites',
'import_need_prereq_intro' => 'Some import methods need your attention before they can be used. For example, they might require special API keys or application secrets. You can configure them here. The icon indicates if these prerequisites have been met.',
'import_need_config_title' => 'Import configuration',
'import_need_config_intro' => 'Some import methods can be configured to your liking. They have extra settings you can tweak.',
'import_button_fake' => 'Fake an import',
'import_button_file' => 'Import a file',
'import_button_bunq' => 'Import from bunq',
'import_button_spectre' => 'Import using Spectre',
'import_button_plaid' => 'Import using Plaid',
'import_button_yodlee' => 'Import using Yodlee',
'import_button_quovo' => 'Import using Quovo',
'import_do_prereq_fake' => 'Prerequisites for the fake provider',
'import_do_prereq_bunq' => 'Prerequisites for imports from bunq',
'import_do_prereq_spectre' => 'Prerequisites for imports using Spectre',
'import_do_prereq_plaid' => 'Prerequisites for imports using Plaid',
'import_do_prereq_yodlee' => 'Prerequisites for imports using Yodlee',
'import_do_prereq_quovo' => 'Prerequisites for imports using Quovo',
'import_do_config_fake' => 'Configuration for the fake provider',
'import_do_config_file' => 'Configuration for file imports',
'import_do_config_bunq' => 'Configuration for bunq imports',
'import_do_config_spectre' => 'Configuration for imports from Spectre',
'import_do_config_plaid' => 'Configuration for imports from Plaid',
'import_do_config_yodlee' => 'Configuration for imports from Yodlee',
'import_do_config_quovo' => 'Configuration for imports from Quovo',
'import_data' => 'Import data',
// sandstorm.io errors and messages:
'sandstorm_not_available' => 'This function is not available when you are using Firefly III within a Sandstorm.io environment.',

View File

@@ -160,6 +160,66 @@ return [
// prerequisites
'prerequisites' => 'Prerequisites',
'prerequisites_breadcrumb_fake' => 'Prerequisites for fake provider',
'prerequisites_breadcrumb_file' => 'Prerequisites for file imports',
'prerequisites_breadcrumb_bunq' => 'Prerequisites for Bunq',
'prerequisites_breadcrumb_spectre' => 'Prerequisites for Spectre',
'prerequisites_breadcrumb_plaid' => 'Prerequisites for Plaid',
'prerequisites_breadcrumb_quovo' => 'Prerequisites for Quovo',
'prerequisites_breadcrumb_yodlee' => 'Prerequisites for Yodlee',
// success messages:
'prerequisites_saved_for_fake' => 'API key stored for fake provider',
'prerequisites_saved_for_file' => 'Data stored for file imports',
'prerequisites_saved_for_bunq' => 'API key and IP stored for bunq',
'prerequisites_saved_for_spectre' => 'App ID and secret stored for Spectre',
'prerequisites_saved_for_plaid' => 'Data stored for Plaid',
'prerequisites_saved_for_quovo' => 'Data stored for Quovo',
'prerequisites_saved_for_yodlee' => 'Data stored for Yodlee',
// index of import:
'general_index_title' => 'Import a file',
'general_index_intro' => 'Welcome to Firefly III\'s import routine. There are a few ways of importing data into Firefly III, displayed here as buttons.',
// import provider strings (index):
'button_fake' => 'Fake an import',
'button_file' => 'Import a file',
'button_bunq' => 'Import from bunq',
'button_spectre' => 'Import using Spectre',
'button_plaid' => 'Import using Plaid',
'button_yodlee' => 'Import using Yodlee',
'button_quovo' => 'Import using Quovo',
// global config box
'global_config_title' => 'Global import configuration',
'global_config_text' => 'In the future, this box will feature preferences that apply to ALL import providers above.',
// prereq box:
'need_prereq_title' => 'Import prerequisites',
'need_prereq_intro' => 'Some import methods need your attention before they can be used. For example, they might require special API keys or application secrets. You can configure them here. The icon indicates if these prerequisites have been met.',
'do_prereq_fake' => 'Prerequisites for the fake provider',
'do_prereq_file' => 'Prerequisites for file imports',
'do_prereq_bunq' => 'Prerequisites for imports from bunq',
'do_prereq_spectre' => 'Prerequisites for imports using Spectre',
'do_prereq_plaid' => 'Prerequisites for imports using Plaid',
'do_prereq_yodlee' => 'Prerequisites for imports using Yodlee',
'do_prereq_quovo' => 'Prerequisites for imports using Quovo',
// provider config box:
'can_config_title' => 'Import configuration',
'can_config_intro' => 'Some import methods can be configured to your liking. They have extra settings you can tweak.',
'do_config_fake' => 'Configuration for the fake provider',
'do_config_file' => 'Configuration for file imports',
'do_config_bunq' => 'Configuration for bunq imports',
'do_config_spectre' => 'Configuration for imports from Spectre',
'do_config_plaid' => 'Configuration for imports from Plaid',
'do_config_yodlee' => 'Configuration for imports from Yodlee',
'do_config_quovo' => 'Configuration for imports from Quovo',
// import index page:
'index_breadcrumb' => 'Index',
'upload_error' => 'The file you have uploaded could not be processed. Possibly it is of an invalid file type or encoding. The log files will have more information.',
// bunq
'bunq_prerequisites_title' => 'Prerequisites for an import from bunq',

View File

@@ -8,19 +8,19 @@
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">{{ 'import_index_title'|_ }}</h3>
<h3 class="box-title">{{ trans('firefly.import_index_title') }}</h3>
</div>
<div class="box-body">
<p>
{{ 'import_general_index_intro'|_ }}
{{ trans('import.general_index_intro') }}
</p>
<div class="row">
{% for name, provider in providers %}
{# button for each import thing: #}
<div class="col-lg-1 col-md-4 col-sm-6 text-center">
<a href="{{ route('import.create', [name]) }}">
<img src="images/logos/{{ name }}.png" alt="{{ ('import_button_'~name)|_ }}"/><br/>
{{ ('import_button_'~name)|_ }}
<img src="images/logos/{{ name }}.png" alt="{{ trans(('import.button_'~name)) }}"/><br/>
{{ trans(('import.button_'~name)) }}
</a>
</div>
{% endfor %}
@@ -34,11 +34,11 @@
<div class="col-lg-4 col-md-12 col-sm-12 col-xs-12">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">{{ 'import_global_config_title'|_ }}</h3>
<h3 class="box-title">{{ trans('import.global_config_title') }}</h3>
</div>
<div class="box-body">
<p>
{{ 'import_global_config_text'|_ }}
{{ trans('import.global_config_text') }}
</p>
</div>
</div>
@@ -46,11 +46,11 @@
<div class="col-lg-4 col-md-12 col-sm-12 col-xs-12">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">{{ 'import_need_prereq_title'|_ }}</h3>
<h3 class="box-title">{{ trans('import.need_prereq_title') }}</h3>
</div>
<div class="box-body">
<p>
{{ 'import_need_prereq_intro'|_ }}
{{ trans('import.need_prereq_intro') }}
</p>
<ul>
{% for name, provider in providers %}
@@ -61,7 +61,7 @@
{% else %}
<i class="fa fa-fw fa-warning text-danger"></i>
{% endif %}
<a href="#">{{ ('import_do_prereq_'~name)|_ }}</a>
<a href="{{ route('import.prerequisites.index', [name]) }}">{{ trans('import.do_prereq_'~name) }}</a>
</li>
{% endif %}
{% endfor %}
@@ -72,16 +72,16 @@
<div class="col-lg-4 col-md-12 col-sm-12 col-xs-12">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">{{ 'import_need_config_title'|_ }}</h3>
<h3 class="box-title">{{ trans('import.can_config_title') }}</h3>
</div>
<div class="box-body">
<p>
{{ 'import_need_config_intro'|_ }}
{{ trans('import.can_config_title') }}
</p>
<ul>
{% for name, provider in providers %}
{% if provider.has_config %}
<li><i class="fa fa-fw fa-wrench"></i> <a href="#">{{ ('import_do_config_'~name)|_ }}</a></li>
<li><i class="fa fa-fw fa-wrench"></i> <a href="#">{{ trans('import.do_config_'~name) }}</a></li>
{% endif %}
{% endfor %}
</ul>

View File

@@ -580,7 +580,7 @@ Breadcrumbs::register(
'import.index',
function (BreadCrumbsGenerator $breadcrumbs) {
$breadcrumbs->parent('home');
$breadcrumbs->push(trans('firefly.import'), route('import.index'));
$breadcrumbs->push(trans('firefly.import_index_title'), route('import.index'));
}
);
@@ -596,7 +596,7 @@ Breadcrumbs::register(
'import.prerequisites.index',
function (BreadCrumbsGenerator $breadcrumbs, string $importProvider) {
$breadcrumbs->parent('import.index');
$breadcrumbs->push(trans('import.prerequisites'), route('import.prerequisites.index', [$importProvider]));
$breadcrumbs->push(trans('import.prerequisites_breadcrumb_'.$importProvider), route('import.prerequisites.index', [$importProvider]));
}
);