Skip to content

About

Example Swift application using Messagevisor SDK

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

messagevisor-example-swift

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.

Requirements

  • macOS 13 or newer
  • Swift 5.9 or newer

Build and test

make build

This resolves the package dependency, compiles the application, and runs its unit test.

Run

make run

The 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.json

The example uses Messagevisor Swift 0.1.0 and its ICU module.

Example output

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.

Related project

The served datafile is authored and deployed by messagevisor-example-cloudflare-pages.

License

MIT

About

Example Swift application using Messagevisor SDK

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages