Browse Source

Put translations to sub directories

witch.academy
Kitaiti Makoto 2 years ago
parent
commit
936b3f839d
  1. 3
      Rakefile
  2. 4
      crowdin.yml

3
Rakefile

@ -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

4
crowdin.yml

@ -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