Can I translate it?

dellaqia
Hi,

Is there any easy way to translate the program interface? Is there any text file, for example, I can translate and send to you afterwards? If so, I'd like doing it into Brazilian Portuguese, my native language. I could translate it also into Spanish and Italian tentatively, but a native speaker would be much better, of course.

Regards.
Dellaqia.

Alex
There is information on translating Quest here: http://quest5.net/wiki/Translating_Quest

This is just for default game text and commands. The user interface itself (menus etc.) is not translatable yet. Also the Editor is currently displayed in English (even if you are editing a non-English game), but I plan to make these translatable in the future.

In the meantime, a (Brazilian) Portuguese or Italian translation would be great! (We already have a Spanish translation)

Pertex
even if there is a spanish translation lots of templates are not translated there. Perhaps you could do that, too?

dellaqia
Ok, Alex,

I'll read it and see how much i understand and what i can do with it, but i was talking about translating the user interface indeed.

Hi, Pertex,

It's not clear if you are talking to me or to Alex. Anyway, i myself prefer doing "lots of" translation only into my own language by now.

greenelvish
Is anyone working on a italian traslation, right now?

I'm starting to play around with Quest, and i like it. It would be great to have an italian template.

Thank for answering

Luca

greenelvish
Hi Alex,

I'm starting a traslation from the "english.aslx" file to a more familiar "italian.aslx", but I can't solve an error on Compass commands (in my file arrows still work, but hyperlink says "I don't understand your command").

Where can I discuss details about it?

Thanks,

Luca

Pertex
Hi Luca,
could you upload your italian.aslx here, so we could have a look at it?

greenelvish
Hi,

the file is on my laptop, at home, so I will upload it as soon as I come back to home this afternoon.

Thanks

greenelvish
Hi,

at line 87 I added a comment to indicate the code portion where I have problems.

If I traslate the cardinal points (ie: west > ovest), then Quest (playing the game) does not recognize the hyperlink and return a "I don't understand your command" message. Instead, the arrows in the bottom right of screen work properly.

Please note that I'm not a programmer: I just know some HTML, CSS and Javascript. But I'd like to partecipate in template translation, because I found Quest a very powerful tool.

Pertex
Ok, i found four problems:
1) First you should include the english.aslx, so missing templates does not make trouble. You seemed to use an older english.aslx when starting translating. The save-template is missing.
2) Your file is ANSI-coded, it should be UTF-8
3) Within the compass-templates you are using "nordovest" or "sudovest". In the command-template of "go" you are using "nord-est|nord-ovest|sud-est|sud-ovest". If you remove the "-" it should work.
4) You forgot to translate all parts of the go- and lookdir-template:
Instead of
<template templatetype="command" name="go"><![CDATA[^go to (?<exit>.*)$|^go (?<exit>.*)$|^(?<exit>nord|...</template>

it should be
<template templatetype="command" name="go"><![CDATA[^vai (?<exit>.*)$|^(?<exit>nord|...</template>


Here is your file with all changes I mentioned:

greenelvish
Thanks! It works. Sorry for my newbie's mistakes.

I'll continue translating, then I'd like to test it on an italian version of the tutorial. And, I'm afraid I will come back here to ask for your help...

PS: about the "older english.aslx" and "save-template", I'm using files that I found after installing Quest 5.0.2. It is correct?

Again, thanks!

Pertex
No problem. We are here to answer your questions :D

At http://quest.codeplex.com/releases/view/66717 you can download version 5.1beta. The english.aslx there is lightly expanded (perhaps its only the new save-template).

greenelvish
I'm working on traslation (version 5.1 beta), and I have encountered my first obstacle.

1) in almost all dynamic templates like this one:
<dynamictemplate name="TakeUnsuccessful">"You can't take " + object.article + "."</dynamictemplate>

it would be useful to use a suffix instead of the article. "You can't take it" in italian is "non puoi prenderlo", where "prenderlo" is a composite word: "prender" - verb, infinitive - and "lo" - masculine/neutral suffix - (feminine: "prenderla"). Sometime I can completely change the phrase and/or customize the answer within the editor, but often I'd like to use default answers. I took a look to spanish and french translation and I inserted the language-specific object type, but I didn't find a solution.

2) I successfully conjugate the italian translation of verbs "to be" and "to do", just working on the functions at the end of file. It is possible to do the same with "to say" (I need to erase the "s" on the third-person singular)

3) A question about TAKE ("prendi") e DROP ("lascia"):

If I type

"> prendi tazza (take cup)
Hai preso Un con te. ("you take it", more or less: see problem n. 1)

and then I type:
> lascia tazza (drop cup)
Non capisco il tuo comando. ("I don't understand your command")

I mean: "prendi" works, while "lascia" doesn't work...

Here is my file.

Thanks
Luca

Pertex
Hi Luca,
3) Your verbtemplate for drop is "Lascia qui". If you type "Lascia qui tazza " it works.
2) If you want to avoid the "s" on the third-person singular you could change the Conjugate-function
Change the default from

default {
if (gender = "it") {
return (verb + "s")
}
else {
return (verb)
}
}

to

default {
return (verb)
}


1) You could add a new function similar to the conjugate function


<function name="Conjugate2" type="string" parameters="obj">
gender = obj.gender
switch (gender) {
case ("he") {
return ("lo")
}
case ("she") {
return ("la")
}
case ("it") {
return ("???")
}
case ("they") {
return ("???")
}
default {
return ("???")
}
}
return (verb)
</function>

You can call it like this: Conjugate2(object) in your dynamictemplate

Dont' forget to remove the original conjugate-function.

greenelvish
3) ok!
2) ok!
1) Perhaps I found a more simple way (I mean more understandable to me :| ). I just use article as a suffix so I can use "object.article", and sometime I change the "object.article" position (if the italian verb require it). For example, from
<dynamictemplate name="DefaultDrink">"Non puoi prendere" + object.article + "."</dynamictemplate>

to
  <dynamictemplate name="DefaultDrink">"Non "  +  object.article + puoi bere."</dynamictemplate>

or (leaving the original positions)
  <dynamictemplate name="DefaultDrink">"Non puoi prender"  +  object.article + "."</dynamictemplate>


Maybe it would be more elegant using and calling suffix directly, but I tried with "object.suffix" and it doesn't work (as I said, I'm not a programmer...).

I'm testing this solution and I keep on translating. Thanks for your help.

Pertex
greenelvish wrote:
Maybe it would be more elegant using and calling suffix directly, but I tried with "object.suffix" and it doesn't work (as I said, I'm not a programmer...).


I just tested object.suffix and it works. If you still want to use object.suffix, you could change your aslx and post it here again.

greenelvish
Yestarday I completed my translation, and I'm now working on a test game, in order to check my file and to improve my understanding of Quest's mechanism.

So, at the moment I will continue using obyect.article as a suffix (and the prefix as a undefinite article), and I postphone other questions to identify the essential ones.

Right now, I'd just like to refine some default answers. So, here is what I'm looking for:

1) how to obtain the first capital letter of obyect.article, when I need it.
2) how to associate (by a function, I think) a one-word-suffix to a gender, and call it.

Example:
EN: You take it
IT: Lo hai preso. 1) I need first capital letter in "Lo", and 2) I need to distinguish four possibilities: "pres/o" (masculine, singular), "pres/a" (feminine, singular), "pres/i" (masculine, plural), "pres/e" (feminine, plural).

Thanks.

Pertex
1) I am not sure what you want to do with this function, but here it is


<function name="GetCapital" type="string" parameters="obj">
return ( UCase( Left (obj.article, 1) ) )
</function>


2) Here is the function:


<function name="GetSuffix" type="string" parameters="obj">
if ( DoesInherit (obj, "masculine") or DoesInherit (obj, "male") ) {
return ("o")
} else if ( DoesInherit (obj, "female") or DoesInherit (obj, "feminine") ) {
return ("a")
} else if ( DoesInherit (obj, "maleplural") ) {
return ("i")
} else if ( DoesInherit (obj, "femaleplural") ) {
return ("e")
} else {
return ("")
}
</function>


and you can call it this way


<dynamictemplate name="TakeSuccessful">"Lo hai pres" + GetSuffix (object) + "."</dynamictemplate>


greenelvish
1) I'm sorry if you wasted your time because of my poor explanation. Looking more closely at the code, I found that I just needed
CapFirst(object.article)
Sorry again.



2) GREAT!

greenelvish
Hi,

I continue working on my test game, altough slowly...

