A small Kotlin/JVM application using the published Messagevisor Java SDK.
It fetches a production datafile from the Messagevisor Cloudflare Pages example, creates a Messagevisor instance, and evaluates plain and ICU formatted translations with idiomatic Kotlin.
Learn more at messagevisor.com.
- JDK 17 or newer
- A GitHub account and token with the
read:packagesscope
Messagevisor Java is published through GitHub Packages. Add your GitHub username and personal access token to ~/.gradle/gradle.properties:
gpr.user=YOUR_GITHUB_USERNAME
gpr.key=YOUR_GITHUB_TOKENKeep these credentials outside the repository. For GitHub Actions, grant the example repository read access to the Messagevisor Java packages.
make buildmake runThe application fetches this datafile by default:
https://messagevisor-example-cloudflare-pages.pages.dev/production/messagevisor-web-en-US.json
You can provide another Messagevisor datafile URL as the first argument:
./gradlew run --args="https://example.com/messagevisor-web-en-US.json"The example uses:
com.messagevisor:messagevisor-sdk:0.2.0com.messagevisor:messagevisor-module-icu:0.2.0
Datafile: https://messagevisor-example-cloudflare-pages.pages.dev/production/messagevisor-web-en-US.json
Locale: en-US
Target: web
Revision: 2
auth.signin: Sign in
nav.home: Home
nav.contact: Contact us before 5:30 PM
The exact localized time output can differ slightly with the CLDR data provided by the installed Java runtime.