     Snapshot.snapshot(name, waitForLoadingIndicator: waitForLoadingIndicator)
 }
 
-class Snapshot: NSObject {
+public class Snapshot: NSObject {
 
-    class func setupSnapshot(app: XCUIApplication) {
+    public class func setupSnapshot(app: XCUIApplication) {
         setLanguage(app)
+        setLocale(app)
         setLaunchArguments(app)
     }
 
     class func setLanguage(app: XCUIApplication) {
-        let path = "/tmp/language.txt"
+        guard let prefix = pathPrefix() else {
+            return
+        }
+
+        let path = prefix.stringByAppendingPathComponent("language.txt")
 
         do {
-            let locale = try NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding) as String
-            deviceLanguage = locale.substringToIndex(locale.startIndex.advancedBy(2, limit:locale.endIndex))
-            app.launchArguments += ["-AppleLanguages", "(\(deviceLanguage))", "-AppleLocale", "\"\(locale)\"", "-ui_testing"]
+            let trimCharacterSet = NSCharacterSet.whitespaceAndNewlineCharacterSet()
+            deviceLanguage = try NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding).stringByTrimmingCharactersInSet(trimCharacterSet) as String
+            app.launchArguments += ["-AppleLanguages", "(\(deviceLanguage))"]
         } catch {
             print("Couldn't detect/set language...")
         }
     }
 
+    class func setLocale(app: XCUIApplication) {
+        guard let prefix = pathPrefix() else {
+            return
+        }
+
+        let path = prefix.stringByAppendingPathComponent("locale.txt")
+
+        do {
+            let trimCharacterSet = NSCharacterSet.whitespaceAndNewlineCharacterSet()
+            locale = try NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding).stringByTrimmingCharactersInSet(trimCharacterSet) as String
+        } catch {
+            print("Couldn't detect/set locale...")
+        }
+        if locale.isEmpty {
+            locale = NSLocale(localeIdentifier: deviceLanguage).localeIdentifier
+        }
+        app.launchArguments += ["-AppleLocale", "\"\(locale)\""]
+    }
+
     class func setLaunchArguments(app: XCUIApplication) {
-        let path = "/tmp/snapshot-launch_arguments.txt"
+        guard let prefix = pathPrefix() else {
+            return
+        }
 
-        app.launchArguments += ["-FASTLANE_SNAPSHOT", "YES"]
+        let path = prefix.stringByAppendingPathComponent("snapshot-launch_arguments.txt")
+        app.launchArguments += ["-FASTLANE_SNAPSHOT", "YES", "-ui_testing"]
 
         do {
             let launchArguments = try NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding) as String


// Please don't remove the lines below
// They are used to detect outdated configuration files
// SnapshotHelperVersion [[1.0]]

import XCTest

var deviceLanguage = ""
var locale = ""

@available(*, deprecated, message="use setupSnapshot: instead")
func setLanguage(app: XCUIApplication) {
