GithubHelp home page GithubHelp logo

plu / xcstrings-tool Goto Github PK

View Code? Open in Web Editor NEW

This project forked from liamnichols/xcstrings-tool

0.0 1.0 0.0 14.37 MB

A plugin to generate Swift constants for your Strings Catalogs.

Home Page: https://swiftpackageindex.com/liamnichols/xcstrings-tool/documentation/documentation

License: MIT License

Swift 100.00%

xcstrings-tool's Introduction

XCStrings Tool

Tests

A plugin to generate Swift constants for your String Catalogs.

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(Text(.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.

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!

xcstrings-tool's People

Contributors

hiragram avatar liamnichols avatar paulgessinger avatar plu avatar samhastings1066 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.