summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/hyph-utf8/generate-plain-patterns.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/generic/hyph-utf8/generate-plain-patterns.rb')
-rwxr-xr-xMaster/texmf-dist/source/generic/hyph-utf8/generate-plain-patterns.rb46
1 files changed, 37 insertions, 9 deletions
diff --git a/Master/texmf-dist/source/generic/hyph-utf8/generate-plain-patterns.rb b/Master/texmf-dist/source/generic/hyph-utf8/generate-plain-patterns.rb
index 59bb491f8a0..5ec25efaf69 100755
--- a/Master/texmf-dist/source/generic/hyph-utf8/generate-plain-patterns.rb
+++ b/Master/texmf-dist/source/generic/hyph-utf8/generate-plain-patterns.rb
@@ -10,6 +10,8 @@ require 'unicode'
load 'languages.rb'
$path_plain="../../../../plain"
+$path_TL="../../../../TL"
+$path_language_dat="#{$path_TL}/texmf/tex/generic/config"
$l = Languages.new
# TODO: should be singleton
@@ -26,17 +28,20 @@ languages.each do |language|
end
# language_codes['de-1901'] = 'de-1901'
# language_codes['de-1996'] = 'de-1996'
-language_codes['de-ch-1901'] = 'de-CH-1901'
-language_codes['en-gb'] = 'en-GB'
-language_codes['en-us'] = 'en-US'
-language_codes['zh-latn'] = 'zh-Latn'
+language_codes['de-ch-1901'] = 'de-CH-1901'
+language_codes['en-gb'] = 'en-GB'
+language_codes['en-us'] = 'en-US'
+language_codes['zh-latn'] = 'zh-Latn'
# language_codes['el-monoton'] = 'el-monoton'
# language_codes['el-polyton'] = 'el-polyton'
-language_codes['mn-cyrl'] = nil
-language_codes['mn-cyrl-x-2a'] = 'mn'
-language_codes['sh-latn'] = 'sr-Latn'
-language_codes['sh-cyrl'] = nil
-language_codes['sr-cyrl'] = 'sr-Cyrl'
+language_codes['mn-cyrl'] = 'mn'
+language_codes['mn-cyrl-x-lmc'] = nil
+language_codes['sh-latn'] = 'sr-Latn'
+language_codes['sh-cyrl'] = nil
+language_codes['sr-cyrl'] = 'sr-Cyrl'
+
+$file_language_dat_lua = File.open("#{$path_language_dat}/language.dat.lua", "w")
+$file_language_dat_lua.puts "{\n"
languages.sort{|x,y| x.code <=> y.code }.each do |language|
if language.use_new_loader or language.code == 'en-us' then
@@ -93,5 +98,28 @@ languages.sort{|x,y| x.code <=> y.code }.each do |language|
$file_hyp.close
$file_let.close
$file_inf.close
+
+ $file_language_dat_lua.puts "\t[\"#{language.name}\"]={"
+ $file_language_dat_lua.puts "\t\tloader=\"loadhyph-#{language.code}.tex\","
+ $file_language_dat_lua.puts "\t\tcode=\"#{code}\","
+ if language.hyphenmin == nil or language.hyphenmin.length == 0 then
+ lmin = ''
+ rmin = ''
+ else
+ lmin = language.hyphenmin[0]
+ rmin = language.hyphenmin[1]
+ end
+ $file_language_dat_lua.puts "\t\tlefthyphenmin=#{lmin},"
+ $file_language_dat_lua.puts "\t\trighthyphenmin=#{rmin},"
+ if language.synonyms.length > 0
+ $file_language_dat_lua.puts "\t\tsynonyms={\"#{language.synonyms.join('","')}\"},"
+ else
+ $file_language_dat_lua.puts "\t\tsynonyms={},"
+ end
+ $file_language_dat_lua.puts "\t},\n"
end
end
+
+$file_language_dat_lua.puts "}\n"
+
+$file_language_dat_lua.close