Manage and generate localization files

What's New



Adds support for Xcode 13 - @janiduw


Stringly generates type safe localization files from a source yaml,json, or toml file. At the moment only outputs for Apple platforms are supported, but a generator for Android's R.strings is easy to add

  • Multi-language support
  • Named placeholders
  • Plural support
  • ✅ Compile safe Swift accessors


See help

stringly help

To generate all files in all languages

stringly generate Strings.yml

To generate a single file in a certain langage

stringly generate-file Strings.yml Strings.strings --language de


Make sure Xcode 13 is installed first.

mint install yonaskolb/stringly

Swift Package Manager

Use as CLI

git clone
cd Stringly
swift run stringly

Use as dependency

Add the following to your Package.swift file's dependencies:

.package(url: "", from: "0.7.0"),

And then import wherever needed: import StringlyKit


Given a source Strings.yml:

auth: # grouping of strings
  loginButton: Log In # If you don't specify a language it defaults to a base language
    en: Email # specifying a language
    en: Password
    de: Passwort # multiple languages
  error: # infinitely nested groups
    wrongEmailPassword: Incorrect email/password combination
  title: Hello {name} # this is a placeholder. Without a type defaults to %@ on apple platforms
  postCount: "Total posts: {postCount:d}" # the placeholder now has a type %d
  day: "Day: {}" # an unnamed placeholder
  escaped: Text with escaped \{braces} # escape braces in text by using \{
  articles: # this is a pluralized string
    en: You have {articleCount:d} # placeholder will be replaced with pluralization
    en.articleCount: # supports pluralizing multiple placeholders in a single string
      none: no articles
      one: one article
      other: {articleCount:d} articles

This generates .swift, .strings, and .stringsdict files for multiple languages.

The Swift file then allows usage like this:

errorLabel.text = Strings.auth.error.wrongEmailPassword
welcomeLabel.text = Strings.home.title(name: "John")
postsLabel.text = Strings.home.postCount(postCount: 10)
day.text ="Monday")
articleLabel.text = Strings.home.articles(articleCount: 4)

Future Directions

  • Comments and other data for keys
  • Generate files for other platforms like Android R.string file or translation specific files
  • Importing of translation files


  • Swift Tools 5.1.0
View More Packages from this Author


Last updated: Mon Mar 18 2024 10:09:31 GMT-0900 (Hawaii-Aleutian Daylight Time)