Ask Claude to Extract Hardcoded Strings into Translation Files for i18n Support
Adding i18n support to an app that was built in one language is one of the most tedious tasks in software development. Every button label, error message, heading, and placeholder needs to move from the template into a translation file. Claude handles the entire process.
> scan all templates in resources/views/ and extract every hardcoded
> English string into lang/en.json — replace each string with the
> appropriate __() translation helper
Claude reads each template, identifies user-facing text (ignoring CSS classes, HTML attributes, and code), creates sensible translation keys, adds them to your translation file, and replaces the hardcoded strings with translation function calls.
A template like this:
<h1>Welcome back!</h1>
<p>You have 3 unread messages.</p>
<button>View Messages</button>
Becomes:
<h1>{{ __('dashboard.welcome_back') }}</h1>
<p>{{ __('dashboard.unread_messages', ['count' => 3]) }}</p>
<button>{{ __('dashboard.view_messages') }}</button>
With the translation file populated:
{
"dashboard.welcome_back": "Welcome back!",
"dashboard.unread_messages": "You have :count unread messages.",
"dashboard.view_messages": "View Messages"
}
You can target specific areas or tackle the whole app:
> extract strings from the checkout flow templates only
> find all hardcoded error messages in form validation and move
> them to the validation translation file
> scan the JavaScript files in resources/js/ for user-facing
> strings and set them up for i18n using react-intl
Claude handles framework-specific conventions — __() for Laravel, t() for React i18next, gettext() for Python, I18n.t() for Rails — matching whatever your project already uses or your framework expects.
Once the English strings are extracted, you can ask Claude to generate starter translations:
> create a lang/es.json file with Spanish translations for all
> the keys in lang/en.json
Extracting strings is the boring part of i18n — let Claude handle it so you can focus on the translations that actually matter.
via Claude Code
Log in to leave a comment.
Set up Claude Code as an automated reviewer in your CI pipeline — on every pull request, it reads the diff, checks for bugs, security issues, missing tests, and convention violations, then posts its findings as a PR comment. Your human reviewers get a head start because the obvious issues are already flagged before they look.
Before deploying, tell Claude to read your project — migrations, environment variables, queue workers, scheduled tasks, caching, third-party integrations — and generate a deployment checklist that's specific to your app. Not a generic "did you run migrations?" list, but one that knows YOUR infrastructure and catches the things YOUR deploy can break.
Instead of writing a README from memory or copying a template, tell Claude to read your project and generate one that's actually accurate — real setup instructions from your config, real architecture from your directory structure, real API examples from your routes, and real prerequisites from your dependency files.