Skip to main content
PHP Laravel language files (.php)
Nick Ustinov avatar
Written by Nick Ustinov
Updated over 3 months ago

PHP Laravel language files (.php) are essential for managing localization strings in Laravel applications. These files enable you to define translations for various text elements within your application, facilitating multi-language support.

Technical information

Overview

Format Name:
PHP Laravel Language Files

File Extensions:
.php

Common Use Cases:
Managing localization strings in Laravel applications to support multiple languages.

Technical Details:

  • Structure: Laravel language files are simple PHP files that return an array of key-value pairs. Each key represents a specific string to be translated, and the value is the corresponding translation.

  • Encoding: UTF-8

Example:
Here's an example of a typical Laravel language file:

<?php

return array(
    'welcome' => 'Lokalise',
    'nested' => array(
        'key' => 'value',
        'nested' => array(
            'key' => 'value',
            'key2' => 'value2',
        ),
    ),
);

In this example, the welcome key has a single translation, while the nested array demonstrates how you can organize translations hierarchically.

Using with Lokalise

Lokalise supports PHP i18n files for the Laravel framework, making it easy to manage your translations directly within the Lokalise platform. You can upload your Laravel language files to Lokalise, edit the translations, and download the updated files back into your project.

Supported project types

Please note that PHP files can be uploaded only to Web and mobile projects.

Additional reading

Did this answer your question?