How to autoupdate a text from online spreadsheets?
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?
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,
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
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.
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:
Hope that helps,