From 0a932431d618f2845c3dcb75c2c335be059293c7 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 20 Jan 2016 11:23:52 +0100 Subject: [PATCH] (lang) sort collected gettext from "make dynamic", closes https://github.com/opnsense/core/issues/659 --- lang/dynamic/collect.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lang/dynamic/collect.py b/lang/dynamic/collect.py index 4eaa500ba..c34b71ea9 100755 --- a/lang/dynamic/collect.py +++ b/lang/dynamic/collect.py @@ -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)