Skip to content

Instantly share code, notes, and snippets.

@ashour
Created April 24, 2019 10:39
Show Gist options
  • Save ashour/4ab122d071d7e07bada22df3ab33d6d0 to your computer and use it in GitHub Desktop.
Save ashour/4ab122d071d7e07bada22df3ab33d6d0 to your computer and use it in GitHub Desktop.
import Firebase
class Product
{
fileprivate static let COLLECTION_PATH = "product-feed-i18n/locales/{locale}"
// ...
fileprivate static var collection: CollectionReference
{
get
{
return DB.instance.collection(
COLLECTION_PATH.replacingOccurrences(
of: "{locale}",
with: Locale.current.languageCode!
)
)
}
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment