Put translations to sub directories

main
Kitaiti Makoto 3 years ago
parent 3c6d2f093f
commit 936b3f839d

@ -5,11 +5,12 @@ TRANS_DIR = "trans"
desc "Build site"
multitask :build_site => [:build_base, "crowdin:download"] do
Pathname.glob("#{TRANS_DIR}/**/*.html.*").select(&:file?).each do |path|
Pathname.glob("#{TRANS_DIR}/**/*.html").select(&:file?).each do |path|
content = path.read
content.sub! /<script type="text\/javascript" src="\/\/cdn.crowdin.com\/jipt\/jipt.js"><\/script>/, ""
dest = Pathname(path.to_path.sub(TRANS_DIR, BUILD_DIR))
$stderr.puts "copy #{path} -> #{dest}"
dest.parent.mkpath
dest.write content
end
end

@ -21,13 +21,13 @@ files: [
# Source files filter
# e.g. "/resources/en/*.json"
#
"source" : "/trans/**/*.html",
"source" : "/trans/index.html",
#
# Where translations will be placed
# e.g. "/resources/%two_letters_code%/%original_file_name%"
#
"translation" : "/trans/**/%original_file_name%.%two_letters_code%",
"translation" : "/trans/%two_letters_code%/%original_file_name%",
#
# Files or directories for ignore

Loading…
Cancel
Save