Google Sync Does not work at all

More
9 years 8 months ago #306 by Stehlik
Hi,
I just bought your plugin which looked like it would solve all my problems with localizations..
Ehm...

I did all steps by the documentation.
1) created the googleService.
2) created new google document directly from your plugin.
3) then I started to fill my Terms with data

happy with the result I hit button "Add keys to source" even I dont know what that did,, Suppose to create c# file I guess with all keys...
then I hit export / replace also I tried new, progressbar spins and browser opens.
and after that the browser opened with no translation and it was completely blank.
After I hit play in Unity my translated data were gone even in Unity.
I restarted Unity, I tried create new file from plugin, nothing worked.
So I wasted my 5 hours of life.. thanks.

I checked your code and I must say, what a mess :(
I dont want to be rude, just It could be much simpler to read and understand.
I wrote some plugins too, so I know it is not easy to come up with easy API.

I was super happy when I understood how the DB was loaded so I can create my own PropertyDrawer for easy TERM dropdown selection, because in most cases I dont need to show all the mess with translations and so on,
I work mostly with Keys so I want mostly to see Keys, thats the reason why I did the propertyDrawer in firstplace.

But back to the problem.
How should I sync my Google Drive Document ?

I was using 5 languages.
Czech, English British, German Standard, Russian, French Standard
and used auto translation from Czech.
nothing special...

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

More
9 years 8 months ago #307 by Stehlik
OMG :-/

So After that incident which I sent now It started magically working...
I dont understand...

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

More
9 years 8 months ago #308 by Stehlik
But still, I think that it is not good behaviour that
when you hit Play and on Google docs there is different or no version
it will destroy your sources in Unity..
That is a big no no for me...

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

More
9 years 8 months ago #309 by Stehlik
This is the most Hacky API I had seen in Years :D
I have to call CurrentLanguage to initialize the DB in Runtime ???

Because you know, there still live people who want to create own components and use your system as an core base
not as an final solution.

I would suggest to rethink the whole API and naming and it would be superb :)

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

More
9 years 8 months ago - 9 years 8 months ago #310 by Frank

happy with the result I hit button "Add keys to source" even I dont know what that did,, Suppose to create c# file I guess with all keys...
So I wasted my 5 hours of life.. thanks.


Hi, Its always a good idea to check the doc and tut before hitting a button. That could save you 4 hours of your life :-)
The plugin doesn't create by "magic" any C# with all the keys (there is a tool in the Tools section that creates the C# if you want). But normally all keys are stored withing the I2Languages.prefab.
When you Add keys to source, that key is added into that prefab.

then I hit export / replace also I tried new, progressbar spins and browser opens.
and after that the browser opened with no translation and it was completely blank.
After I hit play in Unity my translated data were gone even in Unity.


If you created a language source within your scene (which is not the recommended approach) and exported that empty (because as you imply all keys were added to the prefab instead) then it will show empty in google as it was empty in your source.

But still, I think that it is not good behaviour that
when you hit Play and on Google docs there is different or no version
it will destroy your sources in Unity..


Thats the behavior you will get when things are wrongly setup. If you linked a google spreadsheet to your source, then when you hit play, if that spreadsheet has data different from the one in your source, all will be downloaded and replaced. That way you are up to date with whats in the spreadsheet.

You linked your spreadsheet so the content in there is the "official" one. If you don't want to download data from the spreadsheet, just unlink it by selecting "none" as the spreadsheet. That way, when you click Play it won download anything.

I'm finishing version 2.3.1 that introduces more filters for that (like download only once a day, a week, editor only, etc)

I checked your code and I must say, what a mess :(
I dont want to be rude, just It could be much simpler to read and understand.


As projects go bigger they loose the simplicity by default. The localization plugin has evolved to be far more than a simple dictionary and allows for integrating with lot of other plugins. So the entire design has to provide lot of callbacks and hook locations to allow for the integration.
Now that the main features are implemented, it will come some cleaning passes so that most programmers could understand it.

I have to call CurrentLanguage to initialize the DB in Runtime ???

Because you know, there still live people who want to create own components and use your system as an core base
not as an final solution.


Again, its a good advice to read a bit the documentation and tutorials. I know the documentation is bad and not entirely finish, but it will give you an idea of how to use the plugin.

You don't need to call anything to initialize the DB (in fact, DB its only used within the editor). All its lazily loaded/executed as soon as its needed.

You only need to call CurrentLanguage if you want to change the language. Normally that language is saved and restored when you run the game again. By default it uses the first language in the source or the device language.

Because you know, there still live people who want to create own components and use your system as an core base
not as an final solution.


I don't see how you can't not use it for your own components. As soon as you query for any translation, if the plugin has been initialized it will be automatically initialized. That the entire idea of a lazy loading: Only loading and creating the structures when needed.

So, no, you don't need to call anything to initialize/use the plugin.

I would suggest to rethink the whole API and naming and it would be superb


Yes, it has been getting simpler, and that will be one of the main priorities as soon as the main features are all finished. If you have any suggestion on what you would prefer things to be named/handled, just post it over here or email it to me. I'm always looking for ways to improve the plugin so any suggestion will be welcome.

Thanks,
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
Last edit: 9 years 8 months ago by Frank.

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

More
9 years 8 months ago #311 by Stehlik
Hi! Thanks for the fast response!
I will give you a thumb.

Sorry for my tone, it is wery late I would need to get some rest.
Yes, the documenation would need to improve I understand that.

Also I did not created any new prefab, I used the one which was imported with the plugin so I am pretty sure I did
checked the tutorial good. Only one thing you missed from tutorial is to set
start publishing google document, after that it started working.
inter-illusion.com/assets/I2Localization.pdf


So basicaly I think there is bug with initialisation.
simple repo

create empty scene.
Create new script

public class AwesomeScript : MonoBehaviour
{
Awake()
{
Debug.Log(LocalizationManager.GetTermTranslation("key"));
}
}

I get nothing.

but if I call before this
string lang = LocalizationManager.CurrentLanguage;

it works.
the reason is because the Get function calls initialization scripts
RegisterSceneSources();
RegisterSourceInResources();
SelectStartupLanguage();

but GetTermTranslation does not load the resources at all....

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

Time to create page: 0.142 seconds
Template by JoomlaShine