Not safe to store localization in player prefs
7 years 1 month ago - 7 years 1 month ago #2502
by jswigart
Not safe to store localization in player prefs was created by jswigart
Our game has quite a large localization table(pulled from google spreadsheet). We have about 5300 terms, and eventually will have about 9 languages. For now most of those language columns are empty.
Already we are getting exceptions to the max data that can be stored in the player pref.
docs.unity3d.com/ScriptReference/PlayerPrefsException.html
The documentation suggests this exception is isolated to web player builds but we are getting it on desktop builds. Maybe that much data can't be stored in the registry in one key on windows or something.
The player prefs is not the place to store bulk data like this. Reaching the limit of pref storage in this way will likely also break the storage of other pref data completely unrelated to localization.
I would recommend downloading and caching data to a standalone file in Application.persistentDataPath(which would incidentally be easier to support multiple sources)
This should be a priority 1 bug I think.
Already we are getting exceptions to the max data that can be stored in the player pref.
docs.unity3d.com/ScriptReference/PlayerPrefsException.html
The documentation suggests this exception is isolated to web player builds but we are getting it on desktop builds. Maybe that much data can't be stored in the registry in one key on windows or something.
The player prefs is not the place to store bulk data like this. Reaching the limit of pref storage in this way will likely also break the storage of other pref data completely unrelated to localization.
I would recommend downloading and caching data to a standalone file in Application.persistentDataPath(which would incidentally be easier to support multiple sources)
This should be a priority 1 bug I think.
Last edit: 7 years 1 month ago by jswigart.
Please Log in or Create an account to join the conversation.
7 years 1 month ago #2505
by Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
Replied by Frank on topic Not safe to store localization in player prefs
Hi,
You are right, most games don't have that much text, so I have never experienced a limit, but playerPrefs its indeed not the best place to store the downloaded data.
I will route it to a file and upload a new build to the beta folder!
Thanks for reporting this!!
Frank
You are right, most games don't have that much text, so I have never experienced a limit, but playerPrefs its indeed not the best place to store the downloaded data.
I will route it to a file and upload a new build to the beta folder!
Thanks for reporting this!!
Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
To get the betas as soon as they are ready,
check this out
Please Log in or Create an account to join the conversation.
7 years 1 month ago #2507
by Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
Replied by Frank on topic Not safe to store localization in player prefs
BTW, I just made the change, and uploaded v2.8.1a1 to the beta folder.
Hope that helps,
Frank
Hope that helps,
Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
To get the betas as soon as they are ready,
check this out
Please Log in or Create an account to join the conversation.
7 years 1 month ago #2508
by jswigart
Replied by jswigart on topic Not safe to store localization in player prefs
excellent response time. thanks!
Please Log in or Create an account to join the conversation.
Time to create page: 0.139 seconds