Didn't really know how to explain this. Essentially, I have a directory stucture:
src/
modules/
clients/
i18n/
en-US.ts
tasks/
i18n/
en-US.ts
Now each of those .ts files looks the same:
export default {
"Key1": "The value",
"Key2": "The value 2",
}
But the files will of course have different key names and values.
Now, I need to precompile all of these files into a single index.ts that looks like this:
messages: {
'en-US': {
"Key1": "....",
....
}
}
At the moment, what I have is really crap. I basically have these language files as "txt" files with the "contents" of the object
'Key1': 'Some test',
and I build the index.ts file by first writing all the code up to the ": {" where the messages need to go, then I read those txt files and input their contents in, and then finally I close up the object.
Really, I want to be able to actually read the export of these actual ts files and concat the value into a variable which I later write into the index.ts file..
Is this possible?