(lang) sort collected gettext from "make dynamic", closes https://github.com/opnsense/core/issues/659

This commit is contained in:
Ad Schellevis 2016-01-20 11:23:52 +01:00
parent 13749d462a
commit 0a932431d6

View File

@ -56,8 +56,14 @@ for filename in glob.glob('%s/plugins/*.py'%'/'.join(os.path.realpath(__file__).
fOut=open('%s/%s.php'%(targetPath,modulename),'w')
fOut.write(templateText)
# fill with gettext tags
# collect and sort tags
translations = list()
for textValue in lang.getTranslations(OPNsenseRoot):
translations.append(textValue)
translations.sort()
# fill with gettext tags
for textValue in translations:
line="echo gettext('%s');\n"%(unicode(textValue).replace("'","\\'"))
fOut.write(line)