Welcome, Guest
Username: Password: Remember me

TOPIC: How to autoupdate a text from online spreadsheets?

How to autoupdate a text from online spreadsheets? 4 months 1 week ago #3087

Version: 2.8.6 f2

I followed this guide:


And at the end of the video (minute 3:15) it says "Once this setup is completed, the game will be updated even when running on the devices". I am doing tests and if I just change a text in the spreadsheet, it doesn't auto-update ingame (tested on a builded version and inside unity) unless I re-import the spreadsheet manually using the import buttons.

My settings are set to update always but it doesn't autoupdate. Maybe im understanding this wrong, is it that when changing a text in a spreadsheet it autoimports in the game also?
Last Edit: 4 months 1 week ago by BinarySouls.
The administrator has disabled public write access.

How to autoupdate a text from online spreadsheets? 4 months 1 week ago #3088

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 1129
  • Thank you received: 241
  • Karma: 70
Hi,
Three things to look for:

1- The auto-downloading doesn't happen while you are in the Editor. When you are playing inside the editor, the plugin assumes that the Editor data its the important one, otherwise you would have synched it with Google.
For the downloaded data to work, you have to be playing in a device or a PC build. Also, notice that the download only happens when you start the game.
BTW, In 2.8.7 there is a warning showing in the LanguageSource while you are in the Editor, in case the Spreadsheet is not up-to-date with the Editor. That way you are remembered to sync in the editor.

2- To avoid constantly checking the Spreadsheet for changes, the downloading only happens when the game starts. So, if you made any change to the spreadsheet, you should close the game in the device and run it again. If the UpdateFrequency is meet, then it will download the change.

3- Google sometimes doesn't change the spreadsheet timestamp for small changes. This doesn't happen often, but I have seen it happen. So, after any change, to the spreadsheet, open the google drive and verify that the date of last modification for the spreadsheet was updated by google. The plugin uses that date to decide if there was any change.

Hope that helps,
Frank
Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out
The administrator has disabled public write access.

How to autoupdate a text from online spreadsheets? 4 months 1 week ago #3093

Yeah I know about that warning, it is also in 2.8.6 f2 when triggering the text, thats why I decided to test it in a builded version of my project because I understood that the Editor version needed to be updated manually.

Tried again now checking the timestamp and the timestamp updates but the text remains the same in the builded version of the project (closed the project completely and then opened again).

PD: Just did another build just in case and the same. Maybe I did something wrong when printing the text. I'm using a field of type LocalizedString and then selected the Term to print it, tell me if its not correct or something, all the videos and documentation I find doesn't finish or show how is this updated step by step, I followed the video as I told you and then just used a LocalizedString with the term im changing directly in the spreadsheet.
Should I build it in a certain way or with some configuration?

EDIT: In Terms menu I see every term I have is set as "Not Used" but my scene where I use it in a LocalizedString is parsed, why does this happen and could it be because of that? i.imgur.com/IAbi9hD.png, i.imgur.com/hdCLpFc.png, i.imgur.com/j2PmExy.png

EDIT2: I tested on a fresh project and also noticed than when I hit play, the translation of the default language is removed while in play mode. I filmed a video: gfycat.com/AllFreeKid
Last Edit: 4 months 1 week ago by BinarySouls.
The administrator has disabled public write access.

How to autoupdate a text from online spreadsheets? 4 months 1 week ago #3096

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 1129
  • Thank you received: 241
  • Karma: 70
I tested on a fresh project and also noticed than when I hit play, the translation of the default language is removed while in play mode. I filmed a video: gfycat.com/AllFreeKid

In that video, the main language is the Spanish.
inter-illusion.com/assets/I2Localization...InitialLanguage.html

The language order, its only used the first time the game plays. Buf if you switched languages (by either running an example scene and clicking a button, or by clicking the language name in the inspector), then that selection is remembered and saved to the PlayerPrefs. Then everytime you run the game it will use that language as the initial one.

You can delete all the playerprefs saved values and it will revert to english. Or simple 'select' english and it will keep that one loaded on startup.
In Terms menu I see every term I have is set as "Not Used" but my scene where I use it in a LocalizedString is parsed, why does this happen and could it be because of that? i.imgur.com/IAbi9hD.png, i.imgur.com/hdCLpFc.png, i.imgur.com/j2PmExy.png

LocalizedStrings are not currently parsed. (they don't add the usage), I will fix that ASAP.
PD: Just did another build just in case and the same. Maybe I did something wrong when printing the text. I'm using a field of type LocalizedString and then selected the Term to print it, tell me if its not correct or something

Notice that the downloading happens on the background. So, if you are printing the value on Start, it will show the old translation. You would have to print the value after the translations are downloaded.
You can easily check to see if the downloading work, by adding a UI Text to your scene, add a Localize component and set a term. When translations are downloaded, the localize component will update correctly.

If you need to update things on code by using LocalizedString, then you should register to the LocalizationManager.OnLocalizeEvent.
So that everytime the Language changes or new data is downloaded, you could query the value of the LocalizedString.
If you just need to know when data was downloaded, you can use this instead:
LocalizationManager.Sources[0].Event_OnSourceUpdateFromGoogle

Hope that helps,
Frank
Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out
The administrator has disabled public write access.
Time to create page: 0.402 seconds
Colors