diff --git a/debian/changelog b/debian/changelog index 3eb4fc3..aa98ce6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -php-vn-lib (2.1.15) stable; urgency=low +php-vn-lib (2.1.16) stable; urgency=low * Initial Release. diff --git a/debian/control b/debian/control index 2700570..5903f91 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Vcs-Git: https://gitverdnatura.es/php-vn-lib Package: php-vn-lib Architecture: all -Depends: php-mysql +Depends: php-mysql, php-yaml Section: misc Priority: optional Description: PHP libraries diff --git a/lib/locale.php b/lib/locale.php index d79b1b5..b4b53d1 100644 --- a/lib/locale.php +++ b/lib/locale.php @@ -61,9 +61,9 @@ namespace Vn\Lib { } /** - * Adds a path where a JSON file with translations is located. + * Adds a path where a YAML file with translations is located. * - * @param string $path The JSON file path + * @param string $path The YAML file path */ static function addPath($path) { self::$paths[$path] = TRUE; @@ -73,17 +73,16 @@ namespace Vn\Lib { } /** - * Loads translations from a JSON file. + * Loads translations from a YAML file. * - * @param string $path The JSON file path + * @param string $path The YAML file path */ static function loadFile($path) { $locale = self::$locale; - $file = stream_resolve_include_path("$path/locale/$locale.json"); + $file = stream_resolve_include_path("$path/locale/$locale.yml"); - if (file_exists($file) - &&($jsonString = file_get_contents($file))) - self::addTranslations(json_decode($jsonString, TRUE)); + if (file_exists($file)) + self::addTranslations(\yaml_parse_file($file)); } /**