Quantcast
Channel: Questions in topic: "localization"
Viewing all 210 articles
Browse latest View live

Localizing level0 file

$
0
0
Hey there. I'm trying to make a localized version of one of fangames, made with Unity 5.3.0f4. I managed to localize graphical icons inside the sharedassests0.assets file with proper decompiling utilities, but I was unable to localize the text dialogues of the game since I couldn't find the file that contains the dialogue from the asset file. After some tries, I figured out that the dialogues are actually located in the scene file; level0. When I opened level0 file with Notepad++, those dialogues are clearly visible. But unfortunately, whenever I edit the dialogue and save it, it destabilizes the file, making the game crashed. Is there any method to edit the dialogue inside the level0 file and save it without problem? Thanks, and have a good one.

Editor Localization: How does it work?

$
0
0
Hello, Does anyone know how localization works inside the Unity editor? For example if I download Unity in language A and write an editor extension in language B (or visa versa). Will Unity display that editor in the installed language or in the original written? As far as I can tell you can't change the language of the editor anywhere other then when you install Unity. (Edit: it may use your system's language i.e. Application.SystemLanguage (read-only)) If the editor does not automatically localize editor text do I have to make sure all the editor extension's code goes through LocalizationDatabase for things such as button names, label fields, etc... I would like to publish an asset on the asset store with localization options. Thanks.

Add asset to array during runtime

$
0
0
I have an existing script that translates my text using a CSV file that is assigned to a public array in the Inspector. I now want to store this CSV file on an external server, pull it down when the App starts, and apply it to the array so the other scripts can still reference it in the same way. I know how to download the asset, I just need some help on how to add it to the array once its downloaded. EDIT: Here are 2 scripts that reference the CSV file: This script is where the CSV file can be assigned in the Inspector. #if UNITY_EDITOR using System.IO; using UnityEditor; #endif using UnityEngine; using UnityEngine.Networking; public class TextLocalizationFiles : ScriptableObject { public TextAsset[] files; #if UNITY_EDITOR [MenuItem("Component/UI/Localization Asset")] public static void CreateLocalizationAsset() { CreateAsset(); } private static void CreateAsset() where T : ScriptableObject { T asset = CreateInstance(); string path = AssetDatabase.GetAssetPath(Selection.activeObject); if (string.IsNullOrEmpty(path)) { path = "Assets"; } else if (!string.IsNullOrEmpty(Path.GetExtension(path))) { path = Path.GetDirectoryName(path); } if (!path.Contains("Resources")) { string newpath = Path.Combine(path, "Resources"); if (!Directory.Exists(newpath)) AssetDatabase.CreateFolder(path, "Resources"); path = newpath; } string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(Path.Combine(path, "Localization.asset")); if (File.Exists(assetPathAndName)) { Debug.LogWarning(string.Format("An asset called Localization was already found at {0}. There can be only one.", path)); return; } //Debug.Log("Creating asset " + assetPathAndName + " at " + path); AssetDatabase.CreateAsset(asset, assetPathAndName); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); EditorUtility.FocusProjectWindow(); Selection.activeObject = asset; } #endif } This script references the 'files' array: using System.Runtime.InteropServices; using UnityEngine; using System.Collections.Generic; using UnityEngine.EventSystems; public static class TextLocalization { public static event Localize LocalizationChanged; private static readonly Dictionary dictionary = new Dictionary(); private static TextLocalizationFiles localizationAsset; private static int nbLocaFiles; private static int currentLanguageIndex = -1; public static string[] AvailableLanguages { get; private set; } public static string CurrentLanguage { get { return AvailableLanguages[currentLanguageIndex]; } } public static List Keys { get { return new List(dictionary.Keys); }} public static void Init() { localizationAsset = Resources.Load("Localization"); if (nbLocaFiles != localizationAsset.files.Length || dictionary.Count == 0) { dictionary.Clear(); foreach (TextAsset asset in localizationAsset.files) Load(asset); nbLocaFiles = localizationAsset.files.Length; } } public static bool Load(TextAsset txt) { if (txt != null && LoadCSV(txt)) return true; return false; } private static bool LoadCSV(TextAsset asset) { CSVReader reader = new CSVReader(asset); // The first line should contain "KEY", followed by languages. List temp = reader.ReadCSV(); // There must be at least two columns in a valid CSV file if (temp.Count < 2) return false; // Ensure that the first value is what we expect if (!string.Equals(temp[0], "KEY")) { Debug.LogWarning("Invalid localization CSV file. The first value is expected to be 'KEY', followed by language columns.\n" + "Instead found '" + temp[0] + "'", asset); return false; } if (AvailableLanguages == null) { AvailableLanguages = new string[temp.Count - 1]; for (int i = 1; i < temp.Count; ++i) AvailableLanguages[i - 1] = temp[i]; } else { if (AvailableLanguages.Length != temp.Count - 1) { Debug.LogError( string.Format("Localization file {0} does not have the correct amount of languages, expected {1} but got {2}", asset.name, AvailableLanguages.Length, temp.Count - 1)); return false; } } // Read the entire CSV file into memory temp = reader.ReadCSV(); while (temp != null) { string[] values = new string[temp.Count - 1]; for (int i = 0; i < values.Length; ++i) values[i] = temp[i + 1]; try { dictionary.Add(temp[0], values); } catch (System.Exception) { Debug.LogError(string.Format("Unable to add '{0}' to the Localization dictionary. Found the double in {1}", temp[0], asset.name)); } temp = reader.ReadCSV(); } return true; } /// /// Select the specified language from the previously loaded CSV file. /// public static bool SelectLanguage(string alanguage) { currentLanguageIndex = -1; for(int i = 0; i < AvailableLanguages.Length; ++i) if (AvailableLanguages[i] == alanguage) { currentLanguageIndex = i; break; } if (Application.isPlaying) { if(LocalizationChanged != null) LocalizationChanged(); } return currentLanguageIndex >= 0; } public static string Get(string key) { string[] vals; if (currentLanguageIndex != -1 && dictionary.TryGetValue(key, out vals)) { if (currentLanguageIndex < vals.Length) return vals[currentLanguageIndex]; } #if UNITY_EDITOR Debug.LogWarning("Localization key not found: '" + key + "'"); #endif return key; } public static string[] GetAll(string key) { string[] vals; if (dictionary.TryGetValue(key, out vals)) return vals; #if UNITY_EDITOR Debug.LogWarning("Localization key not found: '" + key + "'"); #endif return null; } public static bool Exists(string key) { return dictionary.ContainsKey(key); } } public delegate void Localize();

Problem with NGUI UILabel not showing some special characters in French and Spanish...

$
0
0
I'm using NGUI and it's built in localisation system, but I'm having some problems in the editor with some of the special characters not showing in my UILabel. For instance the French phrase 'RESTEZ À L'AFFÛT' when I run the game is showing on the label at runtime as RESTEZ � L'AFF�T So some of the characters are replaced with a question mark in a diamond. You can see an example image here... http://prntscr.com/hyvj5e The font definately has those characters in its set of glyphs, so that is not the issue. In fact if I go and paste the word from the text file onto the label at runtime, it then shows correctly in the editor? Why would it show the incorrect version, then allow the value to be pasted manually? I've tried both Unity and NGUI font options, the Unity Font option shows the question marks, the NGUI font option just doesn't render a character at all. Any ideas why this is happening or a way to fix it? Thanks

Loading Different Languages #Localization ResX vs Json

$
0
0
I have some text in my game. I want to be able to have files with different languages a load them into my game. Below I build out my text. public class GameTexts : ModuleTexts { static GameTexts() { texts[GameTextKeys.Results] = @"Thanks for playing!"; } } Next i would like to load my languages. Any resources for Json or ResX loading? There isnt much info on the forums about it.

How to setup TextMesh Pro Font Asset to include characters from all languages?

$
0
0
So, I want to use TextMesh Pro to optimize game chat. There are people from all over the world using this chat. So I have latin, chinese, japanese, russian and all kind of stuff. My question is, how to generate Font Asset that includess characters from all languages? Now I'm using Unity UI Text component which is generating text geometry runtime so there is no problem with "missing" characters but ofc performance is much worse than on TMP. I will discribe what I've tried to do, maybe I'm missing sth. ---------- ASCII, Extended ASCII, ASCII lower/upercse, numbers + symbols not suited me ofc. There are two options for me: ranges and custom characters. But general problem is that "non-asian" languages have in total ~2k characters. Asian languages have in total like 100k (!) characters. There is no posibility to generate that huge atlas. What am I doing wrong?

Location check for mobile app/game

$
0
0
Hi, I have to check if player/user is located in timezone such as PST or EST or KST and so on.. What would be the best way to do it within Unity apps? HALP!! Thank you.

IAP metadata.localizedPrice not working for Asian currency

$
0
0
Hello, I have this line of code which works perfectly in western stores : buyButtonText.text = _myIAP.m_StoreController.products.WithID(_myIAP.charsIDs[scrollPage]).metadata.localizedPrice.ToString(); it shows the right price with the right currency symbol (€, $, etc..) however on the Japanese google store it doesn't. is this a known issue ? thanks

Make a km or metter the user make IRL

$
0
0
I will love to know how many km or m the user made in real by using the localization data. (Like a pedometer but with km and metter)

Null reference on dictionary with Unity's Text Localisation tutorial

$
0
0
Hi all, I followed a unity tutorial on text localisation, but it doesn't work - I keep getting a null reference to the dictionary, even though the dictionary is loading and print statements show the correct keys, etc. when I try to load the text. First it seemed like it was because of the jump to a different scene. I altered the scripts so that I could select, load, and display the languages in the same scene. this worked once, but once only. Then it went back to the null reference. The error appears on line 53 in the LocalizationManager script which you can see on the tutorial page. It was last checked with version 5.5, so perhaps that has something to do with it? The tutorial is at: https://unity3d.com/learn/tutorials/topics/scripting/localization-manager If anybody has followed this and had the same problems, it'd be great to hear from you!

Anyone know how to setup text localization with Button icons within the text?

