codezero-be / laravel-localized-routes

⭐️ A convenient way to set up and use localized routes in a Laravel app.
MIT License
505 stars 46 forks source link

Attempt to translate full uri + link fixed in README #50

Closed kedniko closed 2 years ago

kedniko commented 2 years ago

Example

web.php Route::get(Lang::uri('products/glass'), fn() => view(....)->name(....);

lang/it/routes.php

return [
    'glass'          => 'vetro',
    'products'       => 'prodotti',
    'products/glass' => 'prodotti/bicchiere'
];

❌ Current result: 'prodotti/vetro' ✅ Expected result: 'prodotti/bicchiere'

This change allows me to define a translation for a specific route

ivanvermeyen commented 2 years ago

Excellent! I'll remember to add a test for this tomorrow. Thanks!