Welcome Guest, Not a member yet? Register   Sign In
Make a normal translation for a site similar to Laravel
#1

A question for developers, you can implement the translation of the application in a similar manner as in Laravel so that you can call a simple function __ ('translation', parameter) from anywhere. Because it’s not very convenient to create arrays of translation, for example, how you implemented


PHP Code:
return [
   'commandNotFound' => 'Команда "{0}" не найдена.',
   'helpUsage'       => 'Использование:',
   'helpDescription' => 'Описание:',
   'helpOptions'     => 'Опции:',
   'helpArguments'   => 'Аргументы:',
   'invalidColor'    => 'Недопустимый {0} цвет: {1}.',
]; 



and do like this




PHP Code:
return [
    
'Uso:'          => 'Использование:',
    
'Descripción:'  => 'Описание:',
    
'Opciones:'     => 'Опции:',
    
'Argumentos:'   => 'Аргументы:',
    
'Inválido {0} color: {1}.'    => 'Недопустимый {0} цвет: {1}.',
]; 

and then call us like this __ ('Opciones:') anywhere
Reply


Messages In This Thread
Make a normal translation for a site similar to Laravel - by midav - 10-06-2019, 05:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB