Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-5827

Player.getLocale always returns en_us

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • Virtualbox VM with Xubuntu 18.04

      Java: tested both openjdk 1.8.0._252 and openjdk 11.0.7

       

    • git-Spigot-758abbe-3f0c333 (MC: 1.16.1)
    • Yes

      Server.getLocale returns en_us even if player is using a different locale.

      For testing purposes, and to make sure that there is no intereference with other plugins, I made a new server with only one plugin (see attachment) with the following code:

      public void onEnable() {
        Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
      
          @Override
          public void run() {
            for (Player p : Bukkit.getOnlinePlayers()) {
              System.out.println(" - locale of " + p.getName() + " is " + p.getLocale());
            }
          }
        }, 100, 200);
       }
      

      The output is always en_us.

      This works fine in 1.15.2 (haven't tested previous versions), giving the selected locale (only the first output after login sometimes is en_us). Locale changes during the game also result in the correct locale shown in 1.15.2 and en_us in 1.16.1.

       

            Unassigned Unassigned
            mindw0rm mindw0rm
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: