mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 07:50:24 +08:00
Translate basic HTML views
app('view') call to set translator is temporary. See #189
This commit is contained in:
parent
882133ca55
commit
69f8acd0e0
@ -164,6 +164,8 @@ abstract class AbstractClientController extends AbstractHtmlController
|
||||
$localeCompiler->setTranslations($translations);
|
||||
}
|
||||
|
||||
app('view')->share('translator', $this->locales->getTranslator());
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
|
@ -2,9 +2,9 @@
|
||||
<div class="Alert">
|
||||
<div class="container">
|
||||
@if ($noJs)
|
||||
Something went wrong while trying to load the full version of this site.
|
||||
{{ $translator->trans('core.basic.load_error_message') }}
|
||||
@else
|
||||
This site is best viewed in a modern browser with JavaScript enabled.
|
||||
{{ $translator->trans('core.basic.javascript_disabled_message') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
@ -9,7 +9,7 @@ $postsCount = count($discussion->relationships->posts->data);
|
||||
@foreach ($posts as $post)
|
||||
<div>
|
||||
<?php $user = $getResource($post->relationships->user->data); ?>
|
||||
<h3>{{ $user ? $user->attributes->username : '[deleted]' }}</h3>
|
||||
<h3>{{ $user ? $user->attributes->username : $translator->trans('core.lib.deleted_user_text') }}</h3>
|
||||
<div class="Post-body">
|
||||
{!! $post->attributes->contentHtml !!}
|
||||
</div>
|
||||
@ -20,10 +20,10 @@ $postsCount = count($discussion->relationships->posts->data);
|
||||
</div>
|
||||
|
||||
@if ($page > 1)
|
||||
<a href="{{ $url(['page' => $page - 1]) }}">« Previous Page</a>
|
||||
<a href="{{ $url(['page' => $page - 1]) }}">« {{ $translator->trans('core.basic.previous_page_button') }}</a>
|
||||
@endif
|
||||
|
||||
@if ($page < $postsCount / 20)
|
||||
<a href="{{ $url(['page' => $page + 1]) }}">Next Page »</a>
|
||||
<a href="{{ $url(['page' => $page + 1]) }}">{{ $translator->trans('core.basic.next_page_button') }} »</a>
|
||||
@endif
|
||||
</div>
|
||||
|
@ -2,7 +2,7 @@
|
||||
$url = app('Flarum\Forum\UrlGenerator');
|
||||
?>
|
||||
<div class="container">
|
||||
<h2>All Discussions</h2>
|
||||
<h2>{{ $translator->trans('core.ref.all_discussions') }}</h2>
|
||||
|
||||
<ul>
|
||||
@foreach ($document->data as $discussion)
|
||||
@ -16,5 +16,5 @@ $url = app('Flarum\Forum\UrlGenerator');
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<a href="{{ $url->toRoute('index') }}?page={{ $page + 1 }}">Next Page »</a>
|
||||
<a href="{{ $url->toRoute('index') }}?page={{ $page + 1 }}">{{ $translator->trans('core.basic.next_page_button') }} »</a>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user