feat: add better localization support #71
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds real localization support. Up until now, we only used
meta.languageto set thelangattribute in the metadata of the document.Now we'll actually use it to change how we format dates, and will slowly add languages to change how the actual sections/titles are rendered.
Currently, only English is fully supported, but we'll get Dutch fairly quickly, and likely get German, French, Bosnian, Norwegian, etc., in the near future.
A lot of the i18n code is actually just taken from gitlab.com/SethFalco/matrix-stream-alerts.
Chore
Also restructures the project so it's all maintained in a
src/directory, and we expose therenderfunction in the rootindex.jsfile the same way we did before. This will keep the project simple to maintain as we scale up the feature set, but maintain compatibility withresume-cli.Related
Summary by CodeRabbit