Skip to content

Instantly share code, notes, and snippets.

@marybnq
Last active June 9, 2021 16:52
Show Gist options
  • Save marybnq/56028e21a8a1ec6eae4ab1acded60179 to your computer and use it in GitHub Desktop.
Save marybnq/56028e21a8a1ec6eae4ab1acded60179 to your computer and use it in GitHub Desktop.
A struct inside a String extension to store our app's localized strings
//
// LocalizedStrings.swift
// Localization
//
// Created by Federica Benacquista on 09/06/21.
//
import UIKit
extension String{
/*Here goes the previous code, you can find it at:
https://gist.github.com/marybnq/f765d44cff15ea530e7ee09b0497d020
*/
/**
Struct containing all of the localized strings we use in our app
*/
struct Localized {
static let hello = "Hello".localize //Contains the equivalent of NSLocalizedString("Hello", comment: "Hello")
static let edit = "Edit".localize
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment