Closed RushabhJoshi closed 5 years ago
There is a minor issue if you're using custom templates for the menu, if you use the @menu('main')
without a custom view then it works fine, but the links were not translated if you used the custom view. I've corrected that and will be pushing a solution shortly.
https://screenshots.firefox.com/TDXAR463tXy8WEjs/blog.laravel.local
I have removed the custom template and used @menu('main')
not it is not showing menu either
see the screen shot now about
menu item is missing
it is not even in page source
I don't know how you going to do this but there is a little correction in TranslationRepository
this is my code snippet
`public function findByEntityId($entityId, $entityType)
{
$item = $this->model->where('entity_type', $entityType)->where('entity_id', $entityId)->first();
if ($item && $entityType == 'Grafite\Cms\Models\Link') {
return $item->data;
}
if ($item && ($item->data->is_published == 1 || $item->data->is_published == 'on') && $item->data->published_at <= Carbon::now(config('app.timezone'))->format('Y-m-d H:i:s')) {
return $item->data;
}
return null;
}`
Though there is no published_at or is_published field in links we need to by pass this check
@RushabhJoshi
change the template to use
<li class="nav-item"><a class="nav-link" href="{{ url(''.$link->page->translation(config('app.locale'))->data->url) }}">{{ $link->translation(config('app.locale'))->data->name }}</a></li>
Describe the bug I have created one menu name Main(slug: main) In the menu, I have one link named about (fr translation "sur")
when I switch the language from English to French page content get translated but not menu link
To Reproduce Steps to reproduce the behavior:
Expected behavior It should show link title 'Sur' but it is still showing me 'About'
Screenshots https://screenshots.firefox.com/BhsL7a60fxzwdjuv/blog.laravel.local
Desktop (please complete the following information):
Additional context It does translate page content but not menu link