Interface Translations

Add a New Language to Remark42

Translation files are stored in the /backend/app/webassets/assets
directory, one <code>.json file per language, with content like the following. The server embeds them and serves them under /web/, and the widget fetches the one for its locale:

{
  "auth.back": "Back",
  "auth.email-address": "Email address",
  "auth.loading": "Loading...",
  <...>
}

en.json is different from the other files: the widget never loads it. The English text lives in
the widget's code, and node ./tasks/generateDictionary.js copies it into en.json, which serves as the
reference that every other file translates. To change an English message, change it in the code
and run the extraction and generation steps below; an edit made only in en.json
does not reach the page, and CI fails until the file and the code agree again.

Add a new translation

We truly appreciate people spending time contributing their translations to remark42. Please go through the steps
below to have your translation available to all remark42 users and included in the next release.

  1. Create a fork of umputun/remark42 repo, and if you already have one, please pull the latest changes from the upstream master branch. It could be done like that:

    git remote add upstream https://github.com/umputun/remark42.git
    git fetch upstream
    git rebase upstream/master
    git push
    
  2. Add the code of the language you want to translate into, normally its two-letter ISO 639-1 code, to the list in frontend/apps/remark42/tasks/supportedLocales.json

  3. Run node --disable-warning=MODULE_TYPELESS_PACKAGE_JSON ./tasks/extract-messages.ts in the frontend/apps/remark42 folder. It needs Node 26 or newer and no installed packages. It stops when a message in en.json is no longer in the code; if you removed that message on purpose, add --allow-removal

  4. Run node ./tasks/generateDictionary.js in the frontend/apps/remark42 folder

  5. Translate all values in the newly created JSON file in
    backend/app/webassets/assets/

  6. Run node --disable-warning=MODULE_TYPELESS_PACKAGE_JSON ./tasks/extract-messages.ts && node ./tasks/checkTranslation.js in frontend/apps/remark42 to validate the translation keys, tags and placeholders

  7. Update the documented locale list with the language name and code

  8. Commit all changes above in your fork

  9. Test your changes in the interface:

    1. Uncomment locale: "ru" line in backend/app/webassets/assets/index.html
      and replace ru with your translation language code. That single change is enough for
      both the translated text and, if you added the code to RTL_LOCALES above, the mirrored
      layout — the widget determines left-to-right or right-to-left automatically from the
      locale, so nothing else needs configuring to preview either.

    2. Start the backend from the root directory of your fork:

      docker compose -f compose-dev-frontend.yml up --build
      
    3. Start the frontend in another terminal:

      cd frontend/apps/remark42
      go -C ../../build run . -serve
      
    4. Open http://127.0.0.1:9000/web/, log in, make a comment, make a reply to a comment, and check your translation

    5. Take a screenshot of that page with your translation in place

  10. After all previous steps are done, create a Pull Request to umputun/remark42 repo with your changes, attaching a screenshot or two from your local test instance to it