Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Laravel 8 correct aside menu translate


Hi.
I am trying to add an aside Menu translation in

global / menu.php
and
global / pages.php

For example, giving 'title' => trans ('mainMenu.dashboard'), I get an error

"Target class [translator] does not exist."

How to correctly translate the menu?
Thanks in advance for your help.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (2)


Are you ready to ace the Our comprehensive practice exam is designed to help you succeed. With over 200 high-quality questions and detailed explanations, you'll gain a thorough understanding of key security concepts and improve your test-taking skills. Each question mirrors the format and difficulty of the actual exam, ensuring you're fully prepared. Plus, our practice exam includes performance tracking to pinpoint your strengths and weaknesses. Boost your confidence and increase your chances of passing with ease. Don't leave your success to chance—practice with the best and achieve your cybersecurity certification goals!



Hi,

You can use the locale id in the title without trans() function. The text will be read from locale folder and file.


"title" => "mainMenu.dashboard"


Thanks


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(