Skip to content

Commit

Permalink
Локализация стандартных атрибутов и даты
Browse files Browse the repository at this point in the history
Table of Context → Содержание
Figure → Рисунок
Version → Версия
и др.
  • Loading branch information
srgizh authored and Morganov committed Jan 24, 2021
1 parent a5104de commit 1f82d4f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
16 changes: 14 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,24 @@ namespace :book do
task :build do

begin
lang = "ru"
begin
l10n_text = open("https://raw.githubusercontent.com/asciidoctor/asciidoctor/master/data/locale/attributes-#{lang}.adoc").read
File.open('attributes.asc', 'w') { |file| file.puts l10n_text}
progit_txt = File.open('progit.asc').read
if not progit_txt.include?("attributes.asc")
progit_txt.gsub!('include::book/license.asc', "include::attributes.asc[]\ninclude::book/license.asc")
File.open('progit.asc', 'w') {|file| file.puts progit_txt }
end
rescue
end
version_string = ENV['TRAVIS_TAG'] || `git describe --tags`.chomp
if version_string.empty?
version_string = '0'
end
date_string = Time.now.strftime("%Y-%m-%d")
params = "--attribute revnumber='#{version_string}' --attribute revdate='#{date_string}'"
date_string = Time.now.strftime("%d-%m-%Y")
params = "--attribute revnumber='#{version_string}' --attribute revdate='#{date_string}' --attribute lang=#{lang} "

puts "Generating contributors list"
`git shortlog -s | grep -v -E "(Straub|Chacon|dependabot)" | cut -f 2- | column -c 96 > book/contributors.txt`

Expand Down
1 change: 0 additions & 1 deletion progit.asc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ $$VERSION$$, $$DATE$$
:toclevels: 2
:pdf-page-size: A4
:front-cover-image: image:book/cover.png[width=1050,height=1600]
:figure-caption: Рисунок

ifdef::ebook-format[:leveloffset: -1]

Expand Down

0 comments on commit 1f82d4f

Please sign in to comment.