mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 21:44:51 +00:00
Complete dashboard translations & small UI improvements (#69)
* fix dropdown action Estimate Dashboard and fix translating full Dasboard page * Update app.php * fix locale in app.php config * Wizard install with translation, customer portal with translation, and fixing hardcoding strings to get translation * fixes asked to review * fixes pint --------- Co-authored-by: Max <contact@agencetwogether.fr> Co-authored-by: Darko Gjorgjijoski <5760249+gdarko@users.noreply.github.com>
This commit is contained in:
@@ -88,7 +88,7 @@ class CustomerStatsController extends Controller
|
||||
($receiptTotals[$i] - $expenseTotals[$i])
|
||||
);
|
||||
$i++;
|
||||
array_push($months, $start->format('M'));
|
||||
array_push($months, $start->translatedFormat('M'));
|
||||
$monthCounter++;
|
||||
$end->startOfMonth();
|
||||
$start->addMonth()->startOfMonth();
|
||||
|
||||
@@ -91,7 +91,7 @@ class DashboardController extends Controller
|
||||
($receipt_totals[$i] - $expense_totals[$i])
|
||||
);
|
||||
$i++;
|
||||
array_push($months, $start->format('M'));
|
||||
array_push($months, $start->translatedFormat('M'));
|
||||
$monthCounter++;
|
||||
$end->startOfMonth();
|
||||
$start->addMonth()->startOfMonth();
|
||||
|
||||
@@ -54,8 +54,8 @@ class CustomerSalesReportController extends Controller
|
||||
}
|
||||
|
||||
$dateFormat = CompanySetting::getSetting('carbon_date_format', $company->id);
|
||||
$from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->format($dateFormat);
|
||||
$to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->format($dateFormat);
|
||||
$from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->translatedFormat($dateFormat);
|
||||
$to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->translatedFormat($dateFormat);
|
||||
$currency = Currency::findOrFail(CompanySetting::getSetting('currency', $company->id));
|
||||
|
||||
$colors = [
|
||||
|
||||
@@ -41,8 +41,8 @@ class ExpensesReportController extends Controller
|
||||
}
|
||||
|
||||
$dateFormat = CompanySetting::getSetting('carbon_date_format', $company->id);
|
||||
$from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->format($dateFormat);
|
||||
$to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->format($dateFormat);
|
||||
$from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->translatedFormat($dateFormat);
|
||||
$to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->translatedFormat($dateFormat);
|
||||
$currency = Currency::findOrFail(CompanySetting::getSetting('currency', $company->id));
|
||||
|
||||
$colors = [
|
||||
|
||||
@@ -41,8 +41,8 @@ class ItemSalesReportController extends Controller
|
||||
}
|
||||
|
||||
$dateFormat = CompanySetting::getSetting('carbon_date_format', $company->id);
|
||||
$from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->format($dateFormat);
|
||||
$to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->format($dateFormat);
|
||||
$from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->translatedFormat($dateFormat);
|
||||
$to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->translatedFormat($dateFormat);
|
||||
$currency = Currency::findOrFail(CompanySetting::getSetting('currency', $company->id));
|
||||
|
||||
$colors = [
|
||||
|
||||
@@ -47,8 +47,8 @@ class ProfitLossReportController extends Controller
|
||||
}
|
||||
|
||||
$dateFormat = CompanySetting::getSetting('carbon_date_format', $company->id);
|
||||
$from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->format($dateFormat);
|
||||
$to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->format($dateFormat);
|
||||
$from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->translatedFormat($dateFormat);
|
||||
$to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->translatedFormat($dateFormat);
|
||||
$currency = Currency::findOrFail(CompanySetting::getSetting('currency', $company->id));
|
||||
|
||||
$colors = [
|
||||
|
||||
@@ -42,8 +42,8 @@ class TaxSummaryReportController extends Controller
|
||||
}
|
||||
|
||||
$dateFormat = CompanySetting::getSetting('carbon_date_format', $company->id);
|
||||
$from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->format($dateFormat);
|
||||
$to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->format($dateFormat);
|
||||
$from_date = Carbon::createFromFormat('Y-m-d', $request->from_date)->translatedFormat($dateFormat);
|
||||
$to_date = Carbon::createFromFormat('Y-m-d', $request->to_date)->translatedFormat($dateFormat);
|
||||
$currency = Currency::findOrFail(CompanySetting::getSetting('currency', $company->id));
|
||||
|
||||
$colors = [
|
||||
|
||||
@@ -34,6 +34,7 @@ class BootstrapController extends Controller
|
||||
'menu' => $menu,
|
||||
'current_customer_currency' => Currency::find($customer->currency_id),
|
||||
'modules' => Module::where('enabled', true)->pluck('name'),
|
||||
'current_company_language' => CompanySetting::getSetting('language', $customer->company_id),
|
||||
]]);
|
||||
}
|
||||
}
|
||||
|
||||
21
app/Http/Controllers/V1/Installation/LanguagesController.php
Executable file
21
app/Http/Controllers/V1/Installation/LanguagesController.php
Executable file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace InvoiceShelf\Http\Controllers\V1\Installation;
|
||||
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use InvoiceShelf\Http\Controllers\Controller;
|
||||
|
||||
class LanguagesController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display the languages page.
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function languages()
|
||||
{
|
||||
return response()->json([
|
||||
'languages' => config('invoiceshelf.languages'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -19,11 +19,13 @@ class OnboardingWizardController extends Controller
|
||||
if (! InstallUtils::dbMarkerExists()) {
|
||||
return response()->json([
|
||||
'profile_complete' => 0,
|
||||
'profile_language' => 'en',
|
||||
]);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'profile_complete' => Setting::getSetting('profile_complete'),
|
||||
'profile_language' => Setting::getSetting('profile_language'),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -43,4 +45,13 @@ class OnboardingWizardController extends Controller
|
||||
'profile_complete' => Setting::getSetting('profile_complete'),
|
||||
]);
|
||||
}
|
||||
|
||||
public function saveLanguage(Request $request)
|
||||
{
|
||||
Setting::setSetting('profile_language', $request->profile_language);
|
||||
|
||||
return response()->json([
|
||||
'profile_language' => Setting::getSetting('profile_language'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user