Quote:
Originally Posted by Comfy.n
I saw your template that checks if there are non-ascii characters in a title and it works just fine! Now I've saved it and tagged it with 'transliterate' and 'Terisa'. 
|
Yes, it is a nice check: well found

. However, I do also have sub-titles, so I had to rework the template a little bit.
Code:
program:
if (field('title')!=transliterate(field('title')))
then
if (field('#subtitle')!=transliterate(field('#subtitle')))
then
'true1, true2'
else
'true1'
fi
else
if (field('#subtitle')!=transliterate(field('#subtitle')))
then
'true2'
else
'false'
fi
fi
It returns true1 for title, true2 for subtitle, or false when neither contains non-ASCII chars.
The reason I didn't use intermediate vars is because I noticed that the formatter stops processing/evaluating in case of a nil situation, so this seems to be fastest way to process. But as always, correct me if I'm wrong