XCStringsTool

0.5.1

A plugin to generate Swift constants for your Strings Catalogs.
liamnichols/xcstrings-tool

What's New

0.5.1

2024-06-19T14:44:12Z

What's Changed

  • Improve performance when generating source code for large Strings Catalogs by @liamnichols in #96
  • Support using generated code in Swift 6 language mode by @liamnichols in #98
  • Support using Swift Syntax 600.0.0 by @liamnichols in #98

Internal


Full Changelog: 0.5.0...0.5.1

SHA for xcstrings-tool.artifactbundle.zip: 4394f0c8759fd4ed3b7762fe46db12ec0b68f7a4803d8d6003f0faf6526a2e3e

XCStrings Tool

Tests

A plugin to generate Swift constants for your String Catalogs and other localized string resources.

Motivation

Hardcoding localized strings in your code and then having the compiler automatically extract them into the Strings Catalog (or legacy .strings files) works great on smaller projects, but over time you will often find that this approach doesn't scale well.

You usually find yourself compromising on either code quality, translator comments or boilerplate code from having to define your own constants, but it doesn't have to be this way!

struct ContentView: View {
    @Query var items: [Item]

    var body: some View {
        List {
            Section {
                ForEach(items) { item in
                    ItemView(item)
                }
            } footer: {
                Text(.localizable(.footerText(items.count)))
            }
        }
        .navigationTitle(.localizable(.contentViewTitle))
    }
}

XCStrings Tool aims to extend your localization experience so that you don't have to compromise anything. It does this by using your Strings Catalog as a source for generating elegant Swift code that you can reference directly within the rest of your project.

Requirements

  • An Xcode or Swift Package project using Xcode 15 or later.
  • Localizations using the new Strings Catalogs (.xcstrings) or legacy .strings and .stringsdict formats.

Getting Started

XCStrings Tool is a Swift Package Plugin that can integrate directly into Xcode and Swift Package targets that contain Strings Catalog (.xcstrings) files.

For more information about the Strings Catalog format, check out the Discover Strings Catalogs video from WWDC 2023.

Demo

To see XCStrings Tool in action, check out the Dog Tracker demo project for yourself.

Documentation

View the documentation on the Swift Package Index

If you have an improvement for the documentation, you can modify it here.

Contributing

Contributions to XCStrings Tool are welcome!

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

Last updated: Tue Nov 19 2024 20:33:03 GMT-1000 (Hawaii-Aleutian Standard Time)