Turning off auto-update via script.

More
5 years 4 days ago #4015 by Cvita
As far as I understand now, my online app (APK) will auto update from Google Spreadsheet. If there are any changed translations, they will automatically be updated. Is that correct?

I will assume that it is. So my questions is: how can I turn off this auto-update during run mode on the device (via script of course)?

Reason for this is that I am doing a build for asian market and I can't have it contact outside (especially not google). But I want this to be disable only when making this build (for all others I'd like to have it enabled) so I thought it would be the easiest to just do via a script.

Please let me know what you think!

Kind regards,
Kreso

Please Log in or Create an account to join the conversation.

More
5 years 2 days ago #4019 by Frank
Hi,
Currently there is no way to skip the auto update on startup if it was scheduled. For the next release I'm going to add a callback to allow you customize that.

For the moment what you can do is:
- Disable Google Live Synchronization by default (set it to NEVER)
- Create an script in one of your first scene game objects and in its Start method do:
   if (ShouldSyncFromGoogle())
   {
       LocalizationManager.Sources[0].GoogleUpdateFrequency = eGoogleUpdateFrequency.Weekly;
       LocalizationManager.Sources[0].Import_Google(false, false); 
   }

- Define ShouldSyncFromGoogle to return false in the Asian markets, etc.

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 following user(s) said Thank You: Cvita

Please Log in or Create an account to join the conversation.

More
4 years 2 months ago #4166 by Frank
For reference: The new version of I2 Localization (v2.8.14) now allows skipping google sync from scripts.

Just create an script inhering from RegisterCallback_AllowSyncFromGoogle and add it to your first scene:
using System;
using UnityEngine;
using I2.Loc;

    public class AllowSyncFromGoogle : RegisterCallback_AllowSyncFromGoogle
    {
        public override bool AllowSyncFromGoogle()
        {
            if ( IsAsianMarket() )
                  return false;
            else
                  return true;
        }
   }

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

Please Log in or Create an account to join the conversation.

Time to create page: 0.125 seconds
Template by JoomlaShine