I've made an app in Unity which has been on the Google Play Store for over a year. Today I wanted to deployt it on Apple App Market but the translations don't work there.
I use the following code to load my app translations
public bool LoadLocalizedText(SystemLanguage language)
{
localizedText = new Dictionary<string, string>();
string filePath = Path.Combine(Application.streamingAssetsPath, "localizedText_" + language + ".json");
WWW reader = new WWW(filePath);
if (reader.text == null || reader.text == "") return false;
while (!reader.isDone) { }
string dataAsJson;
dataAsJson = reader.text;
LocalizationData loadedData = JsonUtility.FromJson<LocalizationData>(dataAsJson);
for (int i = 0; i < loadedData.items.Length; i++)
{
localizedText.Add(loadedData.items[i].key, loadedData.items[i].value);
}
Debug.Log("Data loaded, dictionary contains: " + localizedText.Count + " entries");
if (localizedText.Count == 0) return false;
else
{
isReady = true;
return true;
}
}
Yet somehow, all text fields display "Localized Text Not Found" because it cannot find my Assets... what could this be?
Is this because the StreamingAssets folder isn't copied to xCode? Is it because the location is different on iOS? Something else?
