How to translate user entered content from DB on no pages multi-lingual site?

I’m wondering what I need to do when developing a package in order to enable its use on multi-lingual sites without pages, i.e. where content is taken from a DB and displayed on a single page.

If the site had pages - no problem, pages are added for each language and then translated. But what about a site which displays data from a database on a single page depending on a route, e.g. /items/item/123? I can wrap my own defined string variables in t(), I can define DB columns which store a few words and have them translated. But what about rich text? Can this be solved anyhow?

I don’t understand how t() would help in this case if the content is in the database. Strings translated with t() are going to be interface strings that are in PHP files.

It sounds like you want to have a table of items and have translations for each item. If that’s the case, I would think you would need to have columns in the database for each language:

itemID en es jp
1 example ejemplo