Changing the command "AGAIN" and some pronoums to Italian.

Hello everybody!

My name is Flavio, and i’m an italian I7 (newbe) developer. (excuse if i don’t speak English so well)

I’m working with I7 v. 6L38, and i would like to Extend the command AGAIN to work both italian and english: at the moment that works only in Italian, so i need to know what code inside the program i have to edit.

Plus, i would like to change the pronoums (it, he, she, etc) for working in italian (For example, in Italian, to say “take it” we say "prendiLO if the subject is male, or prendiLA if female, so i need to add [verb]LO/LA). I dunno where in the main codes is the part to edit.

Can someone help? Thanks a lot!

Flay

Which language extension (author and version) are you using for the conversion to Italian? The one by Massimo Stella (Version 3/110105) wouldn’t even begin to compile on 6L38 for me.

I’m using Version 2/140814 by Massimo Stella, together with V. 6L38. Maybe V. 3 works on the last version of I7, but i know that there are some bugs for Italian language, so i’m still working on 6L38 :wink:

I can’t locate the older version, but to answer part of your question: the “again” functionality is built very deeply into the parser at the I6 level and does not offer much room for modification. If you look at the contents of the extension, you should find some lines that look like:

Constant AGAIN1__WD = 'ancora'; Constant AGAIN2__WD = 'an//'; Constant AGAIN3__WD = 'ancora';

These are the words being reserved to mean “again.” I believe that only three are allowed, so you can modify one of them to be an English version, for example:

Constant AGAIN3__WD     = 'g';

but this provides only the commonly-expected English abbreviation “g” and not the full word “again”.

One possible approach is to use an “after reading a command” rule to modify the command entered if it consists of only “again” (to make it “g”), but this can get tricky in other than the simplest cases. (For example, if the player types: >SALTA. AGAIN.) Regular expressions can help.

Another possibility is to try to write your own “again” functionality at the I7 level, then disable the built-in functionality by changing the reserved words to nonsense/“untypeable” words, like ‘a,z’. This is not rigorously tested but may be a start:

[code]The previous player action is a stored action that varies.

Before doing something except repeating the last action (this is the set previous player action from current action rule):
if the current action is not previous player action:
say “(setting previous player action to: [current action])[line break]”;
now the previous player action is the current action.

Repeating the last action is an action applying to nothing. Understand “r” or “repeat” as repeating the last action.

Carry out repeating the last action (this is the attempt to repeat last action rule):
try previous player action.[/code]

Note that you would want to use different Understand lines for the action’s grammar, and you would need to disable the built-in parser handling for this to work with “ancora” or “an”.

Regarding the handling of pronouns: This looks pretty complicated to handle at the level you’re seeking, and will probably require quite a bit of work at the I6 level, if it can be done at all. It looks like in v3 of Massimo Stella’s Italian extension the parser would not really be aware whether the gender of articles is correct. In fact, it looks as though it is typically told to understand the pronoun or article used as part of the verb itself, as in:

Understand "prendi [something]" or "prendi  il/la/lo/i/le/gli/l/quei/quella/quello/quelle/quegli/quei/quell [something]" as taking.

Presumably v2 works the same way.

It doesn’t seem like it would be easy to get the parser to break up a single word of player input into more than one concept (i.e. to make it understand “prendilo” as equivalent to the English “take it” for something masculine). It might be possible to do this by writing custom grammar tokens at the I6 level.

Have you read the “Inform Designer’s Manual v4”? It goes into the details of how translations are handled at the I6 level, and may be useful to you.

Feel free to post additional follow-up questions, and welcome to the forum.

Thank you for your answer, i will try soon what you’ve suggest and i’ll let you know :slight_smile: