mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 02:45:58 +00:00
Replaced some language calls.
This commit is contained in:
@@ -2,6 +2,7 @@ APP_ENV=production
|
|||||||
APP_DEBUG=false
|
APP_DEBUG=false
|
||||||
APP_KEY=SomeRandomStringOf32CharsExactly
|
APP_KEY=SomeRandomStringOf32CharsExactly
|
||||||
|
|
||||||
|
|
||||||
DB_CONNECTION=mysql
|
DB_CONNECTION=mysql
|
||||||
DB_HOST=localhost
|
DB_HOST=localhost
|
||||||
DB_DATABASE=homestead
|
DB_DATABASE=homestead
|
||||||
@@ -20,6 +21,8 @@ EMAIL_USERNAME=
|
|||||||
EMAIL_PASSWORD=
|
EMAIL_PASSWORD=
|
||||||
EMAIL_PRETEND=false
|
EMAIL_PRETEND=false
|
||||||
|
|
||||||
|
SHOW_INCOMPLETE_TRANSLATIONS=false
|
||||||
|
|
||||||
ANALYTICS_ID=
|
ANALYTICS_ID=
|
||||||
RUNCLEANUP=true
|
RUNCLEANUP=true
|
||||||
SITE_OWNER=mail@example.com
|
SITE_OWNER=mail@example.com
|
||||||
|
@@ -105,8 +105,7 @@ class ChartJsAccountChartGenerator implements AccountChartGenerator
|
|||||||
public function frontpage(Collection $accounts, Carbon $start, Carbon $end)
|
public function frontpage(Collection $accounts, Carbon $start, Carbon $end)
|
||||||
{
|
{
|
||||||
// language:
|
// language:
|
||||||
$language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;
|
$format = trans('config.month_and_day');
|
||||||
$format = Config::get('firefly.monthAndDay.' . $language);
|
|
||||||
$data = [
|
$data = [
|
||||||
'count' => 0,
|
'count' => 0,
|
||||||
'labels' => [],
|
'labels' => [],
|
||||||
@@ -151,8 +150,7 @@ class ChartJsAccountChartGenerator implements AccountChartGenerator
|
|||||||
public function single(Account $account, Carbon $start, Carbon $end)
|
public function single(Account $account, Carbon $start, Carbon $end)
|
||||||
{
|
{
|
||||||
// language:
|
// language:
|
||||||
$language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;
|
$format = trans('config.month_and_day');
|
||||||
$format = Config::get('firefly.monthAndDay.' . $language);
|
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'count' => 1,
|
'count' => 1,
|
||||||
|
@@ -71,8 +71,7 @@ class ChartJsBillChartGenerator implements BillChartGenerator
|
|||||||
public function single(Bill $bill, Collection $entries)
|
public function single(Bill $bill, Collection $entries)
|
||||||
{
|
{
|
||||||
// language:
|
// language:
|
||||||
$language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;
|
$format = trans('config.month');
|
||||||
$format = Config::get('firefly.month.' . $language);
|
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'count' => 3,
|
'count' => 3,
|
||||||
|
@@ -24,7 +24,7 @@ class ChartJsBudgetChartGenerator implements BudgetChartGenerator
|
|||||||
public function budget(Collection $entries, $dateFormat = 'month')
|
public function budget(Collection $entries, $dateFormat = 'month')
|
||||||
{
|
{
|
||||||
// language:
|
// language:
|
||||||
$language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;
|
$language = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'))->data;
|
||||||
$format = Config::get('firefly.' . $dateFormat . '.' . $language);
|
$format = Config::get('firefly.' . $dateFormat . '.' . $language);
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
@@ -33,7 +33,7 @@ class ChartJsBudgetChartGenerator implements BudgetChartGenerator
|
|||||||
[
|
[
|
||||||
'label' => 'Amount',
|
'label' => 'Amount',
|
||||||
'data' => [],
|
'data' => [],
|
||||||
]
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -115,8 +115,7 @@ class ChartJsBudgetChartGenerator implements BudgetChartGenerator
|
|||||||
public function year(Collection $budgets, Collection $entries)
|
public function year(Collection $budgets, Collection $entries)
|
||||||
{
|
{
|
||||||
// language:
|
// language:
|
||||||
$language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;
|
$format = trans('config.month');
|
||||||
$format = Config::get('firefly.month.' . $language);
|
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'labels' => [],
|
'labels' => [],
|
||||||
|
@@ -101,8 +101,7 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator
|
|||||||
{
|
{
|
||||||
|
|
||||||
// language:
|
// language:
|
||||||
$language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;
|
$format = trans('config.month');
|
||||||
$format = Config::get('firefly.month.' . $language);
|
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'count' => 0,
|
'count' => 0,
|
||||||
@@ -135,8 +134,7 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator
|
|||||||
{
|
{
|
||||||
|
|
||||||
// language:
|
// language:
|
||||||
$language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;
|
$format = trans('config.month');
|
||||||
$format = Config::get('firefly.month.' . $language);
|
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'count' => 0,
|
'count' => 0,
|
||||||
|
@@ -25,8 +25,7 @@ class ChartJsPiggyBankChartGenerator implements PiggyBankChartGenerator
|
|||||||
{
|
{
|
||||||
|
|
||||||
// language:
|
// language:
|
||||||
$language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;
|
$format = trans('config.month_and_day');
|
||||||
$format = Config::get('firefly.monthAndDay.' . $language);
|
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'count' => 1,
|
'count' => 1,
|
||||||
|
@@ -22,8 +22,7 @@ class ChartJsReportChartGenerator implements ReportChartGenerator
|
|||||||
public function yearInOut(Collection $entries)
|
public function yearInOut(Collection $entries)
|
||||||
{
|
{
|
||||||
// language:
|
// language:
|
||||||
$language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;
|
$format = trans('config.month');
|
||||||
$format = Config::get('firefly.month.' . $language);
|
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'count' => 2,
|
'count' => 2,
|
||||||
|
@@ -36,8 +36,8 @@ abstract class Controller extends BaseController
|
|||||||
if (Auth::check()) {
|
if (Auth::check()) {
|
||||||
$pref = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'));
|
$pref = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'));
|
||||||
$lang = $pref->data;
|
$lang = $pref->data;
|
||||||
$this->monthFormat = Config::get('firefly.month.' . $lang);
|
$this->monthFormat = trans('config.month');
|
||||||
$this->monthAndDayFormat = Config::get('firefly.monthAndDay.' . $lang);
|
$this->monthAndDayFormat = trans('config.month_and_day');
|
||||||
|
|
||||||
View::share('monthFormat', $this->monthFormat);
|
View::share('monthFormat', $this->monthFormat);
|
||||||
View::share('monthAndDayFormat', $this->monthAndDayFormat);
|
View::share('monthAndDayFormat', $this->monthAndDayFormat);
|
||||||
|
@@ -37,10 +37,12 @@ class PreferencesController extends Controller
|
|||||||
$viewRange = $viewRangePref->data;
|
$viewRange = $viewRangePref->data;
|
||||||
$frontPageAccounts = Preferences::get('frontPageAccounts', []);
|
$frontPageAccounts = Preferences::get('frontPageAccounts', []);
|
||||||
$budgetMax = Preferences::get('budgetMaximum', 1000);
|
$budgetMax = Preferences::get('budgetMaximum', 1000);
|
||||||
$language = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;
|
$language = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'))->data;
|
||||||
$budgetMaximum = $budgetMax->data;
|
$budgetMaximum = $budgetMax->data;
|
||||||
|
|
||||||
return view('preferences.index', compact('budgetMaximum', 'language', 'accounts', 'frontPageAccounts', 'viewRange'));
|
$showIncomplete = env('SHOW_INCOMPLETE_TRANSLATIONS', 'false') == 'true';
|
||||||
|
|
||||||
|
return view('preferences.index', compact('budgetMaximum', 'language', 'accounts', 'frontPageAccounts', 'viewRange', 'showIncomplete'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -70,7 +72,7 @@ class PreferencesController extends Controller
|
|||||||
|
|
||||||
// language:
|
// language:
|
||||||
$lang = Input::get('language');
|
$lang = Input::get('language');
|
||||||
if (in_array($lang, array_keys(Config::get('firefly.lang')))) {
|
if (in_array($lang, array_keys(Config::get('firefly.languages')))) {
|
||||||
Preferences::set('language', $lang);
|
Preferences::set('language', $lang);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -64,9 +64,11 @@ class Authenticate
|
|||||||
$pref = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'));
|
$pref = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'));
|
||||||
App::setLocale($pref->data);
|
App::setLocale($pref->data);
|
||||||
Carbon::setLocale(substr($pref->data,0,2));
|
Carbon::setLocale(substr($pref->data,0,2));
|
||||||
|
$locale = explode(',', trans('config.locale'));
|
||||||
|
$locale = array_map('trim', $locale);
|
||||||
|
|
||||||
setlocale(LC_TIME, Config::get('firefly.locales.' . $pref->data));
|
setlocale(LC_TIME, $locale);
|
||||||
setlocale(LC_MONETARY, Config::get('firefly.locales.' . $pref->data));
|
setlocale(LC_MONETARY, $locale);
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
|
@@ -354,8 +354,7 @@ Breadcrumbs::register(
|
|||||||
'reports.report', function (Generator $breadcrumbs, Carbon $start, Carbon $end, $reportType, $accountIds) {
|
'reports.report', function (Generator $breadcrumbs, Carbon $start, Carbon $end, $reportType, $accountIds) {
|
||||||
$breadcrumbs->parent('reports.index');
|
$breadcrumbs->parent('reports.index');
|
||||||
|
|
||||||
$pref = Preferences::get('language', env('DEFAULT_LANGUAGE','en_US'))->data;
|
$monthFormat = trans('config.month_and_day');
|
||||||
$monthFormat = Config::get('firefly.monthAndDay.' . $pref);
|
|
||||||
$title = trans('firefly.report_default', ['start' => $start->formatLocalized($monthFormat), 'end' => $end->formatLocalized($monthFormat)]);
|
$title = trans('firefly.report_default', ['start' => $start->formatLocalized($monthFormat), 'end' => $end->formatLocalized($monthFormat)]);
|
||||||
|
|
||||||
$breadcrumbs->push($title, route('reports.report', ['url' => 'abcde']));
|
$breadcrumbs->push($title, route('reports.report', ['url' => 'abcde']));
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
// general stuff:
|
// general stuff:
|
||||||
|
'language_incomplete' => 'This language is not yet fully translated',
|
||||||
'test' => 'You have selected English.',
|
'test' => 'You have selected English.',
|
||||||
'close' => 'Close',
|
'close' => 'Close',
|
||||||
'pleaseHold' => 'Please hold...',
|
'pleaseHold' => 'Please hold...',
|
||||||
|
@@ -21,9 +21,11 @@
|
|||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label>
|
<label>
|
||||||
{% if account.id in frontPageAccounts.data or frontPageAccounts.data|length == 0 %}
|
{% if account.id in frontPageAccounts.data or frontPageAccounts.data|length == 0 %}
|
||||||
<input type="checkbox" name="frontPageAccounts[]" value="{{ account.id }}" checked> {{ account.name }}
|
<input type="checkbox" name="frontPageAccounts[]" value="{{ account.id }}"
|
||||||
|
checked> {{ account.name }}
|
||||||
{% else %}
|
{% else %}
|
||||||
<input type="checkbox" name="frontPageAccounts[]" value="{{ account.id }}"> {{ account.name }}
|
<input type="checkbox" name="frontPageAccounts[]"
|
||||||
|
value="{{ account.id }}"> {{ account.name }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
@@ -55,35 +57,40 @@
|
|||||||
|
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="viewRange" value="1D" {% if viewRange == '1D' %} checked {% endif %}>
|
<input type="radio" name="viewRange"
|
||||||
|
value="1D" {% if viewRange == '1D' %} checked {% endif %}>
|
||||||
{{ 'pref_1D'|_ }}
|
{{ 'pref_1D'|_ }}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="viewRange" value="1W" {% if viewRange == '1W' %} checked {% endif %}>
|
<input type="radio" name="viewRange"
|
||||||
|
value="1W" {% if viewRange == '1W' %} checked {% endif %}>
|
||||||
{{ 'pref_1W'|_ }}
|
{{ 'pref_1W'|_ }}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="viewRange" value="1M" {% if viewRange == '1M' %} checked {% endif %}>
|
<input type="radio" name="viewRange"
|
||||||
|
value="1M" {% if viewRange == '1M' %} checked {% endif %}>
|
||||||
{{ 'pref_1M'|_ }}
|
{{ 'pref_1M'|_ }}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="viewRange" value="3M" {% if viewRange == '3M' %} checked {% endif %}>
|
<input type="radio" name="viewRange"
|
||||||
|
value="3M" {% if viewRange == '3M' %} checked {% endif %}>
|
||||||
{{ 'pref_3M'|_ }}
|
{{ 'pref_3M'|_ }}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="viewRange" value="6M" {% if viewRange == '6M' %} checked {% endif %}>
|
<input type="radio" name="viewRange"
|
||||||
|
value="6M" {% if viewRange == '6M' %} checked {% endif %}>
|
||||||
{{ 'pref_6M'|_ }}
|
{{ 'pref_6M'|_ }}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
@@ -97,7 +104,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<p class="text-info">{{ 'pref_languages_help'|_ }}</p>
|
<p class="text-info">{{ 'pref_languages_help'|_ }}</p>
|
||||||
{% for key, lang in Config.get('firefly.lang') %}
|
{% for key, lang in Config.get('firefly.languages') %}
|
||||||
|
{% if lang.complete == true or (lang.complete == false and showIncomplete) %}
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="language" value="{{ key }}"
|
<input type="radio" name="language" value="{{ key }}"
|
||||||
@@ -105,9 +113,13 @@
|
|||||||
checked
|
checked
|
||||||
{% endif %}
|
{% endif %}
|
||||||
/>
|
/>
|
||||||
{{ lang }}
|
{{ lang.name_locale }} ({{ lang.name_english }})
|
||||||
|
{% if lang.complete == false %}
|
||||||
|
<span class="small text-danger">({{ 'language_incomplete'|_ }})</span>
|
||||||
|
{% endif %}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user