.php

Translate PHP lang arrays with AI

Import Laravel-style PHP language arrays, let AI translate them with your glossary and context, review every string and export ready-to-use lang files.

Used by Laravel, CakePHP and most PHP applications.

What a PHP arrays file actually holds

Laravel, CakePHP and a long tail of PHP applications keep their copy in files that simply return an array. It is a pleasant format to work with in code and an awkward one to hand to a translator: the file is executable PHP, so most translation tools either refuse it or mangle it.

Because the file is code, the risk is not just a bad translation — it is a parse error that takes the whole application down. An unescaped apostrophe in a French string is enough. This is the format where "translate the file and see what happens" is the most expensive.

.php

<?php

return [
    'welcome_title' => 'Welcome back!',
    'welcome_subtitle' => 'Log in to continue',
    'save' => 'Save changes',
];

What goes wrong when PHP arrays files are translated badly

These are the failures that reach production, because none of them look like errors until they do.

Apostrophes break single-quoted strings

French and Italian are full of apostrophes. Dropped into a single-quoted PHP string without escaping, the file stops parsing and the page returns a 500.

:placeholders lose their colon

Laravel resolves :name at runtime. A model that reformats it — or translates the word after the colon — produces a sentence with a literal ":name" in it for every user.

Nested groups get flattened

Language files are often grouped by feature, several levels deep. Flatten them on export and every __() call in the codebase has to be rewritten.

The file gets executed to be read

Tools that include() a language file to inspect it will run whatever is in it. That is fine for your own files and a serious problem for anything you did not write.

How GetTranslated handles it

Automatic format detection on upload: no configuration needed.
AI translations guided by your glossary, tone of voice and project context.
Every AI suggestion is marked for human review before it ships.
Export in the same format you imported, ready for your next release.
1

Import your PHP arrays file

2

AI translates with your glossary

3

Review and approve every string

4

Export and ship

Want to see it on your own file first?

Paste a PHP arrays file into the free tool and get the translated version back straight away — no account, no email address.

Open the free PHP arrays translator

Frequently asked questions

Is my PHP file executed when imported?

No. The file is read as text and tokenized, never included or evaluated. Importing a language file cannot run code.

Are quotes escaped correctly on export?

Yes. Apostrophes and backslashes are escaped for the quoting style used in the exported file, so the result always parses.

Do nested arrays keep their shape?

Yes. Groups are preserved with the same nesting and key names, so your existing translation calls keep working unchanged.

Start for free

500 keys free forever. No credit card.