Add Term with DLC

More
9 years 3 weeks ago #542 by TobyKaos
Add Term with DLC was created by TobyKaos
Hello and thank you for this great extension.

I have read on your pdf that we can add term with Bundle. How to do that?

Must i create an AssetBundle and when I download it I create a new GameObject. This game object must be referenced in other that use term in it?

My goal is to add new characters in DLC. I will use AssetBundle to download new one. But I need to add new terms( title, name, description, ...).

I cannot use Google Web service you create to sync because it must be at the same time the player have the new character.

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

More
9 years 3 weeks ago #543 by Frank
Replied by Frank on topic Add Term with DLC
Hi,
You need to make a copy of the I2Languages.prefab and add the terms you need into that Language Source.

For instance, if you are going to create a Hunter character, you can make a copy of the I2Languages.prefab and name it CharacterHunterLanguages.prefab and add the terms: "Character/Hunter/Title", "Character/Hunter/Desc", etc

Notices that the "/" helps organizing the terms into categories.

Then, when you create the bundle for that character, just add that prefab into the bundle as well.

On the game, after you download the bundle, you need to instantiate that prefab into the scene. As soon as that LanguageSource is instantiated, it will add itself to the LocalizationManager and the terms in that source will be added to the list of available terms.

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.

More
9 years 3 weeks ago #544 by TobyKaos
Replied by TobyKaos on topic Add Term with DLC
Thank you Frank.

And then I can update my Bundle and his language prefab by downloading new version of bundle.

I also will lok how to update the default language prefab with a csv that I will download from my own server(google update is great feature for development but not for production because we have no control on download per day limitation)

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

More
8 years 7 months ago #970 by TobyKaos
Replied by TobyKaos on topic Add Term with DLC
Hi,

I have added a Google Script to export Spreadsheet as CSV on my own server. Now I wonder how to import back to Unity Game release?

2 ways:

. Add a specific behaviour in Unity I2Loc editor. A new tab like Google.

. Or do an import csv by code with my CSV get from my server.

I think the second is best to not corrupt I2Loc extension next update. But I do not know if it is possible to update like this?

As I say Google is great for dev and for little game. But with a million of players the service will be unavailable.

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

More
8 years 7 months ago - 8 years 7 months ago #971 by TobyKaos
Replied by TobyKaos on topic Add Term with DLC
I do this:

var data = I2.Loc.SimpleJSON.JSON.Parse(aJSONResult).AsObject;//LitJson.JsonMapper.ToObject (aJSONResult) ["value"];

	string Google_LastUpdatedVersion = data["version"];
	int version = int.Parse( data["script_version"] );

	Debug.Log("Version "+Google_LastUpdatedVersion);


	if (version<I2.Loc.LocalizationManager.GetRequiredWebServiceVersion())
	{
		Debug.LogError("The current Google WebService is not supported.\nPlease, delete the WebService from the Google Drive and Install the latest version.");
	}
					
	I2.Loc.LocalizationManager.Sources[0].ClearAllData();
	I2.Loc.eSpreadsheetUpdateMode UpdateMode = I2.Loc.eSpreadsheetUpdateMode.Replace;
	var SpreadSheet = data["spreadsheet"].AsObject;
	foreach (KeyValuePair<string, I2.Loc.SimpleJSON.JSONNode> element in SpreadSheet)
	{
		Debug.Log ("Import "+element.Key);

		I2.Loc.LocalizationManager.Sources[0].Import_CSV( element.Key, element.Value, UpdateMode, ',' );
						
		// Only the first CSV should clear the Data
		if (UpdateMode == I2.Loc.eSpreadsheetUpdateMode.Replace)
			UpdateMode = I2.Loc.eSpreadsheetUpdateMode.Merge;
		}


				
	I2.Loc.LocalizationManager.LocalizeAll();


Seems to work.
Last edit: 8 years 7 months ago by TobyKaos.

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

More
8 years 7 months ago #975 by Frank
Replied by Frank on topic Add Term with DLC
Hi,
Sorry for the delay!!

I have been trying to test if google imposes any limit for downloading the localization data, but so far I haven't been able to get any hard limit.
I set a machine that stayed all day sending requests to google and I didn't hit any limit. However, I'm not sure if after some point, most of those request where accessing google or just the local cache.
I have also been monitoring my games on the stores, but I don't have a million daily users (not by far!!) so I can't say for sure that there isn't a limit.
However, I haven't seen any request been denied.

But I agree, that on some cases, having more control over the storage its good. The current plugin doesn't have native implementation to get the localization from your own servers. But... but... I'm glad to tell you that I have been working on version 3 of the plugin (free upgrade + backward compatibility) and it mostly focus on handling that for you.
So, you will be able to have some localization ship in your game, and some other in an external server or google. And you just set how many often each of those sources will update and the URL for the csv file in your server, and that's it.

However, version 3 its still not complete. Most likely I will release version 2.7 and 2.8 with some urgent requests I got before releasing v3.

Said that, in the current plugin, if you need to get data from your server, you do as simple as this:

Create an script attached to your main scene and in the Start function do something along this lines:
WWW www = new WWW(url);  // url of the csv file stored in your server
yield www;
if (string.isNullOrEmpty(www.error))
{
    var CSVstring = www.text;
    LocalizationManager.Sources[0].Import_CSV( string.Empty, CSVstring, eSpreadsheetUpdateMode.Replace );
   LocalizationManager.LocalizeAll();
}

That should work.

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: TobyKaos

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

Time to create page: 0.142 seconds
Template by JoomlaShine