2 # This file is an aid to generated the Languages rules file.
4 # python languages.py > ..\winbuild\Languages.rules
9 files = [f for f in os.listdir('.') if re.match(r'translator_[a-z][a-z]\.h', f)]
12 new_list.append([f,(os.path.splitext(f)[0]).replace("translator_","").upper()])
15 # generating file is lang_cfg.py
16 # the rules file has to output lang_cfg.h
19 <?xml version="1.0" encoding="utf-8"?>
27 DisplayName="Settings"
28 CommandLine="python $(InputPath) [AllOptions] [AdditionalOptions] > $(InpDir)/$(InputName).h"
29 Outputs="$(IntDir)/$(InputName).h"
31 AdditionalDependencies=""
32 ExecutionDescription="Executing languages ..."
33 ShowOnlyRuleProperties="false"
38 DisplayName="Use English Only"
39 Description="Use English Only"
46 DisplayName="Don't use English Only"
51 DisplayName="Use English Only"
57 # generate loop, English is mandatory (so cannot be chosen)
61 # search for the language description
65 if "idLanguage" in line:
74 tmp = tmp.replace("\n","")
75 l = re.sub('[^"]*"([^"]*)".*','\\1',tmp)
76 l1 = l.replace("-","")
77 # capatalize first letter
90 DisplayName="Don't use %s"
99 """ % (l1, l, l, l, f[1], l)
105 </VisualStudioToolFile>