tmserver(1)

πŸ’– tmserver(1) πŸ’–

okay bestie, so you know that tmserver(1) page? yeah, we're doing it, and we're doing it cute. it's the Translate Toolkit one. buckle up πŸŽ€


✨ NAME ✨

tmserver β€” a Translation Memory server, (yes the comma is canon, we respect the comma 🫢)


✨ SYNOPSIS ✨

tmserver --bind=HOSTNAME --port=PORT [--tmdb=TMDBFILE] [--import-
translation-file=TMFILE [--import-source-lang=SOURCE_LANG] [--import-
target-lang=TARGET_LANG]]

and here's the lore on those placeholder words, don't skip this part:

  • TMDBFILE is the sqlite database file containing tmdb translation memory data. if you don't specify it, a brand new temporary database just spawns into existence. no cap.
  • TMFILE is a translation file (po, xliff, etc.) that should be imported into the database. it's mostly useful when no tmdb file is specified β€” like, that's its moment ✨

✨ DESCRIPTION ✨

tmserver is a Translation Memory service, and the way you talk to it is... HTTP πŸ¦‹. you query it with a simple REST-like URL / http situation, and the server and client swap data back and forth encoded in JSON. it's giving very chill, very modern, very "let's just send some JSON about it" πŸ’…


✨ OPTIONS ✨

  • -h, --help β€” shows this help message and then dips (exit). iconic behaviour honestly πŸ‘‘
  • -d TMDBFILE, --tmdb=TMDBFILE β€” the translation memory database πŸ“š
  • -f TMFILES, --import-translation-file=TMFILE β€” translation file to import into the database πŸ“
  • -t TARGET_LANG, --import-target-lang=TARGET_LANG β€” target language of translation files 🌸
  • -s SOURCE_LANG, --import-source-lang=SOURCE_LANG β€” source language of translation files 🌈
  • -b BIND, --bind=HOSTNAME β€” address to bind server to 🏠
  • -p PORT, --port=PORT β€” port to listen on πŸšͺ

✨ EXAMPLE ✨

the easiest way to run the server for testing is to just hand it a big translation file β€” maybe one that was generated by pocompendium β€” and it'll create a tmdb database on the fly. so slay.

tmserver -b localhost -p 8080 -f compendium.po -s en_US -t ar

and the server can be queried using a webbrowser (yes, the browser, we're keeping it simple πŸ’–). the url would be:

http://HOST:PORT/tmserver/SOURCE_LANG/TARGET_LANG/unit/STRING

so to see suggestions for "open file" you'd hit this url:

http://localhost:8080/tmserver/en_US/ar/unit/open+file
note that open file became open+file in the url, because spaces in urls are a crime and the + is the fix 🫢

πŸ’œ and that's the whole page, bestie πŸ’œ

this one came from Translate Toolkit 1.3.0, and the manual page itself is tmserver(1). go forth and serve those translation memories, main character 🧚✨