Summary Files Commits Branches @commit @diff @stats
path: root / generate-hooks / create-flags.awk
blob: ad8e1b291fd90b215f54fcc8d49963ed3d755485 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Adds a way to more simply insert flags into text
# Each flag is represented with an ftag (text that is preceded by &&)

# Available flags:
# Great Britain - &&gb

BEGIN {
	flag[1] = "gb"
	title[1] = "ENG"

	for (i = 1; i <= length(flag); i++) {
		flagExp[i] = "&#38;&#38;" flag[i]
		flagTag[i] = "<img src=\"/img/" flag[i] ".svg\" class=\"unzoomable\" alt=\"" title[i] "\" title=\"" title[i] "\">"
	}
}

{
	for (i = 1; i <= length(flagExp); i++) {
		gsub(flagExp[i], flagTag[i])
	}
	print
}