Translations through code/in a datapack

Hello! I'm a complete beginner to datapacks, and I'm wondering if I can use code to generate translations, and they would be able to update at runtime. Is this possible, and if so, how? edit: I want to dynamically update the translations for items, depending on what other items are in the inventory. I know enough programming to be able to do this outside a datapack, the only problem is that I haven't used datapacks
Continue to help post