This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Handlebars Localisation Helper | |
// Source: https://gist.github.com/tracend/3261055 | |
Handlebars.registerHelper('l10n', function(keyword) { | |
var lang = (navigator.language) ? navigator.language : navigator.userLanguage; | |
// pick the right dictionary (if only one available assume it's the right one...) | |
var locale = window.locale[lang] || window.locale['en-US'] || window.locale || false; | |
// exit now if there's no data | |
if( !locale ) return target; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CommonMacros.h | |
// Created by Tom Adriaenssen (@inferis) | |
// Inspired by the awesome work by Piet Jaspers (@pjaspers) | |
// | |
/* | |
* How to use this file: | |
* 1. Find your .pch file | |
* 2. Import this file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Contact: Decodable, CustomStringConvertible { | |
var id: String | |
@NestedKey | |
var firstname: String | |
@NestedKey | |
var lastname: String | |
@NestedKey | |
var address: String | |
enum CodingKeys: String, NestableCodingKey { |