Replies: 1 comment 1 reply
-
Hey @pelikhan! Yes, there's a way. It's a bit of a workaround since I haven't thought about a use case like this before, so I'll keep it in mind to think of a better way people can do this in Lunaria v1 — probably through part of the WIP integration system, allowing to pull content from other sources. To be completely honest, I am in my senior year in college, so I haven't been able to work on it recently, and it might take a while before I have a better alternative developed and ready for production. In the meantime, you can use the I am making some assumptions/guesses on how your tool works, so it might not be 100% exactly like this for your case, but it should be good enough to give you an idea, and you can adapt from it. You'd ideally output files like this: Example: directory/en/[file-name].json {
// the key is just the way to identify that chunk. It can be a number, hash, or the chunk name.
"A0001": "The source content of the text chunk",
"A0002": "The source content of the text chunk",
"...": "..."
} Example: directory/de/[file-name].json {
"A0001": "The translated content of the text chunk",
"A0002": "The translated content of the text chunk",
"...": "..."
} Something to keep in mind is that the bigger the repo and the number of translations, the bigger the noise/size of these "context" files will be. With that in mind, you might want to only generate those during the build of the Lunaria dashboard in a temporary folder, so they don't stay in the user's repository, for example. If what matters for you is showing the content on the dashboard, of course, you don't need the values of the keys to be actually the text chunks, so to save space, you could just repeat the key as the value.
Of course, you also need to add these files to the "files": [
{
"location": "directory/**/*.json",
"pattern": "directory/@lang/@path",
"type": "dictionary"
}
] |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We are building a custom action that automatically translates Starlight web sites using GitHub Models ( https://pelikhan.github.io/action-continuous-translation/ ). As part of this process, we maintain a precise list of all untranslated text chunks in every file. Would there be a way to inject this data into the lunaria rendering algorithm?
Beta Was this translation helpful? Give feedback.
All reactions