Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

1.1 commands are broken in Hungarian

A topic by komarcell created Dec 22, 2023 Views: 279 Replies: 13
Viewing posts 1 to 8
(2 edits)

ISSUE WAS SOLVED: issue was caused by unterminated parentheses in the regex.

Hi!

I was pretty much done with everything and in the previous version everything worked fine, but now that I updated (and cleaned) my translation to the new 1.1 game version, the commands are broken in a way that I can't even begin to understand.

Basically, everything is fine, until you make a typo, look for something that is not present in the current room, or drop something that you have already dropped (there might be other issues, but this is what I found so far).

I have a few ideas. Hungarian verbs in their imperative form are often composed of two words, where the prefix gets removed from the verb and gets put after the verb (i.e. megfogni (take) --> fogd meg (you take, imperative). I played around a lot with regex to make the game understand these verbs with all of their variations and synonyms, and everything worked perfectly in the previous version.

All of the commands still work, but only if you don't accidentally make a typo somewhere. I don't understand why this happens. Maybe something having to do with the default messages of the game?

To be fair, I may have maken a mistake somewhere in the code, but it's so long and I'm working on this alone, that I have no clue. I'll keep looking for mistakes and update or delete this post if I find anything.

Gibberish gets interpreted correctly as gibberish, everything works perfectly until you make a mistake, then the game just breaks.

I have a couple of screenshots, explaining the issue. They are in Hungarian, but I added a few notes to make the issue a bit more clear.

THANKS IN ADVANCE :)

Example 1: taking the parachute


Example 2 (whatever comes after the object gets ignored, this is perfect for the Hungarian case system) :

(1 edit)

I THINK this is due to the prepareInputStep  where blank spaces are replaced a code 32 single-space ( "printable space") instead of the regular blank space which you typed.

Try commenting out lines 528-531 or thereabout

/* 
{                 
    pattern: ` +`,
    replaceWith: ` `
}, 
*/
(1 edit)

Hi Gnou, this does not solve the issue unfortunately :(

Edit: it was my fault all along, regex is not fun

Hi @komarcell.

can you open the browser console and take a screenshot of the error message?

Or better, (if you prefer), can you share (with me) your code so I can try and help you?

(1 edit)

+++ Solved: it were in fact unterminated parentheses. Mea culpa. +++

Hi Federico! Thanks for the help! The console says "SyntaxError: unterminated parenthetical"

Does this mean that I have forgotten a parenthesis somewhere? :)

(How can I share the code with you? On Discord?)

Screenshot:

Hi :) Sorry for the total off-topic, but… I looked at one of the screenshots provided above… does it mean that in version 1.1 commands containing accented letters (diacritics???) are supported?(I am yet to begin testing my Polish localization, because I was checking the regex time and time again, and I STILL believe some error(s) will pop up anyway!)Because it (if I remember right) wasn’t the case before, and the Alt key was a ”dead” one. So that is now fixed, it seems :) great! Best regards, Natalia Ryś

P.S. Also…for our translation file to be recognized (loaded) by/into the game it needs to bear the name of the original one “l18n.js“, correct?(Those en-GB and it-IT files were just there to help in translation.)And then we replace the original l18n.js (In v.1.1 it displays the game in English, if I remember right?) with ours…and voila! The game is now in(in my case at least) Polish…is it how we do it? Also please remind me: what is there to translate (if anything) in the game’s engine…? Because there was something…or was this content moved to the l18n file in the updated version?

Big apologies for the wall of text! :(

Hi! :)

As for diacritics, the solution that worked for me was writing the words without them in the "pattern" fields (the user input) and then normally in the label/description fields (the displayed text). The engine just ignores special characters when inputting commands, so it works just fine with Hungarian.

And yes, the game loads only i18n.js, the other files are there just for reference, if I'm correct.

Also, if I'm not mistaken in the new version you should have translatable strings only in the i18n.js file.

(2 edits)

Hi Natalia

the Engine replaced all special characters with their normalized version and LOWERED it:

For instance:

ÇÀÉÙ

become:

caeu

In the pattern you must use the simplified version for recognition (no accents, no upper words ecc):

pattern: `caeu`

In the labels, descriptions, answers ecc.. you can use what you want.

check the simplified  string in the browser console log.

All special keys now shouldn't appear (DEAD/META/UNDEFINED ecc..) If I missed one please tell me.

The file loaded into the game is 18n.js so that's the file you should edit.

In the 1.1 version of AnC i18n.js is a copy of the en-en.i18n.js file, the unofficial english version.

For instance, The engine file shouldn't be touched. You can  edit, in case, AvventuraNelCastello.js if you want, for example, to change the labirynth behaviour... but IMHO it's really hard work. All the misssing parts should be in the i18n.js file now.

:)

I’m sorry for being a nuisance… but where is this “label” line (in regards to verb thesaurus) at? (Because apparently in labels I could put verb forms with diacritics for them to display properly). All I see is the ”pattern” line, which does not accept diacritics. I include some pictures of the “verbs” section from my translation for reference :)

(3 edits)

well, in this section there are no labels (you don't Need them).

Labels are only used and shown in objects (that are listed in "what i see" part)

Hello again! I apologize for asking about stuff so frequently, but this LocJAM is my first, and as such, I have some doubts(and besides, I’d rather ask too many questions than break something!) So! In my translation of the game, I worked on the i18n.js file-as intended. But I did it via a CAT tool. And after I was done, the CAT tool attached a target language code to the name of my Polish file!(as they normally do)Basically, the name of my localized file is: i18n_pol.js. And that _pol suffix is the issue-with that attached it’s the wrong file name! It is not going to work with that bit. But what do you think is the best course of action:

1. Get rid of that _pol bit in my translation file name—>the system is going to complain(well, WARN me)about there being TWO i18n.js files in the folder and whether I wish to overwrite one with the other—>allow the overwrite

2.OR: FIRST remove the English/original i18n.js file (but is that even something we can do? It is essentially meddling with the file structure in the folder) THEN rename my i18n_pol.js to i18n.js and it SHOULD work(also, it would do so WITHOUT raising any “file conflict“ alarms-seems less confusing)?

Again, I apologize for my indecisiveness and an awkward issue(or if I basically REPEATED myself with these two methods)…but like I said: I’d rather risk a weird question than ruin my weeks worth of work! Natalia Ryś

Feel free to remove / delete / overwrite the i18n.js that is currently in the folder - it is the same as the en-gb.i18n.js file in the same folder!

What you can do is rename i18n_pol.js to pl-PL.i18n.js (assuming you're using standard Polish) then make a copy of that file and rename the copy to i18n.js, to replace the current one.

1) when you upload the game it only run from the i18n.js file

2) it's still a good idea to save your own work in a few places, including elsewhere on your computer, just in case.

3) it looks like there is a plan to add a language selector to the game, so that pl-PL.i18n.js will be ready to go :)

Hi! I am part of a locjam team that is having a problem similar to the one described in this post. Specifically, the error we are getting is: Erro: Uncaught (in promise) SyntaxError: unterminated parenthetical.

The issue is that we don't know where exactly the code is broken (or we don't have the necessary tools to fix it).  The export to memoQ we have done according to the regex rules that were available in the specific post for it, so we have no idea how to fix it. Still, as we are already in a hurry, we have uploaded our version: https://savyna.itch.io/aventura-no-castelo

We hope it can be solved sooner or later with some advice or solution you can provide us :( Thanks in advance :)