$
0
0
We have localization within our game for PC. We currently have something like... "Press the [Crtl] button to crouch" But we want to add controller support and cannot figure out how to replace the Ctrl with an icon representing a controller button. Similar to: [https://i.ytimg.com/vi/utovhdJasRE/maxresdefault.jpg] We could break up the sentence into peices, but the sentence structure would not be the same for each language so the icon would not necessarily be the same place. Does any one know how this is usually handled, can I add a reference to an icon right in an XML string?

Localization on mobile

$
0
0
What's the best way to do Localization on mobile? I'm currently using .txt file with simple [key]: [value] structure. But looks like accessing files in StreamingAssets on mobile is quite different and less comfortable. Mostly because of need to use Coroutine. Is there any better method?

Specify from inspector which scriptable field to use

$
0
0
Hello Everyone! I have a small Scriptable object with a bunch of Strings stored inside. Then I have a Text Component, where I want to assign one of the strings, which I would specify from inspector without writing scripts for each text. [CreateAssetMenu(menuName = "SCP/Localization/UI")] public class LanguagePack_UI : ScriptableObject { public string Register_Success = "Congratulations!"; public string Register_SuccessInfo = "You have been successfully registered to SCP: Foundation Services. All materials are confidential, and must NOT be shared. Sharing this information will result in your immediate Termination."; public string UI_Next = "Next"; public string UI_Continue = "Continue"; public string UI_Skip = "Skip"; //THE LIST GOES ON AND ON... } So I want to choose which string to read from using the Unity Editor (Inspector) window. Thanks in Advance!

Remote Settings for Localization

$
0
0
Hey, right now I'm using a JSON-handler/parser as in [this official tutorial][1] for my localization. Today I've heard about Remote Settings for the first time and I think it is overall a very good idea. Now I'm wondering if you could do your whole localization through Remote Settings. Does anyone have some experience with this method? [1]: https://unity3d.com/de/learn/tutorials/topics/scripting/localization-manager

Ho do I define an Asset Store category for my Asset?

$
0
0
Hi, I've made a localization tool for Unity : https://assetstore.unity.com/packages/tools/one-click-localization-76358 But it's not in the "Localization" category of the store : https://assetstore.unity.com/categories/tools/localization And I just can't understand how to add my asset to this category : - I have the tag "Localization" - There is no "Localization" Category to select in the package editor. - I have five star reviews and asset is there for more than a year Thanks for your help.

What is the preferred practice when building for three languages?

$
0
0
Hello all, I have a game that needs to run in three languages. The way each language is represented is by images, text written on an image. My approach is to start the game with main menu, with a button for each language. When button is pressed for language A - load the scenes associated with language A, but only play the first relevant scene. If button is pressed for language B - load the scenes associated with language B, but only play the first relevant scene. if button pressed for language C - load the scenes associated with language C, but only play the first relevant scene. This looks like a classic case for asset bundle. Can I organize the bundle by scene language and when in run-time load the relevant scenes to the game, but have them play one after another?

How to localize text stored in object property or generated by method?

$
0
0
I used many scriptable object in the game, and most text in TMP is generated from the scriptable object name, serialized field and method like ToString() or GetSomeText(). I Think I can't extract the text out since most of them is dynamic generated. So can how can I localize them? Thanks!

Issues with iOS Build that are not visible in Editor

$
0
0
Let me first tell you about the app I'm working on: Art & Walk is a mobile app built for an exhibition taking place in Royal Baths in Warsaw. The app has features such as GPS location tracking, AR scanning (Vuforia) and unlocking exhibited items in a gallery to reward the visitor when enough number of items collected. It is built with Unity for Android and iOS. The problem is though, that when we build the app on an iPhone through Xcode, some features do not work. First of all, text that is localized is not visible, instead, there is the placeholder "Lorem ipsum" text or the default text written in Unity editor. Text is localized with two txt files, for English and Polish. I use Resources.Load() and Split to divide the text into lines, then add them to an array to get them whenever I need e.g. when a dialog is opened. The second problem is the user cannot tap some buttons, they do not function. Specifically, the button that switches language and buttons on the draggable map. This one makes me really curious since most of the buttons work, again no problem in the editor. When I try the app in Unity editor with the same resolution with the phone, everything works fine. I suspect something gets corrupted or lost in translation while we build it with Xcode. I'm not sure what more info I should share at the moment, if you ask me I can get screenshots or copy pieces of code, no problem. Please help. I can even pay for a person who can solve this problem.

How to display Chinese characters (TMP) and where to find royalty free chinese fonts

$
0
0
Hi guys, I've been trying to translate my game to Chinese but is having a hard time because the default TMP fonts can't display Chinese. Is there any way I can get it to work or get royalty free chinese fonts somewhere?

Getting Localization data in Android with streamingAssets and UnityWebRequest

$
0
0
Hi I used Unity localization tutorial to localize text in my app - In editor it works fine, but in Android it works partly (first canvas it doesn't find strings - shows missingTextString and other canvas is translated fine(buttons)). In the code I use missingTextString to debug errors too. It's more handy. Unity version is 2019.2.0f1 and I'm testing it in Android is 8.1 So the code: IEnumerator LoadLocalizedTextOnAndroid(string fileName) { localizedText = new Dictionary(); string filePath; filePath = Path.Combine(Application.streamingAssetsPath + "/", fileName); missingTextString = "Android filePath: "+filePath; string dataAsJson; if (filePath.Contains("://") || filePath.Contains(":///")) { UnityWebRequest uwr = UnityWebRequest.Get(filePath); yield return uwr.SendWebRequest(); if (uwr.isNetworkError || uwr.isHttpError) { Debug.Log(uwr.error); dataAsJson = "error"; missingTextString += uwr.error; } else { dataAsJson = uwr.downloadHandler.text; missingTextString = missingTextString+" - "+ uwr.downloadHandler.text+" Juhuu"; } } else { dataAsJson = File.ReadAllText(filePath); Debug.Log("DataAsJson = "+dataAsJson); missingTextString += dataAsJson; } LocalizationData loadedData = JsonUtility.FromJson(dataAsJson); for (int i = 0; i < loadedData.items.Length; i++) { localizedText.Add(loadedData.items[i].key, loadedData.items[i].value); Debug.Log("KEYS:" + loadedData.items[i].key); } isReady = true; }
Viewing all 210 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>