In the meantime, after reading the Alex's post "“Play online” now works on mobile browsers" and with a view to make my game available on mobile devices, I'm trying to play online some games via ipad (with the default browser Safari). But I've encontered a lot of problems. I have no response after typing, or there's no introductory text, and when I tap on the "+", then I have no way of coming back to the game. Maybe I'm doing something wrong. Have you or Alex some tips about it?

Alex
Which games are you having problems with?

After clicking the "+" there should be a big button at the top of the screen that will take you back into the game.

greenelvish
Sir Loin 3: The Quest for the Holy Quail
The Things That Go Bump In The Night
The Mansion II
Welcome to Ponyville

Yes, I see the button, but it is small, empty and - most of all - doesn't work. Look at the screenshot.
foto.PNG

Alex
Odd - it works for me with that exact same URL:
photo (3).PNG


This is an iPad 2 running iOS5.

I wonder if you're getting any Javascript errors? If you go to the Settings app, then Safari, Advanced, turn on Debug Console - do any errors appear in Safari then?

greenelvish
I have the same, Ipad 2 and IOS5.

Debug Console says:
foto2.PNG

greenelvish
"Suggerimento" is suggestion.

"riga" is row.

Alex
The problem is that "Javascript execution exceeded timeout" error.

On iOS, Javascript only gets a certain number of seconds to run before it gets terminated. However, nothing on that page should be taking very long to execute.

A quick search shows me that there may be a bug in iOS Safari, where if one page gives you that error because its Javascript takes too long to run, other pages may be affected too.

The fix is to close all tabs and force-quit Safari (double-click Home button to bring up the task switcher, hold down the Safari icon until you get the "jiggly" icons, then tap the red minus sign in the top left of the icon). Please give it a go and let me know if that works!

greenelvish
ok! It works.

btw, it's possible to convert games to ipad app? "The Things That Go Bump In The Night" is made for Iphone, and I wonder if the ipad screen allows to show more informations at the same time (text, inventory, compass commands, etc)

Here is the info from Console: no more timeout.
foto.PNG

Alex
Excellent! Glad you got it working.

I'm planning an update to Bump that will give it a more iPad-friendly layout - at the moment it looks pretty bad on the iPad, especially with the 2x scaling.

Not sure at the moment if this will mean it gets panes like desktop Quest, or if it will just be full-screen text adventure (like play online).

greenelvish
Hi Pertex,

I need a little help...

1) I can't adapt the function that conjugate verbs. Output is always the third person (" e' ").

i.e.
> apri le sdraio
- traslation: "open deck chairs" - [inanimate objects (plural), but in italian I can use female characters (plural) as well]
e' gia' aperte.
- traslation: "is already open" - [inanimate objects (plural), but in italian I can use female characters (plural)]

2) How can I use the "open with" ("apri con") expression? In italian "to open" and "to unlock" are quite the same and they both can be traslated with "aprire", so I'd like to use "apri con" when I have to unlock something with something else.

Here is a small game file (la cavia.aslx, where I played around with "apri le sdraio") and italiano.aslx (btw: traslation is complete)

Thanks,

EV

Pertex
huh, this is hard for me to understand. I think you have to change the function Conjugate like this way. You have to replace the xxxxxx with the correct phrases


<function name="Conjugate" type="string" parameters="obj, verb">
gender = obj.gender

switch (verb) {
case ("essere") {
switch (gender) {
case ("esso") {
return ("xxxxxx")
}
case ("lui") {
return ("xxxxxx")
}
case ("lei") {
return ("xxxxxx")
}
case ("essi") {
return ("xxxxxx")
}
case ("loro") {
return ("xxxxxx")
}
default {
return ("e'")
}
}
}
case ("fare") {
switch (gender) {
case ("esso") {
return ("xxxxxx")
}
case ("lui") {
return ("xxxxxx")
}
case ("lei") {
return ("xxxxxx")
}
case ("essi") {
return ("xxxxxx")
}
case ("loro") {
return ("xxxxxx")
}
default {
return ("fa")
}
}
}
default {
return (verb)
}

}
</function>



2) Could you tell me your translations of "open chest" and "unlock chest"?

greenelvish
1) It works! Thought not at first attempt, because I didn't note that code is case sensitive, so I used i.e. "Loro" for template name, and "loro" for functions.

2) Open chest is "apri il baule", while unlock chest is... "apri il baule". That's the problem :( - And the same for close/lock, where in italian I use "chiuso" in both cases. Thanks again!

