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

Camera Usage Description localization

$
0
0
Hello! We have been working in an augmented reality app for some time and, since it has been published in several languages, we are trying to localize Unity's Camera Usage Description field. We are using "Smart Localization", an amazing asset to manage languages. I assume that it prevents us from using xCode localization in order to solve the issue. Did anyone manage to do a similar thing while using a localization asset?

localize many UI texts in one scipt

$
0
0
Hey, I would like to use smart localization(https://www.assetstore.unity3d.com/en/#!/content/7543) to localize a game menu. But I found all the text are written in text component of the button rather than in the strings. Here is what I write to find those text and I was wondering what shall I do next. using UnityEngine; using System.Collections; using UnityEngine.UI; public class Translation : MonoBehaviour { public Text[] instruction; // Use this for initialization void Start() { instruction = GetComponentsInChildren(); } // Update is called once per frame void Update () { for (int i=0;i

How to Switch and Display Language on Runtime

$
0
0
I have written a menu to change the language and have my all languages ready. I am using SmartLocalization as the tool. The function to change language (to French, for example) is "LanguageManager.Instance.ChangeLanguage ("fr") . I put this call under void Update() because I think Update() will be called every frame. That's how it looks like in my program. public void Update() { LanguageManager.Instance.ChangeLanguage("fr"); }

Which Windows settings determine Application.systemLanguage?

$
0
0
The documentation says "__The language the user's operating system is running in__". I'm running Windows 10 in English, but Application.systemLanguage keeps reporting 'Dutch' as the language (I'm in the Netherlands, so it's the language of the country I'm in. My region in Windows is normally set to 'Netherlands'). Changing _Region->Location_ and _Region->Administrative->Language for non-Unicode programs_ settings in Windows to United States/English doesn't change anything, Unity keeps reporting that the OS is in Dutch. So which Windows setting should I change to influence the return value of Application.systemLanguage?

Can we replace Files in already released games

$
0
0
Hello together, i plan to translate a game that isnt mine ;) but is there a way to just place the translated file in the right directory structure instead packing it into the *.assets file ? Thanks in advance ^^

Application.systemLanguage returns Unknown for Malay language

$
0
0
I'm localizing my game into multiple languages and Malay is one of them. I see that this is not one of the languages in the SystemLanguage enumeration, so Application.systemLanguage just returns Unknown. This is a problem for me, how can I resolve it? Why does systemLanguage even return an enumeration instead of the name of the language as a string? Is there any other way I can figure out if the user's device is using the Malay (Bahasa Melayu, etc) language?

Streaming assets android

