i18n tweaks

This commit is contained in:
Ben Hollis 2013-02-09 12:34:30 -08:00
parent 7020bdce1a
commit afc62d5a26

View file

@ -43,7 +43,7 @@ module Middleman
@mount_at_root = @options.has_key?(:mount_at_root) ? @options[:mount_at_root] : langs.first @mount_at_root = @options.has_key?(:mount_at_root) ? @options[:mount_at_root] : langs.first
if !@app.build? if !@app.build?
logger.info "== Locales: #{langs.join(", ")}" logger.info "== Locales: #{langs.join(", ")} (Default #{@mount_at_root})"
end end
# Don't output localizable files # Don't output localizable files
@ -79,7 +79,9 @@ module Middleman
end end
def langs def langs
@options[:langs] || begin if @options[:langs]
Array(@options[:langs]).map(&:to_sym)
else
Dir[File.join(@app.root, @locales_glob)].map { |file| Dir[File.join(@app.root, @locales_glob)].map { |file|
File.basename(file).sub(/\.yml$/, "").sub(/\.rb$/, "") File.basename(file).sub(/\.yml$/, "").sub(/\.rb$/, "")
}.sort.map(&:to_sym) }.sort.map(&:to_sym)