forked from plume/joinplu.me
Merge pull request 'Put translations to sub directories' (#40) from trans-dirs into main
Reviewed-on: plume/joinplu.me#40
This commit is contained in:
commit
dbc4182615
2 changed files with 4 additions and 3 deletions
3
Rakefile
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
|
||||
|
|
|
@ -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…
Reference in a new issue