Skip to content

Instantly share code, notes, and snippets.

@ManuelPeinado
Created January 24, 2018 21:12
Show Gist options
  • Save ManuelPeinado/84eae934e5257a05ef6c1a8b053c71cd to your computer and use it in GitHub Desktop.
Save ManuelPeinado/84eae934e5257a05ef6c1a8b053c71cd to your computer and use it in GitHub Desktop.
diff --git a/Assets/Plex.Localization/LocalizationManager.cs b/Assets/Plex.Localization/LocalizationManager.cs
index d526a88..3a7f51c 100644
--- a/Assets/Plex.Localization/LocalizationManager.cs
+++ b/Assets/Plex.Localization/LocalizationManager.cs
@@ -90,18 +90,13 @@ namespace PlexLocalization
string filePath = Path.Combine(Application.streamingAssetsPath, "Localization", fileName);
PlexTrace.Debug($@"[Localization] Loading from {filePath}");
- WWW www = new WWW(filePath);
- yield return www;
+ string text = File.ReadAllText(filePath);
+ yield return null;
- if (!string.IsNullOrEmpty(www.error))
- {
- PlexTrace.Error($@"[Localization] Not loading language file {filePath} because it doesn't exist");
- }
- else
- {
- LoadLocalizedTexts(www.text, dest);
- PlexTrace.Info($@"[Localization] {dest.Count} localized strings loaded");
- }
+ LoadLocalizedTexts(text, dest);
+ yield return null;
+
+ PlexTrace.Info($@"[Localization] {dest.Count} localized strings loaded");
}
static void LoadLocalizedTexts([NotNull] string json, [NotNull] IDictionary<string, string> dest)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment