
On Mon, Dec 21, 2009 at 12:08:26PM +0100, Clinton Gladstone wrote:
Will logical comparisons also work with the variable substitution? That is, something like the following:
name != $(name:en) { ... }
This would make it easier to avoid redundant information in names. (Such as, in the example above, adding the English name only if it is not equal to the name.)
I understood the source code so that variable substitution would only work in the right-hand-side of 'add', 'name', and 'set' rules. I believe that the special name:* handling would be best implemented in a special mkgmap option. I would try to avoid writing language suffixes in style files. Styles can be globally useful, and the selection of preferred language(s) is merely a parameter that should be passed to mkgmap on the command line. Perhaps something like this: mkgmap --define name:LANG=name:en
Earlier, i submitted a patch which introduced a not-equal filter which did this for me, but the patch was never committed: it would be great if there was a standard solution for this.
Would the not-equal filter be used something like this: name '${name} (${name:LANG|ne:${name}}) | ${name}' The ne: would be a not-equal filter, meaning that '${name} (${name:LANG})' will be used when ${name} is not equal to ${name:LANG}. I see value in this; having a secondary language in parentheses could be useful in multilingual areas or for foreign tourists. Best regards, Marko