---
title: "Edit Laravel translation files"
description: "How to use BabelEdit with Laravel for translating your applications using PHP files or JSON files."
canonical: "https://www.codeandweb.com/babeledit/documentation/frameworks/laravel"
product: "babeledit"
source: "html"
---

# Laravel

In Laravel you have 2 choices:

*   [PHP files](#laravel-php) for the translations
*   [JSON files](#laravel-json) for the translations

A complete tutorial including a small demo project is available here: [How to translate your Laravel project](https://www.codeandweb.com/babeledit/tutorials/how-to-translate-your-laravel-project.md)

## JSON files

You can use all JSON formats for Laravel:

*   [JSON with nested namespaces (Namespaced JSON)](https://www.codeandweb.com/babeledit/documentation/frameworks/json.md#namespaced-json)
*   [JSON with namespaces in key (Flat JSON)](https://www.codeandweb.com/babeledit/documentation/frameworks/json.md#flat-json)
*   [JSON with plaintext keys](https://www.codeandweb.com/babeledit/documentation/frameworks/json.md#plaintext-json) - not recommended

## PHP files

BabelEdit can read PHP files that simply return an array.

The PHP parser in BabelEdit is restricted and does not perform calculations, nor does it support variables. BabelEdit does not maintain comments, or the file structure of the original php file.

BabelEdit's php parsing engine is limited to a return statement with a nested array structure. Variables, string concatenation and other constructs are not permitted.

Comments are ignored and not written back into the .php file on save.

```php
<?php

return [
    "menu" => [
        "documentation" => "Documentation",
        "news" => "News"],
    "title" => "Translation demo"
];
```

## In this section

- [Installation](https://www.codeandweb.com/babeledit/documentation.md)
- [Framework selection](https://www.codeandweb.com/babeledit/documentation/framework-selection.md)
- [Main screen](https://www.codeandweb.com/babeledit/documentation/main-screen.md)
- [Project configuration](https://www.codeandweb.com/babeledit/documentation/project-configuration.md)
- [Configure languages](https://www.codeandweb.com/babeledit/documentation/configure-languages.md)
- [Adding translations](https://www.codeandweb.com/babeledit/documentation/adding-translations.md)
- [Search & filters](https://www.codeandweb.com/babeledit/documentation/search-and-filters.md)
- [Editing tools](https://www.codeandweb.com/babeledit/documentation/editing-tools.md)
- [Import & export](https://www.codeandweb.com/babeledit/documentation/import-export.md)
- [.NET (.resx)](https://www.codeandweb.com/babeledit/documentation/frameworks/dotnet.md)
- [Angular](https://www.codeandweb.com/babeledit/documentation/frameworks/angular.md)
- [Ember.js](https://www.codeandweb.com/babeledit/documentation/frameworks/ember-js.md)
- [Flutter (.arb)](https://www.codeandweb.com/babeledit/documentation/frameworks/flutter.md)
- [Gettext (.po, .pot)](https://www.codeandweb.com/babeledit/documentation/frameworks/po-files.md)
- [i18next (json)](https://www.codeandweb.com/babeledit/documentation/frameworks/i18next.md)
- [Java](https://www.codeandweb.com/babeledit/documentation/frameworks/java.md)
- [JSON](https://www.codeandweb.com/babeledit/documentation/frameworks/json.md)
- [React](https://www.codeandweb.com/babeledit/documentation/frameworks/react.md)
- [Ruby On Rails](https://www.codeandweb.com/babeledit/documentation/frameworks/ruby-on-rails.md)
- [Svelte](https://www.codeandweb.com/babeledit/documentation/frameworks/svelte.md)
- [Vue.js](https://www.codeandweb.com/babeledit/documentation/frameworks/vue-js.md)
- [YAML](https://www.codeandweb.com/babeledit/documentation/frameworks/yaml.md)
- [Overview](https://www.codeandweb.com/babeledit/documentation/features.md)
- [Machine Translation](https://www.codeandweb.com/babeledit/documentation/machine-translation.md)
- [ConsistencyAI](https://www.codeandweb.com/babeledit/documentation/consistency-ai.md)
- [Spell Checker](https://www.codeandweb.com/babeledit/documentation/spellchecker.md)
- [Similar Phrases](https://www.codeandweb.com/babeledit/documentation/translation-memory.md)
