All jobs

Add Translations to a SolidJS App With @solid-primitives/i18n

Yes. An agent adds a locale store, dictionaries and a language switcher to your SolidJS app, replaces every hardcoded string, and opens a pull request you can steer.

Run this on RushOpens the console with this prompt ready to send, in a Project that has your repository.

What the agent does

The agent clones the repository into its own cloud sandbox and reads how the app is built and where its text lives. In an app like solidjs/solid-realworld, package.json has solid-js ^1.3.3 and marked ^0.8.0 as dependencies, a Rollup 2 build (rollup -c --environment production) with @rollup/plugin-babel and babel-preset-solid, a start script that serves public on port 5000, and "test": "test", meaning no tests. package-lock.json pins solid-js at 1.3.3 and babel-preset-solid at 1.3.2. src/index.js renders <Provider><App /></Provider> into document.body; src/App.js is a hash router with match() cases for editor, settings, login, register, article, profile and home; src/store/index.js builds the store with appName: "conduit" and the jwt token from localStorage. public/index.html has <title>Conduit</title> and an <html> element with no lang attribute.

It inventories the strings before changing any: src/components/NavBar.js has Home, Sign in, Sign up, New Post and Settings; src/pages/Home/Home.js has A place to share your knowledge., Your Feed, Global Feed, Popular Tags and the Loading tags... fallback; src/pages/Settings.js has Your Settings and the placeholders URL of profile picture, Your Name and Short bio about you; src/pages/Auth.js, Editor, Article, Comments and Profile have theirs. src/components/ArticlePreview.js formats dates with new Date(createdAt).toDateString(), which is English regardless of locale. The agent lists every string with its file in its first message, so the team can say which stay (the conduit brand, tag names from the API) before it edits.

Then it adds @solid-primitives/i18n and writes src/i18n/en.js and one dictionary per language the team named, flat key paths grouped by page (nav.home, home.banner, settings.title, ...). Because the primitive's peer range needs a newer solid-js than the lockfile has, it raises solid-js and babel-preset-solid to a current 1.x and re-runs the build to confirm the hash router and lazy pages still work. A locale signal joins the store in src/store/index.js, read from localStorage with navigator.language as the first guess, and a t function from translator(flatten(dictionary)) is exposed through the existing useStore() so components need no new import. Every listed string becomes a t("...") call, dates use Intl.DateTimeFormat(locale), and an effect sets document.documentElement.lang. A <select> in NavBar.js switches the locale.

There is no test runner, so the agent adds scripts/check-i18n.mjs, which loads every dictionary and fails when a key is missing from one of them or a t("...") key in src/ is defined nowhere, and wires it as npm run check:i18n and as a step before npm run build in .github/workflows/gh-pages.yml. It runs npm install, the check and npm run build in the sandbox and pushes nothing until the build is clean.

Start it with one API call

POST https://api.phoenix.so/o/{org}/sessions with this body:

{
  "agent": "claude",
  "input": "Add internationalization to this SolidJS app with @solid-primitives/i18n. First list every hardcoded user-facing string with its file and wait for the team to confirm which strings should stay untranslated and which languages to add. Then add dictionaries, a locale signal persisted in localStorage and exposed through the existing store, a language switcher in the navigation bar, locale-aware date formatting, and set the html lang attribute. If the primitive needs a newer solid-js than the lockfile has, upgrade and prove the build still works. Add a script that fails when any dictionary is missing a key and run it in CI before the build. Open a pull request that lists each translated string and anything left in English on purpose.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
  1. Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
  2. Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
  3. Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

What comes back

What comes back is a pull request on its own branch that adds src/i18n/ with one file per language, scripts/check-i18n.mjs and changes to every component and page that showed text, src/store/index.js, src/components/NavBar.js, public/index.html, package.json, package-lock.json and .github/workflows/gh-pages.yml. The description has a table of each string, its key and each translation, a list of what stays untranslated and why, the version bump with the build output that followed it, and the check script's output.

The run's record keeps the string inventory the team answered, every follow-up message and every command with its output, so a reviewer can see which decisions were the team's and which were the agent's, and that the production build ran clean after the dependency bump.

Before merging, a reviewer loads the GitHub Pages preview or npm start and switches languages on each page, checks the translations with a native speaker, decides whether the locale should also follow the browser on each visit or stick once chosen, and confirms the solid-js bump is acceptable for the deploy workflow's Node version.

Run it on every new language request

The run is a conversation. Start it from the console in the Project that has the repository; the agent's first message is the string inventory, and a teammate answers with a follow-up (POST /o/{org}/sessions/{id}/messages) naming the languages and the strings to leave alone. When the turn ends the sandbox parks with its disk and memory, so a later follow-up that adds a third language or changes a translation continues in the same checkout and opens or updates the same pull request.

Once the structure exists, each new language is one more run with a shorter prompt: add a dictionary, translate every key, run the check and open a pull request. A webhook on the API key reports run.completed with the session_url to read the link.

The use case this job follows, with its automation and trigger: Steer a run as a team.

Why run it on Rush?

Internationalizing an existing app is half mechanical and half judgment: finding every string is tedious but checkable, deciding what stays in English and which languages matter is the team's call. The agent does the inventory and waits, then does the mechanical part across every file at once and proves nothing broke with a production build in its own sandbox, output kept.

The team steers without sitting next to it: a follow-up changes the plan, and the sandbox is the same one, with the same checkout and the same installed dependencies. Several apps or several languages can be done in parallel, each in its own sandbox, each with its own pull request.

Frequently asked questions

Will it translate the text for me?

It drafts each translation and marks them as drafts in the pull request table. The team confirms them or replaces them with a translator's wording in a follow-up, and the check script makes sure no key is left untranslated in any language.

Why did it upgrade solid-js?

Only when the i18n primitive's peer dependency range requires a newer version than the lockfile pins. The agent raises solid-js and the matching babel-preset-solid, runs the production build and says in the pull request what changed. If the lockfile already satisfies the range, nothing is upgraded.

What stays in English?

Whatever the team says in the first follow-up, typically the brand name and content that comes from the API such as tag names and article bodies. The pull request lists each item left untranslated with the reason, so the decision is visible.

Does it work without a test runner?

Yes. The repository has no tests, so the agent adds a small script that checks every dictionary has every key and every t() call has a definition, and runs it in CI before the build. If you later add Vitest, the same checks become a test file.

More SolidJS jobs

The same job on other stacks

Keep reading