Skip to main content
Version: Legacy

Contribution Guide

Contributions are welcome and will be fully credited.

We accept contributions through Pull Requests on all projects of our organization.

What do the files mean?​

  • php.json - contains translations of values for PHP localization files.
  • php-inline.json - contains inline translations of values for PHP localization files.
  • json.json - contains translations of values for JSON localization files.
  • json-inline.json - contains inline translations of values for JSON localization files.
  • _excludes.json - contains those values whose translation is the same as in English. Please note that this file contains a list of values, not keys.

How to change files?​

All files available for translation have a json extension and are located in the locales folder. Open the desired file and make changes.

tip

Even if you see an error in the key, do not change it, otherwise Laravel will not be able to read it.

All you can do is send a Pull Request to the appropriate product from the Laravel team to correct the spelling.

After this, our products will automatically update the keys. This happens automatically once a day.

  1. Open the localization file

  2. Change key values.

  3. Create a commit and push it

  4. Create a Pull Request specifying the locale code for which you are making changes. For example:

    tip

    [fr]: Added new localization

tip

Pay attention to files with the inline suffix - they should not contain references to the current attribute (:attribute).

The difference between inline translations is different in the form of address:

// It's a normal
The :attribute must contain at least one letter.

// It's a inline
This field must contain at least one letter.

How to add a new locale?​

For Laravel Lang projects​

As a rule, all our projects already contain available localizations, but if you want to suggest a new one, write to us about it.

For third-party projects​

tip

To add a locale that is not in laravel-lang/locale-list, write to us.

Make sure you have the laravel-lang/status-generator package installed and run the console command:

vendor/bin/lang create <locale>
# vendor/bin/lang create fr

If you want to install all the missing locales, then run the command without specifying the localization code:

vendor/bin/lang create

Code Style​

Laravel-Lang Team follows the PER coding standard and the PSR-4 autoloading standard.

To apply the formatting of the code style, follow the console command:

composer style

PR Title​

The PR title must correspond to the following format:

[locale]: Description

For example:

[fr]: Added new localization

The compliance of the title with the established format is checked by a regular expression:

/^(Draft:\s)?\[[a-zA-Z,_\s]+\]:\s.+$/

Code of Conduct​

The Laravel code of conduct is derived from the Contributor Covenant code of conduct. Any violations of the code of conduct may be reported to Andrey Helldar, Fred Delrieu:

  • Participants will be tolerant of opposing views.
  • Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
  • When interpreting the words and actions of others, participants should always assume good intentions.
  • Behavior that can be reasonably considered harassment will not be tolerated.