A small Swift application using the published Messagevisor Swift SDK.
It fetches a production datafile from the Messagevisor Cloudflare Pages example, creates a Messagevisor instance, and evaluates plain and ICU formatted translations.
Learn more at messagevisor.com.
- macOS 13 or newer
- Swift 5.9 or newer
make buildThis resolves the package dependency, compiles the application, and runs its unit test.
make 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:
swift run messagevisor-example-swift https://example.com/messagevisor-web-en-US.jsonThe example uses Messagevisor Swift 0.1.0 and its ICU module.
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 Apple runtime.
The served datafile is authored and deployed by messagevisor-example-cloudflare-pages.