lib/platformos_check/app.rb in platformos-check-0.4.9 vs lib/platformos_check/app.rb in platformos-check-0.4.10
- old
+ new
@@ -37,10 +37,12 @@
USER_SCHEMA_REGEX => UserSchemaFile,
TRANSLATIONS_REGEX => TranslationFile,
CONFIG_REGEX => ConfigFile
}
+ DEFAULT_LANGUAGE = 'en'
+
attr_reader :storage, :grouped_files
def initialize(storage)
@storage = storage
@grouped_files = {}
@@ -135,9 +137,20 @@
case name_or_relative_path
when Pathname
all.find { |t| t.relative_path == name_or_relative_path }
else
all.find { |t| t.relative_path.to_s == name_or_relative_path }
+ end
+ end
+
+ def default_language
+ DEFAULT_LANGUAGE
+ end
+
+ def translations_hash
+ @translations_hash ||= translations.each_with_object({}) do |translation_file, hash|
+ hash.deep_merge!(translation_file.content)
+ hash
end
end
end
end