Welcome Guest, Not a member yet? Register   Sign In
Change the language dynamically?
#4

go  app/config/app.php 
chane like bellow 

PHP Code:
public $defaultLocale 'en';

    
/**
     * --------------------------------------------------------------------------
     * Negotiate Locale
     * --------------------------------------------------------------------------
     *
     * If true, the current Request object will automatically determine the
     * language to use based on the value of the Accept-Language header.
     *
     * If false, no automatic detection will be performed.
     *
     * @var boolean
     */
    
public $negotiateLocale true;

    
/**
     * --------------------------------------------------------------------------
     * Supported Locales
     * --------------------------------------------------------------------------
     *
     * If $negotiateLocale is true, this array lists the locales supported
     * by the application in descending order of priority. If no match is
     * found, the first locale will be used.
     *
     * @var string[]
     */
    
public $supportedLocales = ['en','fa']; 


for change  language  add header Accept-Language = En or ....
you can see i add header for angular code
 request.clone({headers: request.headers.set('Accept-Language',  'en')});
Enlightenment  Is  Freedom
Reply


Messages In This Thread
Change the language dynamically? - by goobydale - 04-22-2021, 12:15 PM
RE: Change the language dynamically? - by paliz - 04-23-2021, 09:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB