Class: Yast::CustomDialogsClass

Inherits:
Module
  • Object
show all
Defined in:
../../library/general/src/modules/CustomDialogs.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) load_file_locale(patterns, file_path, language)



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File '../../library/general/src/modules/CustomDialogs.rb', line 39

def load_file_locale(patterns, file_path, language)
  patterns = deep_copy(patterns)
  text = ""
  file = ""
  i = 0
  while Ops.less_than(i, Builtins.size(patterns))
    p = Ops.get(patterns, i, "")
    tmp = Ops.add(Ops.add(file_path, "/"), p)
    if !Builtins.issubstring(p, "%")
      Builtins.y2debug("no pattern")
      Builtins.y2debug("checking for %1", tmp)
      text = Convert.to_string(SCR.Read(path(".target.string"), [tmp, ""]))
      if text != ""
        break
      else
        i = Ops.add(i, 1)
        next
      end
    end
    file = Builtins.sformat(tmp, language)
    Builtins.y2debug("checking for %1", file)
    text = Convert.to_string(SCR.Read(path(".target.string"), [file, ""]))
    break if text != ""

    file = Builtins.sformat(tmp, Builtins.substring(language, 0, 2))
    Builtins.y2debug("checking for %1", file)
    text = Convert.to_string(SCR.Read(path(".target.string"), [file, ""]))
    break if text != ""

    file = Builtins.sformat(tmp, "en")
    Builtins.y2debug("checking for %1", file)
    text = Convert.to_string(SCR.Read(path(".target.string"), [file, ""]))
    break if text != ""
    i = Ops.add(i, 1)
  end
  { "text" => text, "file" => file }
end

- (Object) main



35
36
37
# File '../../library/general/src/modules/CustomDialogs.rb', line 35

def main

end