Components localization

I think the main problem is that we don’t have single page application this is multli-page Java app, that can contain some can.js pieces. Some component. So we don’t have Steal or something. And I can’t get all translations for the whole application at once, because its huge, with lots of functionality that can be disabled / enabled for different clients.
All translation props are in a database.

So I was thinking about creating some class like ‘translationManager’ that should scan new page and check if any can.js component presented. Maybe some special data-attribute with component key. After that it collects keys remove duplicates (if we have several instances of the same components) and send this to the server and in the response we can have JSON with key - value pairs.

The issue that I can see right now is what if some component appears dynamically and translationManager can’t “see” it on initial page load.

And another question even in this example that you mentioned above, how you “insert” correct translations into components ?