Forum rules - please read before posting.

Localization Plugin

Hello! Want to know if there is any issue using Localization plugin with AC. Because I was translating my game, but for example I don't see if I can also translate custom text or graphics and also using the pseudo localization. In Localization Unity Asset I can also change sprites for localization, but really don't know how to implement with AC.

Thanks in advance.

Comments

  • AC integrates with Localization in two key ways:

    1. Text lines gathered in the Speech Manager can be synced with Localization entries.
    2. The game's language can be synced with the Localization language.

    "Custom translatables" (see the Manual chapter of the same name) will also be included here.

    For other data, such as localized sprites: these will sit alongside your AC project, but will need to be accessed via custom script - as it'll be a case of reading the unique Metadata associated with your tables, e.g:

    https://forum.unity.com/threads/how-do-you-get-a-localized-sprite-from-assettableentry.1171319/

    To have AC call this when e.g. a scene is opened, or the language is changed in the Options menu, use the Events Editor to run either the Object: Call event or Object: Send message to invoke your custom script function.

  • And there is a way to also have the localization package on my project? or will make conflicts on the script? Because with Localization there is just a drag and drop sprite changes.

  • edited April 30

    Also, with pseudo localization, it chooses language automatically. I have done in some small apps i have done before. So is also a way to activate it with the AC localization? or is better than to use just localization asset instead of AC one? I'm saying that because when i "Gather text" there is some stuff it didnt detect like some notes I'm adding on GameOver and Credits UI.

  • And there is a way to also have the localization package on my project? or will make conflicts on the script? Because with Localization there is just a drag and drop sprite changes.

    I'm not sure I'm following you 100%, but each of the AC/Localization integration features are optional. Having Localization imported into your project won't make any changes by default.

    I'm saying that because when i "Gather text" there is some stuff it didnt detect like some notes I'm adding on GameOver and Credits UI.

    Are ungathered text linked to AC via e.g. Menus in the Menu Manager? AC will only gather text that it can detect as being a part of itself - e.g. a Label element inside a Menu.

    If you want to include text that's not associated with AC explicitly, you can attach a script that derives from ITranslatable to have it be picked up.

    See the Manual's "Custom translatables" chapter for details on this, as well as the included CustomTranslatableExample script.

  • edited April 30

    ok, will check and came later. I have installed Localization and haven't give me any issue for now.

    But my last question regarding this part :# , if there is an option to localization is detected automatically? So, it just adds text depending on phone language configuration, such as in localization asset. Or need an extra coding? Because when I preview on Editor, I change language there with pseudo localization, I see just the Localization Asset changes, not the AC translations. :#

  • Pseudo localization won't affect the raw data in the Speech Manager, but if a gathered line has Rely on localization? checked, then it should display the pseudo translation as with any non-AC text.

    You'll need to make sure Auto-sync Locale with Language? is unchecked in the Speech Manager, however, as this will affect the selected Locale automatically, overriding the switch to Pseudo via the Locale Game View Menu.

    If things still don't show correctly, best to share screenshots so that I can understand your exact setup.

  • ok, now I'm a little more lost. What's the quickest and easy way to just auto translate with just the speech part? Don't care if i can't see on editor, just need to know if I can do autolocalization with speech and hotspots. So I can see on build without having to add a button to switch language.

    Or there is a way to Rely on localization all the text as once? or I need to do one by one? Maybe will be easier that way so I can do translation directly on Local Tables?

  • The quickest and easiest way to test a translation / autotranslation is to use AC's text exporting feature, rather than Localization.

    After gathering your text into the Speech Manager, create a new Language underneath "Original". This will create a new language, using the text from the Original language by default.

    Then, click the cog icon beside it and choose Export, and use the Export Wizard window to export the language as a CSV file (optionally checking Filter by type? to only export Speech and Hotspot text).

    This'll give you a spreadsheet file with a column of strings for the language's text. Run this through a translator (automatic or otherwise), and re-import using the cog icon's Import option to update the language within the Speech Manager.

    You can then force the game to use this language instead of Original, by checking Is disabled? under the Original language's properties.

    Or there is a way to Rely on localization all the text as once? or I need to do one by one? Maybe will be easier that way so I can do translation directly on Local Tables?

    Mapping AC text lines to Localization entries is a case of selecting them in the Speech Manager and using the Localized string UI to create/select an entry to link it to.

    This field can be accessed through scripting, however. Updating Localization tables is a bit tricky to do through code, and will depend on your exact needs, but the localizedString property for a given speech line can be gotten with:

    AC.KickStarter.speechManager.GetLine (lineID).localizedString;
    

    Similarly, all lines can be accessed with:

    foreach (var line in AC.KickStarter.speechManager.lines) { }
    
  • Ok thanks! I have to admit that I get very lost with your explanation, localization is not very easy in here. :'( . I think the better way is making one by one and create a new entry. Thanks, maybe still too noob for such a complex stuff. :'(

  • edited May 8

    Ok, after some days i decided to get rid of Localization plugin, it giving me a lot of headaches trying to mix both of them, what i need to know then is what do i have to do to, instead of using a button to change language, to use phone language, is there a way to do in AC? Like Localization do and if i need to add a custom script and where? :'(

  • edited May 8

    You can set the AC language manually with the SetLanguage function. If you have a language index for a given system language, you can set it based on that:

    using UnityEngine;
    using AC;
    
    public class AutoSetLanguage : MonoBehaviour
    {
    
        void OnEnable () { EventManager.OnInitialiseScene += OnInitialiseScene; }
        void OnDisable () { EventManager.OnInitialiseScene -= OnInitialiseScene; }
    
        void OnInitialiseScene ()
        {
            if (Application.systemLanguage == SystemLanguage.French)
            {
                Options.SetLanguage (1);
            }
            else if (Application.systemLanguage == SystemLanguage.English)
            {
                Options.SetLanguage (0);
            }
        }
    
    }
    
  • edited May 10

    Ok, i was trying to test this, but not sure how. I already do translations with AC and reimported as the manual said, tested with button and worked. So now figure out how and where to attach the script? Sorry, feel so dump in this part.

  • No worries. Place the code in a C# script named AutoSetLanguage, and then place it in on an empty GameObject in your game's opening scene.

    Alternatively, you can do away with the events, and instead make it a public function, i.e.:

    using UnityEngine;
    using AC;
    
    public class AutoSetLanguage : MonoBehaviour
    {
    
        public void SetLanguageFromSystem ()
        {
            if (Application.systemLanguage == SystemLanguage.French)
            {
                Options.SetLanguage (1);
            }
            else if (Application.systemLanguage == SystemLanguage.English)
            {
                Options.SetLanguage (0);
            }
        }
    
    }
    

    You can then attach to a prefab, and call via the Object: Call event Action in your ActionList when start game asset file, to have it run regardless of which scene you start from.

  • Perfect! Everything works. Thanks a lot! The only issue and don't know why, the only elements are not translating are the interaction text. :S

    Here how i have the configuration.

  • The text shown in the screenshot are your cursor icon labels - can you show where/how they are displayed in-game, along with your full Settings and Cursor Managers?

    What are your AC and Unity versions also?

  • edited May 12

    Ok, hoping this works?

    https://ibb.co/gwP7P0n
    https://ibb.co/QjQxzq3
    https://ibb.co/p22NpSj
    https://ibb.co/0qFfWJM
    https://ibb.co/n156ZMt
    https://ibb.co/grTq4ky
    https://ibb.co/2KQFYqL

    Dont know how to attach many images :S.

    About AC and Unity, Unity latest LTS 2022.3.26f1 and AC 1.80.5

  • edited May 12

    Thanks. Should just be a case of checking Use TMPro components? in the Menu's properties - it'll be trying to affect a regular Text component, rather than a TextMesh Pro U GUI one otherwise.

  • Feel so dump. It was that :D . Thanks a lot!

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.