Forum rules - please read before posting.

Dev - Arabic sentence creation when dragging items on hotspots

Hi Chris,

I have a commissioned project which includes Arabic translations, so far we have managed to fix and display all the Arabic translations in the right way, but there is one that I cannot fix as I don't know where to look at so maybe you can give me a hand here. 

The issue is related to dragging items on hotspots, the composed strings are located on RuntimeInventory.cs like these lines of code:

                return (prefix2 + " ");
                return (prefix1 + " " + itemName + " ");
                return (itemName + " " + prefix2 + " ");
                return (prefix1 + " " + itemName + " " + prefix2 + " ");

So what I do is reversing the order to make it look right in Arab:

                if (languageNumber == 1) //Which is Arabic in my game then
                    return (" " + prefix2);
                    return (" " + itemName + " " + prefix1);
                    return (" " + prefix2 + " " + itemName);
                    return (" " + prefix2 + " " + itemName + " " + prefix1);
etc...

But I cannot find where you compose the string like "Use Glass On Pedestal", which I guess it should be something like (prefix1 + " " + itemName + " " + prefix2 + " " + hotspot.name)

Can you help me here?

Thank you very much for your time and effort, keep the good work.





Comments

  • edited April 2017
    I think you're looking in the right place (GetHotspotPrefixLabel method) but AC doesn't seem to handle different logic for composing this out of the box.

    Chris is taking a well deserved break, so it's down to the community to provide support at the moment ...

    Anyway, I seem to remember making a local change to this about a year ago to support languages where some prepositions change the form of some nouns, but that code is now buried deep in my set of backups ... :-/

    To make things clearer: "Glass" is the inventory item, and "Pedestal" is the hotspot, right?

  • "Glass" is the inventory item, and "Pedestal" is the hotspot, right?

    Your guess is right and thanks to you for your comment, if you find that local change please give me a shout.

  • Thinking more about it, I'm not sure how much help my local hack would actually be in terms of solving this specific problem ...

    But, wait a minute ... Arabic is rendered right-to-left, but should the actual sentence structure/composition also be reversed from English???

    I don't know Arabic, so it would be great if someone with more knowledge on the subject could chime in!
  • The thing is that the English string is composed in that script like this:

    return (prefix1 + " " + itemName + " " + prefix2 + " ");

    So reversing that "return statement" returns the correct sentence in arabic like:

    return (" " + prefix2 + " " + itemName + " " + prefix1); 


    the issue is that I cannot find where AC is adding the Hotspot name to that sentence structure.


  • An idea for a quick solution which doesn't require changes to the code: would it work correctly if you just swapped the text in the prefix fields for Arabic in the inspector?
  • The exact location may vary slightly depending on circumstance / interface options, but generally the complete label for a Hotspot is pieced together in Hotspot.cs' GetFullLabel function.

    This function firsts generates the "use X on " prefix, followed by the name of the Hotspot itself (according to the current language).  Putting the Hotspot name first should be a case of simply swapping the operations around.

    As a non-Arabic speaker, it's difficult to know exactly where such changes are necessary - if you can share your insight as you go here, I may be able to add them officially in future.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.