zh-hans: translate the title for workshops guide.
[enc.git] / toggle-lang
CommitLineData
4e5a60e6
DT
1#!/bin/bash
2# Really quick hacky script to comment/uncomment links to translations
3# of the GPG guide.
4
5enc_mode=$1
6enc_lang=$2
7
8if [ $enc_mode = 'enable' ]
9then
10 # Regex to match <li> tag with language link
11 enc_regex="<!--\(<li><a.*href=\"\/${enc_lang}\".*<\/li>\)-->"
12 # Uncomment it
13 sed -i "s/$enc_regex/\1/" **/*.html
14elif [ $enc_mode = 'disable' ]
15then
16 # Regex to match <li> tag with language link
17 enc_regex="\(<li><a.*href=\"\/${enc_lang}\".*<\/li>\)"
18 # Comment it out
19 sed -i "s/$enc_regex/<!--\1-->/" **/*.html
20else
21 echo 'Usage: toggle-lang enable|disable <lang>'
22fi