diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php
index 8a05ac615bbe..f9f556619d9b 100644
--- a/app/Console/Commands/CheckData.php
+++ b/app/Console/Commands/CheckData.php
@@ -5,6 +5,7 @@ namespace App\Console\Commands;
use Carbon;
use App\Libraries\CurlUtils;
use DB;
+use App;
use Exception;
use Illuminate\Console\Command;
use Mail;
@@ -81,6 +82,7 @@ class CheckData extends Command
}
//$this->checkInvoices();
+ $this->checkTranslations();
$this->checkInvoiceBalances();
$this->checkClientBalances();
$this->checkContacts();
@@ -115,6 +117,44 @@ class CheckData extends Command
$this->log .= $str . "\n";
}
+ private function checkTranslations()
+ {
+ $invalid = 0;
+
+ foreach (cache('languages') as $language) {
+ App::setLocale($language->locale);
+ foreach (trans('texts') as $text) {
+ if ($language->locale != 'en') {
+ continue;
+ }
+
+ if (strpos($text, '=') !== false) {
+ $invalid++;
+ $this->logMessage($language->locale . ' is invalid: ' . $text);
+ }
+
+ preg_match('/(.script)/', strtolower($text), $matches);
+ if (count($matches)) {
+ foreach ($matches as $match) {
+ if (in_array($match, ['escript', 'bscript', 'nscript'])) {
+ continue;
+ }
+ $invalid++;
+ $this->logMessage($language->locale . ' is invalid: ' . $text);
+ break;
+ }
+ }
+ }
+ }
+
+ if ($invalid > 0) {
+ $this->isValid = false;
+ }
+
+ App::setLocale('en');
+ $this->logMessage($invalid . ' invalid languages');
+ }
+
private function checkDraftSentInvoices()
{
$invoices = Invoice::whereInvoiceStatusId(INVOICE_STATUS_SENT)
diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php
index 01594fa5a89b..690c6086c72e 100644
--- a/app/Http/Controllers/InvoiceController.php
+++ b/app/Http/Controllers/InvoiceController.php
@@ -403,7 +403,11 @@ class InvoiceController extends BaseController
}
if (! Auth::user()->confirmed) {
- $errorMessage = trans(Auth::user()->registered ? 'texts.confirmation_required' : 'texts.registration_required');
+ if (Auth::user()->registered) {
+ $errorMessage = trans('texts.confirmation_required', ['link' => link_to('/resend_confirmation', trans('texts.click_here'))]);
+ } else {
+ $errorMessage = trans('texts.registration_required');
+ }
Session::flash('error', $errorMessage);
return Redirect::to('invoices/'.$invoice->public_id.'/edit');
diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php
index f4f5ac3a29af..384bd48a9186 100644
--- a/app/Http/Controllers/UserController.php
+++ b/app/Http/Controllers/UserController.php
@@ -118,7 +118,7 @@ class UserController extends BaseController
}
if (! Auth::user()->confirmed) {
- Session::flash('error', trans('texts.confirmation_required'));
+ Session::flash('error', trans('texts.confirmation_required', ['link' => link_to('/resend_confirmation', trans('texts.click_here'))]));
return Redirect::to('settings/' . ACCOUNT_USER_MANAGEMENT);
}
diff --git a/app/Http/Middleware/StartupCheck.php b/app/Http/Middleware/StartupCheck.php
index 6f96aee3ba3c..71d3d971381c 100644
--- a/app/Http/Middleware/StartupCheck.php
+++ b/app/Http/Middleware/StartupCheck.php
@@ -218,7 +218,7 @@ class StartupCheck
// Show message to IE 8 and before users
if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/(?i)msie [2-8]/', $_SERVER['HTTP_USER_AGENT'])) {
- Session::flash('error', trans('texts.old_browser', ['link' => OUTDATE_BROWSER_URL]));
+ Session::flash('error', trans('texts.old_browser', ['link' => link_to(OUTDATE_BROWSER_URL, trans('texts.newer_browser'), ['target' => '_blank'])]));
}
$response = $next($request);
diff --git a/app/Listeners/HandleUserLoggedIn.php b/app/Listeners/HandleUserLoggedIn.php
index 9eee5232041c..3fd5380f4e04 100644
--- a/app/Listeners/HandleUserLoggedIn.php
+++ b/app/Listeners/HandleUserLoggedIn.php
@@ -102,7 +102,7 @@ class HandleUserLoggedIn
if (in_array(config('app.key'), ['SomeRandomString', 'SomeRandomStringSomeRandomString', 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'])) {
Session::flash('error', trans('texts.error_app_key_set_to_default'));
} elseif (in_array($appCipher, ['MCRYPT_RIJNDAEL_256', 'MCRYPT_RIJNDAEL_128'])) {
- Session::flash('error', trans('texts.mcrypt_warning'));
+ Session::flash('error', trans('texts.mcrypt_warning', ['command' => 'php artisan ninja:update-key --legacy=true
']));
}
}
}
diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php
index 8123734fc845..9edb0c841e8b 100644
--- a/resources/lang/en/texts.php
+++ b/resources/lang/en/texts.php
@@ -99,9 +99,9 @@ $LANG = array(
Use :MONTH, :QUARTER or :YEAR for dynamic dates. Basic math works as well, for example :MONTH-1.
Examples of dynamic invoice variables:
We use pdfmake to define the invoice designs declaratively. The pdfmake playground provides a great way to see the library in action.
-If you need help figuring something out post a question to our support forum with the design you\'re using.
', + 'customize_help' => 'We use :pdfmake_link to define the invoice designs declaratively. The pdfmake :playground_link provides a great way to see the library in action.
+If you need help figuring something out post a question to our :forum_link with the design you\'re using.
', + 'playground' => 'playground', + 'support_forum' => 'support forum', 'invoice_due_date' => 'Due Date', 'quote_due_date' => 'Valid Until', 'valid_until' => 'Valid Until', @@ -1009,9 +1011,11 @@ $LANG = array( 'reset_password_footer' => 'If you did not request this password reset please email our support: :email', 'limit_users' => 'Sorry, this will exceed the limit of :limit users', 'more_designs_self_host_header' => 'Get 6 more invoice designs for just $:price', - 'old_browser' => 'Please use a newer browser', + 'old_browser' => 'Please use a :link', + 'newer_browser' => 'newer browser', 'white_label_custom_css' => ':link for $:price to enable custom styling and help support our project.', - 'bank_accounts_help' => 'Connect a bank account to automatically import expenses and create vendors. Supports American Express and 400+ US banks.', + 'bank_accounts_help' => 'Connect a bank account to automatically import expenses and create vendors. Supports American Express and :link.', + 'us_banks' => '400+ US banks', 'pro_plan_remove_logo' => ':link to remove the Invoice Ninja logo by joining the Pro Plan', 'pro_plan_remove_logo_link' => 'Click here', @@ -1825,7 +1829,7 @@ $LANG = array( 'bot_emailed_notify_paid' => 'I\'ll email you when it\'s paid.', 'add_product_to_invoice' => 'Add 1 :product', 'not_authorized' => 'You are not authorized', - 'bot_get_email' => 'Hi! (wave)php artisan ninja:update-key --legacy=true
to update your cipher.',
+ 'mcrypt_warning' => 'Warning: Mcrypt is deprecated, run :command to update your cipher.',
'edit_times' => 'Edit Times',
'inclusive_taxes_help' => 'Include taxes in the cost',
'inclusive_taxes_notice' => 'This setting can not be changed once an invoice has been created.',
diff --git a/resources/views/accounts/bank_account.blade.php b/resources/views/accounts/bank_account.blade.php
index 614dcfa4dc35..e85af8e1af3c 100644
--- a/resources/views/accounts/bank_account.blade.php
+++ b/resources/views/accounts/bank_account.blade.php
@@ -39,7 +39,7 @@
->data_bind('combobox: bank_id')
->addOption('', '')
->fromQuery($banks, 'name', 'id')
- ->blockHelp(trans('texts.bank_accounts_help', ['link' => OFX_HOME_URL])) !!}
+ ->blockHelp(trans('texts.bank_accounts_help', ['link' => link_to(OFX_HOME_URL, trans('texts.us_banks'), ['target' => '_blank'])])) !!}
@endif