mirror of
https://github.com/monero-project/monero-site.git
synced 2025-01-30 22:45:54 +00:00
plugins: jekyll-multiple-language support ruby >3.2
- exists? -> exist? - return blank translation string instead of nil
This commit is contained in:
parent
7132e45a64
commit
6be9f0e054
1 changed files with 9 additions and 5 deletions
|
@ -48,7 +48,7 @@ module Jekyll
|
|||
if (exclude_path == f_path)
|
||||
new_path = parts[0] + "/" + f_path
|
||||
puts "Moving '" + file_path + "' to '" + new_path + "'"
|
||||
if (Dir.exists?(new_path))
|
||||
if (Dir.exist?(new_path))
|
||||
FileUtils.rm_r new_path
|
||||
end
|
||||
File.rename file_path, new_path
|
||||
|
@ -611,10 +611,14 @@ def translate_key(key, lang, site)
|
|||
|
||||
if translation.nil? or translation.empty?
|
||||
translation = site.parsed_translations[site.config['default_lang']].access(key)
|
||||
|
||||
if translation.nil? or translation.empty?
|
||||
translation = ""
|
||||
if site.config["verbose"]
|
||||
puts "Missing i18n key: #{lang}:#{key}"
|
||||
puts "Using translation '%s' from default language: %s" %[translation, site.config['default_lang']]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
translation
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue