Closed woylie closed 2 years ago
For some more context, I run Kratos with docker compose side-by-side with the Elixir application I'm developing. Solution 3 or 4 would allow me to:
mix
task to my application to fetch the messages.json
and put it into some import folderGettext.gettext_noop/1
on all messages to mark them for translationmix gettext.extract --merge
to update all .pot
and .po
filesHey, it is a great idea to have this as a JSON file. As you pointed out, I think modifying the CLI helper to also output it as a JSON should be pretty straight forward. Would you be up for a PR for this? :)
Yes, it's on my to do list, I'll get to this soon.
Preflight checklist
Describe your problem
To make translations of error messages easier, it would be great to have a machine-readable list of messages in use.
Describe your ideal solution
As discussed in #2460, a solution might be to repurpose the
writeMessages
to also return a machine-readable format.https://github.com/ory/kratos/blob/b682689dd781d52d164b0c6edaf77ab15c9ef154/cmd/clidoc/main.go#L157
JSON would be fine. Not sure what to do with the output.
Any would do, but with 3 or 4, it would be easier to automate the update of the translation source files in an application.
Please let me know what you think.
Workarounds or alternatives
Copying the messages manually from the docs and turning them into a JSON document. 🥴
Version
0.10.1
Additional Context
No response