Skip to content

Firefly III: a personal finances manager

Add two new support functions.

James Cole1535f596f662
diff --git a/app/Support/Steam.php b/app/Support/Steam.php
index 1eb16f90dc..4c92d5be2c 100644
--- a/app/Support/Steam.php
+++ b/app/Support/Steam.php
@@ -584,4 +584,30 @@ class Steam
return $amount;
}
+ /**
+ * Get user's language.
+ *
+ * @return string
+ */
+ public function getLanguage(): string // get preference
+ {
+ return app('preferences')->get('language', config('firefly.default_language', 'en_US'))->data;
+ }
+
+ /**
+ * Get user's locale.
+ *
+ * @return string
+ */
+ public function getLocale(): string // get preference
+ {
+ /** @var string $language */
+ $locale = app('preferences')->get('locale', config('firefly.default_locale', 'equal'))->data;
+ if ('equal' === $locale) {
+ return $this->getLanguage();
+ }
+
+ return $locale;
+ }
+
}