I’m using the WWW class to perform a https request and I don’t specify accept-language in the headers.
My problem is: the server receives always en-US as Accept-Language in the headers of the request, regardless of the real country of the user.
I want to retrieve the currentCulture of the user and pass it to the WWW class.
But I don’t know how to retrieve it ! I read in another threads that System.Globalization.CultureInfo.CurrentCulture and System.Threading.Thread.CurrentThread.CurrentCulture are set to “en-US” by default.
Do you know another way to retrieve the culture code ?
PS: I would like to avoid using a geolocation plugin as much as I can because our server relies on currentculture instead of ips to detect the location of the user. It would represent a heavy update to filter by ip rather than culture code.
Hello there,
I found the answer of @streeter12 very interesting but I got an exception when I tried to use the CultureInfo with date formatting.
After nearly an hour of struggle and research in obscure documentation, I finally managed to create a broader method, that works with formatting. Here it is!
I’ve got the exact same problem as you. I really need to retrieve the current culture of the player’s system to adapt the display of the date and time to the player’s local standards. As no one answered you, I’ve created a thread on the forum to find some help. I’ve also put a link to this question in the thread. I hope someone will find a solution to this.
As I can see this now, there is just no good solution (aside from making a plugin that supports all platforms but it surely feels like Unity should do it in-engine), but we can vote for this task would be resolved https://feedback.unity3d.com/suggestions/fix-localization-issues-with-cor (all of my 10 votes goes towards it)