Hello, I am writing DICTs now, and I have a question.Can you write me an example of your DICT file? For example: how can I name headlines for pages, menu item headings, and in general, other text on the site?

I imagine it this way:

<?Php

return[
    'menu_home'=>'Home',
    'menu_about'=>'About us',
    'menu_contacts'=>'Contacts',
    
    'content_what_the_fuck'=>'You love you!',
    'content_fuck_you'=>'We always welcome you :)',
    'content_shit'=>'Leave us a message!',
    
    'footer_contacts_info'=>'Contact details',
    'footer_copyright'=>'All rights reserved!'
];

etc.

How do you think prefixes should index(maybe I mistakenly call the wrong thing with my name, but forgive me Rasmus Lerdorf=D)


What are the standards for this?

Thank!

1 Answers 1

Look towards gettext, po-mo files.
See how dictionaries are made in the same laravel.There is the possibility of hierarchy, not a flat dictionary.Like:
return[
	'menu'=>[
		'home'=>'Home',
		'about'=>'About us',
		'contacts'=>'Contacts',
    ],
	'content'=>[
		'what_the_fuck'=>'You love you!',
		'fuck_you'=>'We always welcome you :)',
		'shit'=>'Leave us a message!',
    ],
	'footer'=>[
		'contacts'=>[
			'info'=>'Contact details',
		],
		'copyright'=>'All rights reserved!'
	]
];


Accordingly, apply:
echo __('menu.about');
echo __('footer.contacts.info');


But I gettetext more to my liking.