Add i18n and custom responses - #37
Open
doZennn wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 localization support and the ability to customize the bot responses as a side effect.
I manually combed through, and organized every string into their own .yml file. There are only some minor changes to menu buttons such as "Back" and "Cancel". I also Changed "Overseerr" to "Seerr" while I was at it.
Adding new languages
Make a copy of the English files in
i18n/and change the filename to the language you want to translate to.e.g.
messages.en.yml -> messages.de.yml. You also need to change the root key in the .ymlen: -> de:If a string is missing or not translated, it'll fall back to the English file, if for some reason the English file also doesn't have a definition it'll show up as the key name. e.g.
check.usageinstead ofUsage: /check <title>Custom responses
Users can also change what the bot responds with if you copy the .yml you want to change and put it in
data/i18n/, the bot will load those over the defaults. If the bot updates and the user has an old yml, it'll just fall back nicely as explained above.I use this cause I don't like how some of the responses are worded.
This serves as a potential fix for #34 by just changing these: i18n/check.en.yml