FbF / Laravel-Navigation

A Laravel 4 package for adding multiple, database driven, menus to a site
MIT License
14 stars 6 forks source link

How to go about translations? #6

Open armababy opened 10 years ago

armababy commented 10 years ago

Hello,

Just included it into my next start up and was wondering how to go about the translations for menu items? Particularity with title field that's inside sources of navigation package.

I decided to go with this package for translations: https://github.com/dimsav/laravel-translatable

What would you suggest? Tinker with the current code or some other aproach? The translation package works with traits and double table/model setup.

neilcrookes commented 10 years ago

Sorry for not replying sooner - I hadn't had chance to think about this. Did you solve it in the end? If so how?

thylo commented 10 years ago

I'm also interested by the @armababy solution.

From what I found so far, Fbf\LaravelNavigation\NavigationComposer should include a config parameter to specify wich part of the URL should be used in Fbf\LaravelNavigation\NavigationComposer::getNodeForCurrentRoute()

In the case of http://example.com/fr/foo/bar only foo/bar should be used to find a matching menu uri