alexeymezenin / laravel-best-practices

Laravel best practices
11.25k stars 2.37k forks source link

What about translation variables? #129

Open WatheqAlshowaiter opened 2 years ago

WatheqAlshowaiter commented 2 years ago

What is the best practice for the translation variables?

for example __('some variable')

do we do it as snake_case or kebab-case or camelCase?

JanKrb commented 1 year ago

In the official docs, there is no best practise stated as I know. According to the official Laravel translation strings (in this example, the validation rules), Laravel is using snake_case.

Example: https://github.com/laravel/laravel/blob/9.x/lang/en/validation.php#L17

A best practise on that should be added to the docs I guess.

FranciscoCaldeira commented 6 months ago

https://github.com/alexeymezenin/laravel-best-practices?tab=readme-ov-file#use-config-and-language-files-constants-instead-of-text-in-the-code

recommended: snake_case