ktor
ktor copied to clipboard
Support to I18n messages
Subsystem Ktor-features/ktor-i18n
Motivation Ktor doesn't have support to i18n messages by default, yet. So, this PR creates a new feature to support that.
Solution
Using Accept-Language
header provided on HTTP requests (as RFC 3282 explains), we can set a localized message bundle.
Features of this PR:
- Creates a new feature called
I18n
- it could be installed by using:
install(I18n) {
defaultLanguage = "pt-BR"
encoding = StandardCharsets.UTF_8
}
- Provides a way to set an
defaultLanguage
andencoding
- Creates extensions in
ApplicationCall
to help translation on Ktor routes. - Reads
resources/messages
directory to manage message bundles
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
It's a shame that this feature had been abandoned
any idea on when we can review this PR?
News on that? Anything I can help with?
Hey @bjhham, I just rebased and updated the API. Could you take a fresh look?