I’m trying to figure out how to include some Preform tries in a language extension in Inform 10, which is proving to be a hard task.
The Inform documentation (which I have been informed reflects the current development version of Inform, not the currently released 10.1.2) What This Module Does for the inflections-module says the following:
§12. Naming conventions. Tries are highly language specific, and would need rewriting for every language. The tries for English are supplied in English Inflections, but that’s just for convenience; other languages should supply them in the Inform source text of the relevant language extension, or in Syntax.preform files.
It is not clear to me where I should put my own Syntax.preform file. It seems like Inform’s internal mkscript file, which creates the English language’s Syntax.preform file out of a web of stuff including the inflections-module, puts it in English Language’s Materials/Languages/English/, so I’ve tried to put it in the corresponding place (as well as the directory corresponding to Languages/English (because I think an extension having a Materials/ subdirectory is a development feature, but I’m not even sure) to no avail - it never seems to be compiled, evidenced by the fact that I put lots of non-Preform gibberish there and Inform didn’t complain.
Anyway, the Guide to Language Bundles documentation seems to imply that Syntax.preform is mostly used for language bundles where the Language of Syntax is changed, not just the Language of Play (although of course it might just be required in that case, but still allowed):
If the user tries to build a project “scritto in italiano”, then Inbuild will read a file of Preform declarations called Syntax.preform inside the bundle: in this example, at Italian/Syntax.preform. Should such a file not exist (or not declare any nonterminals) then Inform will produce a problem like so:
Problem. The project says that its syntax is written in a language other than English (specifically, Italian), but the language bundle for that language does not provide a file of Preform definitions.
So I tried to include the Preform trie inside of my language extension instead, the way other language extensions did in Inform 7. This works insofar that the Preform is compiled, but it seems it doesn’t properly override the English Preform. For example, if I try to change the plural ending, it still uses the English ones. As a more obvious example, this:
Include (-
language Danish
<indefinite-article> ::=
[Danish indefinite articles here]
-) in the Preform grammar.
Gives the following error:
Problem. There’s a problem in Inform’s linguistic grammar, which is probably set by a translation extension. The problem occurs in the definition of : nonterminal internal in one definition and regular in another.
The nonterminal <indefinite-article> is indeed marked as internal in English Language’s Syntax.preform file, but I would think I was overriding that one instead of trying to redefine it, or at least that’s what the naming conventions lead me to believe:
Except at the very top level, translators are free to created new tries and name them as they please, but the top-level tries must have the same names that they have here. For example, the Spanish implementation of
<singular-noun-to-its-indefinite-article>may look entirely unlike its English version, but at the top level it still has to have that name.
So I’m thinking I might need to use Syntax.preform after all, so it’s read in the correct order? I’m not sure. I’m a bit at a loss here.
I’m apparently not the only person frustrated with the state of translation:
(@otistdog, you apparently got it to work never said how…)
If anyone can help, I’d be very grateful!