Skip to content

Instantly share code, notes, and snippets.

@alsedi
alsedi / Localization.swift
Last active October 8, 2015 10:06
Localization of String, Int, Float, etc (Swift)
import Foundation
// Usage "String".localize will search for "String" key in Localizeble
// Works for all types that conform CustomStringConvertible protocol, e.g. Int, Float.
// Raw value will be converted to string and used as key, e.g.
// 10.localize, will search for "10" key.
// If key not exists, then string value will be returned
// Gist: https://gist.github.com/alsedi/357c99ff6d138cf94804
extension CustomStringConvertible {