$
0
0
Hello everyone. I have a problem with streaming assets on mobile devices(On PC everything is good). When I try to find out where is the problem, i discovered, that file couldn`t be found. But why? Help me please. Thanks in advance. public string languageName = "localizedText_en.json"; public static LocalizationManager instance; private Dictionary localizedText; private bool isReady = false; private string missingTextString = "Localized text not found"; string filePath; void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); } private void Start() { if (PlayerPrefs.GetString("languageName") != "") languageName = PlayerPrefs.GetString("languageName"); else languageName = "localizedText_en.json"; Loader(languageName); } private void OnLevelWasLoaded() { if (PlayerPrefs.GetString("languageName") != "") languageName = PlayerPrefs.GetString("languageName"); else languageName = "localizedText_en.json"; Loader(languageName); } public void ChangeLanguage(string name) { isReady = false; languageName = name; PlayerPrefs.SetString("languageName", languageName); GameObject.Find("FadeManager").GetComponent().TransitionToScene("ProtectEarthGame"); } public void Loader(string fileName) { string filePath = "jar:file://" + Application.dataPath + "!/assets/"; StartCoroutine(LoadLocalizedText(filePath, fileName)); } public IEnumerator LoadLocalizedText(string path, string fileName) { localizedText = new Dictionary(); string filePath = Path.Combine(path, fileName); WWW www = new WWW(filePath); yield return www; string text = www.text; LocalizationData loadedData = JsonUtility.FromJson(text); for (int i = 0; i < loadedData.items.Length; i++) { localizedText.Add(loadedData.items[i].key, loadedData.items[i].value); } isReady = true; }

Any know where I can find information on how to localize my Asset Offering?

$
0
0
I'd like to offer my Unity Asset Store assets in other countries outside the US, but I've never actually done that and I'm not sure exactly how to go about it. Has anyone done this and can point me in the right direction?

Can i use an iOS default Chinese font instead of including a specific one?

$
0
0
I'm localizing my iOS game in Chinese. I want to avoid including a Chinese TTF font, adding around 40Mo to my app weight (Chinese TTF fonts are very heavy because they contain lot's of signs). I'm thinking of using an iOS default font like Heiti SC and Heiti TC (source: http://iosfonts.com - on iPhone since iPhone 3), and so set " Include Font Data" to false (source: https://docs.unity3d.com/Manual/class-Font.html). Has anyone already tried this kind of approach? Does it work? ^_^

How can i avoid to embed a Chinese font in my iOS Game App ?

$
0
0
I have text in chinese in my game app but i don't want to embed a chinese font in the data. Chinese font weight too much. How can i avoid to embed a full chinese font?

Company name localization

$
0
0
I know it's possible to change the app name for the project by using the following xml:Hello World but is it possible to also change the localization for the COMPANY name?

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

Localization app name Mac OS X

$
0
0
How can localize app name in Mac OS X? Can customize CFBundleDisplayName from unity?

JsonFx Deserialize Special Characters

$
0
0
I have a problem with deserializing special characters using Json.fx. When I try to serialize characters like "ğ,ş,ü", Jsonfx.Serialize and Jsonfx.Deserialize functions don't work correctly. I try to solve Localization problem for my application. Help me please. Here is my classes : public class Language { public int LanguageId; public Menu menu; public Language() { menu = new Menu(); } } public class Menu { public List MenuStrings; public Menu() { MenuStrings = new List(); } } public class Localization : MonoBehaviour { public TextAsset LanguageFile; private List _languages ; private void Awake() { Language Example = new Language(); Example.LanguageId = 7; Example.menu.MenuStrings.Add("İskeğderinoviş"); Example.menu.MenuStrings.Add("ŞağmiI"); Example.menu.MenuStrings.Add("Şjikovamoğviş"); Debug.Log(JsonWriter.Serialize(Example)); } Log Message : {"LanguageId":7,"menu":{"MenuStrings":["\u0130ske\u011Fderinovi\u015F","\u015Ea\u011FmiI","\u015Ejikovamo\u011Fvi\u015F"]}} UnityEngine.Debug:Log(Object) Localization:Awake() (at Assets/Scripts/Localization.cs:155) Thanks for your time.

Smart localization asset with the Unity Samples: UI

$
0
0
Hello, I hope to find a quick answer i am really new to the Ui, GUI and specially localization techniques, well i should have the [Unity Samples: UI][1] 3D menu (that you can find in the scene folder of the project) to make it change languages for the system language or the chosen language using [Smart localization][2] assets... i so far been able to do it with text i create myself but to access the "Unity Samples: UI" element and change them when ever i wanted i just failed and all this is for hours later so... please try to help me even if this could be obvious solution... thank you and this is my code that i've attached to the canvas of the 3D scene (from the Unity Samples project) : using UnityEngine; using System.Collections; using SmartLocalization; using System.Collections.Generic; public class SmartLocTutorial : MonoBehaviour { string _welcome; string _newGame; AudioClip _playSound; GameObject _gameObject; Texture _texture; private Dictionary currentLanguageValues; private List availableLanguages; // Use this for initialization void Start () { LanguageManager languageManager = LanguageManager.Instance; SmartCultureInfo systemLanguage = languageManager.GetSupportedSystemLanguage (); if (systemLanguage != null) { languageManager.ChangeLanguage (systemLanguage); } if (languageManager.NumberOfSupportedLanguages > 0) { currentLanguageValues = languageManager.RawTextDatabase; availableLanguages = languageManager.GetSupportedLanguages (); } else { Debug.LogError ("No languages are created!, Open the Smart Localization plugin at Window->Smart Localization and create your language!"); } languageManager.OnChangeLanguage += OnChangeLanguage; // languageManager.ChangeLanguage ("en"); } void OnDestroy () { if (LanguageManager.HasInstance) LanguageManager.Instance.OnChangeLanguage -= OnChangeLanguage; } void OnChangeLanguage (LanguageManager thisLanguageManager) { // _welcome = thisLanguageManager.GetTextValue ("Welcome.Key"); GameObject.Find ("TitleLabel").GetComponentInChildren ().text = thisLanguageManager.GetTextValue ("Welcome.Key"); // _newGame = thisLanguageManager.GetTextValue ("NewGame.Key"); GameObject.Find ("_newGame").GetComponentInChildren ().text = thisLanguageManager.GetTextValue ("NewGame.Key"); _playSound = thisLanguageManager.GetAudioClip ("PlaySound.Key"); _texture = thisLanguageManager.GetTexture ("Texture.key"); _gameObject = thisLanguageManager.GetPrefab ("GameObj.key"); } void OnGui () { // if (GUILayout.Button ("English")) { // LanguageManager.Instance.ChangeLanguage ("en"); // } // if (GUILayout.Button ("Français")) { // LanguageManager.Instance.ChangeLanguage ("fr"); // } } // Update is called once per frame // void Update () // { // // } } [1]: https://www.assetstore.unity3d.com/en/#!/content/25468 [2]: https://www.assetstore.unity3d.com/en/#!/content/7543

Modifying line order in UI Text component

$
0
0
I'm in the process of localizing a project for the arabic language, and I've succeeded in converting string variables to the correct reading order (right-to-left), but when I implemented said string to a Unity text component, the reading order ends up as bottom-to-top, instead of top-to-bottom. ![alt text][1] I've tried using negative line spacing, but that breaks the texts layout. I also tried changing the line order in Text Generator lines variable, but they're read only. What would be the best solution to the line order problem? Should i create a BaseVertexEffect to modify the mesh itself? I'm currently working with Unity 4.6.4. Also, i don't speak arabic myself, so i don't event know if the text is correct! [1]: /storage/temp/57666-arabic.png

Localization over scenes

$
0
0
I want to add multiple language support to my game and currently I'm using Smart Localization from the Assets Store. I have 4 buttons in my first scene for switch the language and if a button is selected, the float "language" changes to a value between 1 and 4 and the language changes like it should. If you continue to the next scene, "language" will be saved in PlayerPrefs and if the script is loaded again, "language" will get the value from PlayerPrefs, so it should display the text in the language that has been selected before but it does'nt, the textfields are just empty although "language" has a valid value(1-4) that should change the language. Any ideas why? Heres my code: public class Test : MonoBehaviour { public Text PlayTxt, BackTxt, EarthTxt, HealthTxt, MenuTxt, MissingTxt, RestartTxt, DamageTxt; public string playKey = "Play"; public string earthKey = "Earth"; public string healthKey = "Health"; public string menuKey = "Menue"; public string missingKey = "Missing"; public string restartKey = "Restart"; public string damageKey = "Damage"; public string backKey = "Back"; public float language; void Start(){ if(PlayerPrefs.HasKey ("language")) { language = PlayerPrefs.GetFloat ("language"); } } void Update(){ if (language <= 1) { LanguageManager.Instance.ChangeLanguage ("en"); } if (language == 2) { LanguageManager.Instance.ChangeLanguage ("de"); } if (language == 3) { LanguageManager.Instance.ChangeLanguage ("es"); } if (language == 4) { LanguageManager.Instance.ChangeLanguage ("tr"); } PlayTxt.text = "" + LanguageManager.Instance.GetTextValue(playKey); BackTxt.text = "" + LanguageManager.Instance.GetTextValue(backKey); EarthTxt.text = "" + LanguageManager.Instance.GetTextValue(earthKey); HealthTxt.text = "" + LanguageManager.Instance.GetTextValue(healthKey); MenuTxt.text = "" + LanguageManager.Instance.GetTextValue(menuKey); MissingTxt.text = "" + LanguageManager.Instance.GetTextValue(missingKey); RestartTxt.text = "" + LanguageManager.Instance.GetTextValue(restartKey); DamageTxt.text = "" + LanguageManager.Instance.GetTextValue(damageKey); } public void engl(){ LanguageManager.Instance.ChangeLanguage ("en"); language = 1; } public void de(){ LanguageManager.Instance.ChangeLanguage ("de"); language = 2; } public void es(){ LanguageManager.Instance.ChangeLanguage ("es"); language = 3; } public void tr(){ LanguageManager.Instance.ChangeLanguage ("tr"); language = 4; } void OnDestroy(){ PlayerPrefs.SetFloat ("language", language); } }
Viewing all 210 articles
Browse latest View live


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