Skip to content

Latest commit

 

History

History

StringCatalogEnum

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

StringCatalogEnum

This utility converts an xcstrings file into a Swift Enum.

Contents

Purpose of this utility

Although it may not be the best metaprogramming utility, it provides an easy to use way to generates native Swift code from String Catalog files.

You should notice that a lot of things are missing in this utility; for example, minimum documentation has been provided. Some of them are listed in the issues section. This is due to another purpose of this utility: to evaluate skills of new developers. You are welcome to learn from mistakes made by previous contributors.

How to use

Example

For a string with key errorMessage in your String Catalog, you will have a case errorMessage in your generated Enum.

  • SwiftUI.View(XcodeString.errorMessage.key)
  • let string = XcodeString.errorMessage.string

Unit testing

Before open your PR for review, make sure all unit tests are passing by running swift test or make test.

Tech stack

It is expected for the new developers to proactively research unfamiliar tech stack. It is encouraged to use Google or even ChatGPT to do your research, or even help you write some of your code, but in the end, you need to put things together to either learn how to use this utility, or make contribution. And as a contribution, you are expected to do your research about the following tech stack:

  • SPM and Swift Argument Parser.
  • Quick and Nimble.
  • Makefile and make.

Hint: always ask questions if you are lost, just make sure you've done your research.