forked from mycard/ygopro-images-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LanguageConstants.rb
55 lines (53 loc) · 1.58 KB
/
LanguageConstants.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
require 'yaml'
require File.dirname(__FILE__) + '/Global.rb'
class LanguageConstants
attr_accessor :term_monster
attr_accessor :term_spell
attr_accessor :term_trap
attr_accessor :term_normal
attr_accessor :term_effect
attr_accessor :term_fusion
attr_accessor :term_ritual
attr_accessor :term_trapmonster
attr_accessor :term_spirit
attr_accessor :term_union
attr_accessor :term_dual
attr_accessor :term_tuner
attr_accessor :term_synchro
attr_accessor :term_token
attr_accessor :term_quickplay
attr_accessor :term_continuous
attr_accessor :term_equip
attr_accessor :term_field
attr_accessor :term_counter
attr_accessor :term_flip
attr_accessor :term_cartoon
attr_accessor :term_xyz
attr_accessor :term_pendulum
attr_accessor :term_link
attr_accessor :term_spsummon
attr_accessor :pendulum_effect_head
attr_accessor :monster_effect_head
attr_accessor :term_races # 偷个鸡
attr_accessor :mse_language
attr_accessor :mse_stylesheet
class << self
attr_accessor :languages
def current
return languages[Global.language]
end
end
self.languages = {}
Dir.glob("locales/*.yml") do |file|
YAML.load(IO.read(file)).each do |locale, value|
self.languages[locale] ||= LanguageConstants.new
value['term'].each do |t, v|
self.languages[locale].send("term_#{t}=", v)
end
self.languages[locale].pendulum_effect_head = value['pendulum_effect_head']
self.languages[locale].monster_effect_head = value['monster_effect_head']
self.languages[locale].mse_language = value['mse_language']
self.languages[locale].mse_stylesheet = value['mse_stylesheet']
end
end
end