forked from jesseduffield/lazydocker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getter.rb
62 lines (60 loc) · 1014 Bytes
/
getter.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
56
57
58
59
60
61
62
ids = %w[
AnonymousReportingPrompt
AnonymousReportingTitle
attach
cancel
close
Confirm
confirmPruneImages
ConfirmQuit
ContainersTitle
CustomCommand
Donate
EditConfig
Error
ErrorOccurred
execute
ImagesTitle
menu
mustForceToRemoveContainer
navigate
nextContext
NoContainers
NoImages
NotEnoughSpace
NoViewMachingNewLineFocusedSwitchStatement
OpenConfig
pressEnterToReturn
previousContext
ProjectTitle
pruneImages
PruningStatus
remove
removeImage
removeService
removeWithoutPrune
removeWithVolumes
RemovingStatus
resizingPopupPanel
restart
RestartingStatus
RunningSubprocess
scroll
ServicesTitle
stop
StopContainer
StoppingStatus
StopService
viewLogs
]
f = File.read('pkg/i18n/english.go')
f.lines.each_with_index do |line, index|
if line[/ID:/]
stripped = line.strip.gsub(/ID: *"/, '",').gsub('",', '')
if ids.include?(stripped)
key = stripped[0].upcase + stripped[1..-1]
value = f.lines[index+1].strip.gsub(/Other: *"/, '').gsub('",', '')
puts "#{key}: \"#{value}\","
end
end
end