From 13b92c47d9967a93da3e45d173e439945e4aa3f5 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 11 Jun 2016 06:31:40 +0200 Subject: [PATCH] Translations and fixes. --- app/Import/Importer/CsvImporter.php | 24 +++++---- resources/lang/en_US/firefly.php | 64 +++++++++++++---------- resources/lang/en_US/form.php | 13 +++++ resources/views/import/csv/configure.twig | 9 ++-- 4 files changed, 68 insertions(+), 42 deletions(-) diff --git a/app/Import/Importer/CsvImporter.php b/app/Import/Importer/CsvImporter.php index 801c61f0ee..abd18cb913 100644 --- a/app/Import/Importer/CsvImporter.php +++ b/app/Import/Importer/CsvImporter.php @@ -51,22 +51,16 @@ class CsvImporter implements ImporterInterface ]; $data = [ - 'accounts' => ExpandedForm::makeSelectList($accounts), - 'specifix' => [], - 'delimiters' => $delimiters, + 'accounts' => ExpandedForm::makeSelectList($accounts), + 'specifix' => [], + 'delimiters' => $delimiters, + 'upload_path' => storage_path('upload'), + 'is_upload_possible' => is_writable(storage_path('upload')), ]; return $data; } - /** - * @param ImportJob $job - */ - public function setJob(ImportJob $job) - { - $this->job = $job; - } - /** * Returns a Map thing used to allow the user to * define roles for each entry. @@ -78,4 +72,12 @@ class CsvImporter implements ImporterInterface return 'do not work'; exit; } + + /** + * @param ImportJob $job + */ + public function setJob(ImportJob $job) + { + $this->job = $job; + } } \ No newline at end of file diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 61ed2cd803..e2a0bfac5a 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -327,11 +327,11 @@ return [ 'title_transfers' => 'Transfers', // import routine - 'import_data' => 'Import data', - 'import' => 'Import', - 'import_intro_text' => 'Some intro here', - 'import_file_help' => 'Select your file', - + 'import_data' => 'Import data', + 'import' => 'Import', + 'import_intro_text' => 'Some intro here', + 'import_file_help' => 'Select your file', + // create new stuff: 'create_new_withdrawal' => 'Create new withdrawal', @@ -727,29 +727,39 @@ return [ 'split_table_intro_withdrawal' => 'Split your withdrawal in as many things as you want. By default the transaction will not split, there is just one entry. Add as many splits as you want to, below. Remember that you should not deviate from your total amount. If you do, Firefly will warn you but not correct you.', 'store_splitted_withdrawal' => 'Store splitted withdrawal', 'update_splitted_withdrawal' => 'Update splitted withdrawal', + 'split_title_deposit' => 'Split your new deposit', + 'split_intro_one_deposit' => 'Firefly supports the "splitting" of a deposit.', + 'split_intro_two_deposit' => 'It means that the amount of money you\'ve earned is divided between several source revenue accounts or categories.', + 'split_intro_three_deposit' => 'For example: you could split your :total salary so you get :split_one as your base salary and :split_two as a reimbursment for expenses made.', + 'split_table_intro_deposit' => 'Split your deposit in as many things as you want. By default the transaction will not split, there is just one entry. Add as many splits as you want to, below. Remember that you should not deviate from your total amount. If you do, Firefly will warn you but not correct you.', + 'store_splitted_deposit' => 'Store splitted deposit', + 'split_title_transfer' => 'Split your new transfer', + 'split_intro_one_transfer' => 'Firefly supports the "splitting" of a transfer.', + 'split_intro_two_transfer' => 'It means that the amount of money you\'re moving is divided between several categories or piggy banks.', + 'split_intro_three_transfer' => 'For example: you could split your :total move so you get :split_one in one piggy bank and :split_two in another.', + 'split_table_intro_transfer' => 'Split your transfer in as many things as you want. By default the transaction will not split, there is just one entry. Add as many splits as you want to, below. Remember that you should not deviate from your total amount. If you do, Firefly will warn you but not correct you.', + 'store_splitted_transfer' => 'Store splitted transfer', + 'add_another_split' => 'Add another split', + 'split-transactions' => 'Split transactions', + 'split-new-transaction' => 'Split a new transaction', + 'do_split' => 'Do a split', + 'split_this_withdrawal' => 'Split this withdrawal', + 'split_this_deposit' => 'Split this deposit', + 'split_this_transfer' => 'Split this transfer', - 'split_title_deposit' => 'Split your new deposit', - 'split_intro_one_deposit' => 'Firefly supports the "splitting" of a deposit.', - 'split_intro_two_deposit' => 'It means that the amount of money you\'ve earned is divided between several source revenue accounts or categories.', - 'split_intro_three_deposit' => 'For example: you could split your :total salary so you get :split_one as your base salary and :split_two as a reimbursment for expenses made.', - 'split_table_intro_deposit' => 'Split your deposit in as many things as you want. By default the transaction will not split, there is just one entry. Add as many splits as you want to, below. Remember that you should not deviate from your total amount. If you do, Firefly will warn you but not correct you.', - 'store_splitted_deposit' => 'Store splitted deposit', - - 'split_title_transfer' => 'Split your new transfer', - 'split_intro_one_transfer' => 'Firefly supports the "splitting" of a transfer.', - 'split_intro_two_transfer' => 'It means that the amount of money you\'re moving is divided between several categories or piggy banks.', - 'split_intro_three_transfer' => 'For example: you could split your :total move so you get :split_one in one piggy bank and :split_two in another.', - 'split_table_intro_transfer' => 'Split your transfer in as many things as you want. By default the transaction will not split, there is just one entry. Add as many splits as you want to, below. Remember that you should not deviate from your total amount. If you do, Firefly will warn you but not correct you.', - 'store_splitted_transfer' => 'Store splitted transfer', - - 'add_another_split' => 'Add another split', - 'split-transactions' => 'Split transactions', - 'split-new-transaction' => 'Split a new transaction', - - 'do_split' => 'Do a split', - 'split_this_withdrawal' => 'Split this withdrawal', - 'split_this_deposit' => 'Split this deposit', - 'split_this_transfer' => 'Split this transfer', + // import + 'import_file_type_csv' => 'CSV (comma separated values)', + 'import_file_type_help' => 'Select the type of file you will upload', + 'import_start' => 'Start the import', + 'import_csv_configure_title' => 'Configure your import', + 'import_csv_configure_intro' => 'There are some options for your CSV import.', + 'import_csv_configure_form' => 'Form', + 'csv_header_help' => 'Check this if the first row of your CSV file are the column titles', + 'csv_date_help' => 'Date time format in your CSV. Follow the format like this page indicates. The default value will parse dates that look like this: :dateExample.', + 'csv_delimiter_help' => 'Choose the field delimiter that is used in your input file. If not sure, comma is the safest option.', + 'csv_csv_config_file_help' => 'Select your CSV import configuration here. If you do not know what this is, ignore it. It will be explained later.', + 'csv_import_account_help' => 'If your CSV file does NOT contain information about your asset account(s), use this dropdown to select to which account the transactions in the CSV belong to.', + 'csv_upload_not_writeable' => 'The grey box contains a file path. It should be writeable. Please make sure it is.', ]; diff --git a/resources/lang/en_US/form.php b/resources/lang/en_US/form.php index d261d04399..c2bf0cb5e9 100644 --- a/resources/lang/en_US/form.php +++ b/resources/lang/en_US/form.php @@ -130,4 +130,17 @@ return [ 'budget_keep_transactions' => 'The only transaction connected to this budget will not be deleted.|All :count transactions connected to this budget will spared deletion.', 'category_keep_transactions' => 'The only transaction connected to this category will not be deleted.|All :count transactions connected to this category will spared deletion.', 'tag_keep_transactions' => 'The only transaction connected to this tag will not be deleted.|All :count transactions connected to this tag will spared deletion.', + + // import + 'import_file' => 'Import file', + 'import_file_type' => 'Import file type', + 'csv_comma' => 'A comma (,)', + 'csv_semicolon' => 'A semicolon (;)', + 'csv_tab' => 'A tab (invisible)', + 'csv_delimiter' => 'CSV field delimiter', + 'csv_import_account' => 'Default import account', + 'csv_config' => 'CSV import configuration', + + + ]; diff --git a/resources/views/import/csv/configure.twig b/resources/views/import/csv/configure.twig index 1a4e95f42b..d9645cd7d1 100644 --- a/resources/views/import/csv/configure.twig +++ b/resources/views/import/csv/configure.twig @@ -14,7 +14,7 @@

- {{ 'import_csv_configure_intro' }} + {{ 'import_csv_configure_intro'|_ }}

@@ -45,14 +45,14 @@ - {% if not uploadPossible %} + {% if not data.is_upload_possible %}
 
-
{{ path }}
+
{{ data.upload_path }}

{{ 'csv_upload_not_writeable'|_ }}

@@ -64,7 +64,7 @@
- + {% if data.is_upload_possible %}
@@ -76,6 +76,7 @@
+ {% endif %}