]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/lxc/DeviceEdit.js
ui: lxc: dev passthrough: allow translating validation errors
[pve-manager.git] / www / manager6 / lxc / DeviceEdit.js
index 9c5809e8c8318976695ff7352932a5f9b6d3f13c..2b3299083d93d9d1405c95d4ff230ecea752ba48 100644 (file)
@@ -55,13 +55,7 @@ Ext.define('PVE.lxc.DeviceInputPanel', {
            allowBlank: false,
            fieldLabel: gettext('Device Path'),
            emptyText: '/dev/xyz',
-           validator: function(value) {
-               if (value.startsWith('/dev/')) {
-                   return true;
-               }
-
-               return "Path has to start with /dev/";
-           },
+           validator: v => v.startsWith('/dev/') ? true : gettext("Path has to start with /dev/"),
        },
     ],
 
@@ -95,8 +89,7 @@ Ext.define('PVE.lxc.DeviceInputPanel', {
                if (/^0[0-7]{3}$|^$/i.test(value)) {
                    return true;
                }
-
-               return "Access mode has to be an octal number";
+               return gettext("Access mode has to be an octal number");
            },
        },
     ],