Prompt
translated strings are missing after deployment, how do I fix it
Latest observation
Nov 2, 2026
OpenAI APIWeb search: off
This usually means the app is loading the wrong locale data, the translation files weren’t bundled/deployed, or the build/runtime is looking in a path that doesn’t exist in production.
Quick checklist
1) Confirm the files are actually deployed
- Check that your translation JSON/YAML/etc. files exist in the production build artifact.
- If you use a CDN/object storage, make sure the locale files were uploaded there too.
- Verify case sensitivity:
en-US.jsonvsen-us.jsoncan work locally but fail on Linux.
2) Check the runtime path
A common cause is a path that works in dev but not after deployment.
- Relative paths may break under subpaths or reverse proxies.
- Ensure locale file URLs are correct in production.
- If your app is hosted under a subdirectory, make sure the i18n base path is configured.
3) Make sure the locale is loaded before rendering
If translations load asynchronously:
- the app may render before the locale files finish loading,
- or it may fall back to defaults if loading fails.
Fix by:
- delaying render until i18n initialization completes,
- or showing a loading state until translations are ready.
4) Check fallback behavior
If the requested language is missing, many libraries silently fall back to default language or keys.
- Verify the active locale code matches your translation file names exactly.
- Example:
pt-BRvspt_BRvspt.
5) Verify production build includes static assets
Depending on framework:
- React/Vite/Next/Webpack: translation files in
srcmay not be emitted unless imported or copied. - If you keep locale files in
public/, ensure they’re referenced correctly. - If they’re in
assets/, confirm the bundler copies them.
6) Inspect network errors in production
Open browser devtools and check:
- 404s for translation files
- CORS errors
- MIME/type errors
- caching issues serving old files
7) Clear cache / service worker issues
If you use:
- a service worker,
- CDN caching,
- aggressive browser caching,
you may be serving an older build without the new translations. Try:
- hard refresh,
- clear site data,
- purge CDN cache,
- bump asset version/hash.
8) Environment-specific config
Some translation paths or locales depend on env vars:
NODE_ENV- base public path
- locale config
- CDN URL
Make sure production env vars are set correctly.
Common fixes by framework
React / Vite
- Put translation files in
public/and fetch them from/locales/... - Or import them directly so they’re bundled
- Ensure
baseis configured if deployed under a subpath
Next.js
- Put static locale files in
public/ - If using
next-i18next/next-intl, verify server/client config matches - Check
basePath,assetPrefix, and locale routing settings
Angular
- Make sure assets are listed in
angular.json - Confirm
i18nor ngx-translate loader path is correct for production
Vue
- Ensure locale assets are included in the build
- Check public path / router base configuration
Fast way to debug
- Open production site.
- Check browser console/network tab for failed translation requests.
- Confirm locale file URL returns 200.
- Confirm the response contains the expected strings.
- Check the locale code being requested.
- Compare dev vs prod config for base path and asset path.
If you want, I can help more precisely
Tell me:
- your framework/library,
- how translations are stored,
- and what the production URL looks like,
and I can give you the exact fix.