Page 1 of 1

Could localization dynamic load a file to set the Dialogue language in running time?

Posted: Tue Jul 06, 2021 4:54 am
by shortlin
Hi Tony,First.Our game has been published in the steam.I am so so thank you helped me a lot in the past.

But I am sorry still ask the question again.
My question is :
"Could localization dynamic load a file to set the Dialogue language in running time?"

As I said our game is published in the steam.We want to add two languages in our game in the future.

I have followed this tutorial:
http://www.pixelcrushers.com/dialogue_s ... ation.html
to finish three languages.

But we found if we want to add 2 languages.we must add two columns for the new languaegs in a database.
We are afraid it would let the database too big to load(we now use the database in Unity editor mood sometime would be very slow).
I knew we could separate the database to a lot of databases.But I think if there a way we can load the language that the user indeed need in running time.maybe it would less the loading time.
We are afraid if we add more lanuguage,the loading would be more slow.(And if we must separate the database...I think I should write a tool to do this..)

So is there a way to make it?Thank you

Re: Could localization dynamic load a file to set the Dialogue language in running time?

Posted: Tue Jul 06, 2021 8:48 am
by Tony Li
Hi,

Congratulations on releasing your game!

I recommend testing the time with all languages in one database. It will probably still be fast to load at runtime. Even though the Unity editor can be slow when editing large assets, the runtime will not be slow for players.

If the only issue is the Unity editor speed, consider splitting your multiple databases. (See Working With Multiple Databases.) For example, if the player can travel to 3 villages in your game, make a database for each village. Use Extra Databases components to load the database when the player enters each village scene.

Otherwise, if loading at runtime isn't fast enough for some reason, you can use the OnConversationLine and OnConversationResponseMenu script methods to fill in the translation at runtime. Example:

Code: Select all

void OnConversationLine(Subtitle subtitle)
{
    // Call your custom GetTranslation() method (not defined in this example):
    subtitle.formattedText.text = GetTranslation(subtitle.formattedText.text);
}