walkthrough
Clone this wiki locally
##basic workflow
- import unity package: Download
Download the plugin, double click it to import it into your project
- Select menu option Translation/Game Configuration
- Set source language in dropdown, click Set source language button
- Add or Remove any unwanted target languages (note: pseudo language is free and helps you debug later on)
- Select desired translation quality
- Native speaker - this means someone who is a native speaker of that language will translate it for you
- Professional - This is someone who does translations for a living
- Pair of translators - make sure you have the highest quality translations
- Get your translations into a form that can be translated by using helpers
- This depends on which GUI systems you use, but there's always the tried and true way -- edit your source language file. For english, this will be at: Assets/Transfluent/Resources/AutoDownloaded-en-us .
- The most basic way:
- Set up a simple migration. If you're using plain textmeshes and OnGUI and the text meshes are not updated by scripts, this involves no other work than to use menu option "Transfluent/Helpers/Full Migration"". This menu option will scan all of your prefabs and scenes for text mesh references, and add a globalize text mesh component. The globalize text mesh component is a helper to respond to API events automatically, and change the text when the language is changed.
- Note: this simple migration may be modified to handle script controlled scripts as is appropriate to your program. See the GameSpecificMigration script for an example of how this was done for strangerocks ( and you can see the full example https://github.com/hardcoded2/strangerocks )
- Replace any code uses string concatenation to do things like say "Hello, " + username + " how are you?", and replace them with TranslationUtility.getFormatted("Hello, {0} how are you?",username).
- custom integrations
- OnGUI users: Add the following lines to the top of any file that uses ongui to automatically translate any standard ongui text:
using GUILayout = transfluent.guiwrapper.GUILayout;
using GUI = transfluent.guiwrapper.GUI;- Custom scripts -- consider adding code to check the translation values on awake. Create an OnLocalize() function in your monobehaviour to detect when the target language has changed, like in the strangerocks example, where I update text when OnLocalize is called, and OnEnable I check to see the language (as disabled objects don't receive OnLocalize messages) and in
void updateText()
{
if(labelMesh != null)
{
//we don't want to set the mesh unless we have to, so check to see if the raw text is the same
//more of an issue for more rendering heavy techniques
if (!labelMesh.text.Equals(labelData.current))
{
labelMesh.text = labelData.current;
}
}
}
public void OnEnable()
{
OnLocalize();
}
public void OnLocalize()
{
labelData.OnLocalize();
updateText();
}Note, labelData is a simple helper utility designed to handle keeping the state of the original key along with the current text that should be displayed. 4. Capture mode -- There are some helpful utilities to get text into the translation database, even if you are doing a lot in code to generate or display text even after migration. If you do not see strings in the source language file, Assets/Transfluent/Resources/Autodownloaded-en-us for English, then you may need to run the game in capture mode in order to get all of your source text (this is likely if you are using OnGUI or did not run a full migration)
- Select the menu option ("Translation/Helpers/Enable Capture Mode") to enable capture mode
- Press play, and play through your game, being mindful to make sure that all the text gets shown during your play session
- Select the menu option ("Translation/Helpers/Enable Capture Mode") to enable capture mode
- Check for missing text.
- If you have translated text, make sure to upload it in the game config options before ordering translations, so we do not try to translate it for you
Click "Download known translations" - Order translations
- Select menu option Transfluent/Game Configuration
- Select "Translate" button, if prompted to sign in, sign into your transfluent account -- you can sign up here www.transfluent.com/sign-in/
- Confirm charges (NOTE: estimate is a very rough estimation at the moment. The actual amount may be different)
- Download your translations (takes a day in some cases), ####options for downloading
- navigate to Assets/Resources/TranslationConfigurationSO_, and click the "Download game data". This is much faster and probably optimal.
Click "Download known translations"
scroll to the bottom for the inspector and click download
2. Select the menu option "Transfluent/Download All Configurations". This takes longer than the above option, but is more useful if you deal with a lot of different text groups (an advanced option)
6. Updating your game after initial translations are set up and iterating for ongoing development.