Italians verbs bloccare/sbloccare are particular traslations of lock/unlock, but they are used mainly in expressions like: "the deadlock has been broke" ("la situazione si è sbloccata") or "to defuse the situation" ("sbloccare la situazione") or even "unlock a wheel" - i.e. in a bicycle - ("sbloccare una ruota"), or "to pick the lock " (sbloccare la serratura con la forza).

If you see wordreference (http://www.wordreference.com/enit/unlock), you can read: unlock = "(with key) aprire". So, the translation is the same: "with key" is implied. If the chest is locked or if it is simply closed, in italian I say "il baule è chiuso". I can try to open it or to unlock it (with a key), by saying "Apri il baule".

We don't distinguish between "open" and "lock". So, to pick out a difference, in italian I can say "apri" for just opening and "apri con ("con" is with)" for unlock (with key). Or, if I have the key, I can say just "apri" to unlock (setting a flag, or doing a similar workaround) but sometimes is not an elegant way.

I hope my verbose explanation is clear enough...

greenelvish
:oops: I cut & paste a "Thanks again!" in the wrong place...

Pertex
I think we have to wait for Alex. I dont know how to do this

Alex
I can't think of an easy way around this, if there really is no way of distinguishing between "open" and "unlock" in the language then there's not really much that Quest can do. Perhaps just leave "unlock" as untranslated for now, and we'll need to encourage anybody creating games in Italian to leave the "automatically unlock if player has the key" option turned on for locked objects.

greenelvish
Thanks, Alex.

The "automatically unlock if player has the key" option is a good workaround.

When my translation will be ready, I will add a readme.txt to explain all these things.

greenelvish
Hi,

...getting an italian working version is a bit more complex than just translating... :shock: ...but it's worth it 8)

I'm stuck with "ask for". In italian is "chiedi a (object) di (topic)", with some variants - caused by italian function words - that I put in italiano.aslx.

   <template templatetype="command" name="ask"><![CDATA[^chiedi (?<object>.*) di (?<text>.*)$]]></template>
<template templatetype="command" name="ask"><![CDATA[^chiedi (?<object>.*) (?<text>.*)$]]></template>
<template templatetype="command" name="ask"><![CDATA[^chiedi a(?<object>.*) di (?<text>.*)$]]></template>
<template templatetype="command" name="ask"><![CDATA[^chiedi a(?<object>.*) (?<text>.*)$]]></template>
<template templatetype="command" name="ask"><![CDATA[^chiedi al(?<object>.*) (?<text>.*)$]]></template>
<template templatetype="command" name="ask"><![CDATA[^chiedi alle(?<object>.*) di (?<text>.*)$]]></template>
<template templatetype="command" name="ask"><![CDATA[^chiedi ad(?<object>.*) di (?<text>.*)$]]></template>


Now, if I type: "chiedi a troll Bob", it works. Instead, if I type: "chiedi a troll di Bob", Quest looks for "troll di", instead of just "troll", and of course replies with template "UnresolvedObject" - "I can't see that (troll di)" -
Maybe only a template is allowed? So it seems if I show library elements and look for ask command: there's only one pattern there.

btw: I see at http://www.textadventures.co.uk/forum/viewtopic.php?f=10&t=2782 that bug on "AskDefault script not running" was fixed by Pertex (http://quest.codeplex.com/workitem/988). But I encountered right now the same problem (last topic wrongly used for unresolved topics). Attached "test.aslx" can be checked for this issue, too.

Thank you.

Alex
That bug was fixed for v5.1.1 which has just been released (like, a few minutes ago!)

You should see an update notification next time you start Quest, or you can just download it immediately from http://www.textadventures.co.uk/quest/download/

Alex
And regarding your template problems, it's only verbtemplates that let you specify multiple variations in that way. For regular expression templates, they must all be on one line, otherwise you will only get the final template in the list.

So your template should look something like this:


<template templatetype="command" name="ask"><![CDATA[^chiedi (?<object>.*) di (?<text>.*)$|^chiedi (?<object>.*) (?<text>.*)$|........]]></template>

Alex
Doh, now that I look at it, I've merged Pertex's fix into the "default" branch which is Quest 5.2, so this fix is not in 5.1.1.

greenelvish
Thanks, Alex. For my purpose, it's more important multiple variation, now.

I put all variations on the same line:

 <template templatetype="command" name="ask"><![CDATA[^chiedi (?<object>.*) di (?<text>.*)$|^chiedi (?<object>.*) (?<text>.*)$|^chiedi a (?<object>.*) (?<text>.*)$|^chiedi al (?<object>.*) (?<text>.*)$|chiedi alle (?<object>.*) di (?<text>.*)$|^chiedi ad (?<object>.*) di (?<text>.*)$]]></template>


But in some cases it still doesn't works.

Example 1: OK
chiedi uomo di birra
ecco qui la tua birra

Example 2: OK
> chiedi uomo birra
ecco qui la tua birra

Example 3: KO
> chiedi a uomo birra
Non vedo nulla con questo nome [I can't see that]. (a uomo)

Example 4: KO
> chiedi alle uomo birra
Non vedo nulla con questo nome [I can't see that]. (alle uomo)

Where's my mistake?

Alex
It's probably to do with the order within the regex. You have "^chiedi (?<object>.*) (?<text>.*)$" quite early on in the regex, which will match "chiedi a uomo birra", but probably with object="a uomo".

What is the meaning of "di", "al", "alle" etc.? Maybe the regex would be simpler if you added these to ParserIgnorePrefixes, then they could safely be part of the "object" group.

Also, you're going to run into problems with a regex like "^chiedi (?<object>.*) (?<text>.*)$", because there's only a space separating the object and the text. This is fine if "object" or "text" never contains a space, but that's not always the case.

greenelvish
Alex(ander) the Great!

With ParserIgnorePrefixes you solved also another issue I've encountered. I've just discovered a secret for a polite italian gameplay... simply ignore all prefixes. Now the player can use all articles, function words, etc... and, trust me, we have a lot of them, and sometimes with spaces and sometimes with apostrophe (for the apostrophe I set a specific alternative name).
Just for sharing my efforts, here are some examples: l'uomo/gli uomini/all'uomo/agli uomini [the man/the men/to the man/to the men] or un uomo [a man] or un'astronave [a spaceship].

Walking on the way to perfection :) , can I apply the same trick to "text" in the ask/tell command, or - it would be the same - can I set a topic that contains spaces? I tried to set topic with spaces in the editor, but editor itself uses spaces to separate topics; then I tried to insert some words in ask template - as a variation, on the same line - but it works in a irregular way (it seems depending by the order of variations) and it arise again the logical issue you've just solved.

Here is an example where "text" should be "la birra":

OK
> chiedi al tipo birra
ecco qui la tua birra

KO
> chiedi al tipo la birra
Non vedo nulla con questo nome [I can't see that]. (all'uomo la)

thanks again

Alex
Spaces in ask/tell topics separate the keywords, and Quest tries to find the best match for the user's input. So you can have topics of "restaurant food dinner" and expect that the player would type "ask person about food", "ask person about dinner" but they could also use multiple words - "ask person about restaurant food" is also a match.

So, because an object name can contain a space, you'll need something to separate the object from the topic. If the English template were "ask #object# #text#", then there is ambiguity if the player types in "ask dave the shopkeeper travel book". There would be many possibilities:

- object = "dave", text = "the shopkeeper travel book"
- object = "dave the", text = "shopkeeper travel book"
- object = "dave the shopkeeper", text = "travel book"
- object = "dave the shopkeeper travel", text = "book"

The DoAskTell function (and the Core.aslx parser in general) are not sophisticated enough to do the back-tracking required to resolve this. The parser wants to know what the player input for "object" and "text" are before it actually resolves the object, so it can't go back and change its mind about what "text" is after it has tried various options for "object".

This means you need some kind of separator word (there could be multiple options). In English we're using "ask #object# about #text#", so the word "about" separates "object" from "text".

greenelvish
ok, it's clear. The template #object# about #text# is too... essential. That is why I like the english language. :)

I'll look for some workaround paying attention to keep dialogs as simple as possible; and I'll add a warning message into the readme.txt about available templates, and in the HELP command too.

timetolose
Hi all,

Mr. GreenElvish is doing a very good job on an italian translation. I'd like to help him, but I have something to ask.

It is possible to upload the translation file online to test it using the Web Editor? (Other translations are already available).

Then, can we upload by ourselves new updated versions of our translation, day by day, week by week?

[I work most of the time on a Mac and on it I can use Quest only online).
cheers,
Francesco Cordella

Alex
There's no automatic mechanism for doing this yet, but I can update the file manually.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums