JAL-3446 forgot to escape Java in modified Platform.getAppID
[jalview.git] / src / jalview / util / Platform.java
index a47e2f8..c89f1e7 100644 (file)
@@ -37,6 +37,7 @@ import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.attribute.BasicFileAttributes;
 import java.util.Date;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Properties;
 import java.util.logging.ConsoleHandler;
@@ -929,13 +930,27 @@ public class Platform
    */
   public static String getAppID(String frameType)
   {
+    
     String id = Jalview.getInstance().j2sAppletID;
     if (id == null)
     {
-      Jalview.getInstance().j2sAppletID = id = (String) jsutil
-              .getAppletAttribute("_id");
+      Jalview.getInstance().j2sAppletID = id = (isJS ? (String) jsutil
+              .getAppletAttribute("_id") : "jalview");
     }
     return id + (frameType == null ? "" : "-" + frameType);
   }
 
+
+  /**
+   * Option to avoid unnecessary seeking of nonexistent resources in JavaScript.
+   * Works in Java as well.
+   * 
+   * @param loc
+   * @return
+   */
+  public static Locale getLocaleOrNone(Locale loc)
+  {
+    return (isJS && loc.getCountry() == "en" ? new Locale("") : loc);
+  }
+
 }