$.extend(Alltrack.Core, (function() { const _translations = {"about":"about","add":"add","add {0}":"add {0}","application version":"application version","are you sure you want to delete {0} \"{1}\"?":"are you sure you want to delete {0} \"{1}\"?","backup enabled":"backup enabled","backup time":"backup time","block time":"block time","blocked":"blocked","cancel":"cancel","change":"change","change password":"change password","channel settings pdf location":"channel settings pdf location","code":"code","color":"color","confirm new password":"confirm new password","contain":"contain","current password":"current password","custom fields":"custom fields","custom values":"custom values","dashboard":"dashboard","date time format":"date time format","definitions":"definitions","delete":"delete","delete {0}?":"delete {0}?","description":"description","device":"device","device type":"device type","device types":"device types","devices":"devices","devicetype":"devicetype","duplicate {0}!":"duplicate {0}!","edit":"edit","edit {0}":"edit {0}","email":"email","enabled":"enabled","end with":"end with","equal":"equal","equals":"equals","export csv":"export csv","export excel":"export excel","export json":"export json","export pdf":"export pdf","export xml":"export xml","first name":"first name","gates":"gates","greater than":"greater than","greater than or equal":"greater than or equal","hb":"hb","heartbeat interval":"heartbeat interval","history":"history","history material item":"history material item","history material items":"history material items","hours till lost":"hours till lost","icon":"icon","imei":"imei","increment cycles":"increment cycles","installation":"installation","installation parent":"installation parent","installation state":"installation state","installations":"installations","ip":"ip","ip access":"ip access","items":"items","language":"language","languages":"languages","last activity":"last activity","last login":"last login","last modified":"last modified","last modified by":"last modified by","last name":"last name","last seen":"last seen","latitude":"latitude","legal":"legal","legal location transition":"legal location transition","legal location transitions":"legal location transitions","legal status transition":"legal status transition","legal status transitions":"legal status transitions","legallocationtransition":"legallocationtransition","legalstatustransition":"legalstatustransition","less than":"less than","less than or equal":"less than or equal","licence expires":"licence expires","licence holder":"licence holder","location":"location","location from":"location from","location parent":"location parent","location to":"location to","location type":"location type","locations":"locations","log out":"log out","longitude":"longitude","mac address":"mac address","mandatory fields":"mandatory fields","material":"material","material item":"material item","material item movement":"material item movement","material item movements":"material item movements","material item parent":"material item parent","material items":"material items","material type":"material type","material type parent":"material type parent","material types":"material types","materialitem":"materialitem","materialitemmovement":"materialitemmovement","materialtype":"materialtype","max login attempts":"max login attempts","menu item":"menu item","menu item parent":"menu item parent","menu items":"menu items","menuitem":"menuitem","minimum number of capitals":"minimum number of capitals","minimum number of digits":"minimum number of digits","minimum number of symbols":"minimum number of symbols","minimum password length":"minimum password length","minimum stock overflow":"minimum stock overflow","mod pictures enabled":"mod pictures enabled","name":"name","name and/or password incorrect":"name and/or password incorrect","new location":"new location","new password":"new password","new status":"new status","no filter":"no filter","none":"none","not contain":"not contain","not equal":"not equal","now":"now","ok":"ok","old location":"old location","old status":"old status","order":"order","original":"original","password":"password","password strength":"password strength","path":"path","permissions":"permissions","position":"position","preposition":"preposition","process":"process","processes":"processes","relative position":"relative position","remarks":"remarks","reports":"reports","role":"role","roles":"roles","rtl":"rtl","save":"save","scan code":"scan code","scancode_unique":"scancode_unique","search":"search","search date":"search date","session expiration":"session expiration","setting":"setting","settings":"settings","show":"show","show add":"show add","show delete":"show delete","show edit":"show edit","show tooltips":"show tooltips","show view":"show view","sim card":"sim card","size":"size","smtp enabled":"smtp enabled","smtp from":"smtp from","smtp host":"smtp host","smtp port":"smtp port","smtp to":"smtp to","start with":"start with","status":"status","status from":"status from","status to":"status to","statuses":"statuses","supplier":"supplier","sw version":"sw version","system":"system","tag+":"tag+","tag-":"tag-","the {0} \"{1}\" already exists!":"the {0} \"{1}\" already exists!","this field cannot be empty!":"this field cannot be empty!","translation":"translation","translations":"translations","type":"type","types":"types","uid":"uid","units":"units","user":"user","users":"users","version":"version","view":"view","yes":"yes","zombie":"zombie","empty":"empty","field":"field","not empty":"not empty","value":"value","your session has expired":"your session has expired","ant+":{"connect":"ant+"},"ant-":{"connect":"ant-"},"contact":{"contacts":"contact"},"cost center code":{"costcentercodes":"cost center code"},"cost center contact location":{"costcentercontactlocations":"cost center contact location"},"tree":{"costcentercontactlocations":"tree"},"generate":{"createcolli":"generate"},"active":{"devices":"active"},"monitored":{"devices":"monitored"},"online":{"devices":"online"},"time till offline":{"devicetypes":"time till offline"},"link printer":{"linkprinter":"link printer"},"no printer selected":{"linkprinter":"no printer selected"},"printer has been linked":{"linkprinter":"printer has been linked"},"afas location":{"locations":"afas location"},"alias":{"locations":"alias"},"alt name":{"locations":"alt name"},"name c":{"locations":"name c"},"sales force id":{"locations":"sales force id"},"sales force parent id":{"locations":"sales force parent id"},"an email with password reset instructions has been sent to the email address of user \"{0}\", if that user exists and has an email address.":{"login":"an email with password reset instructions has been sent to the email address of user \"{0}\", if that user exists and has an email address."},"duplicate":{"login":"duplicate"},"i forgot my password":{"login":"i forgot my password"},"if you have any problems, use a more modern browser, like a recent version of chrome or firefox.":{"login":"if you have any problems, use a more modern browser, like a recent version of chrome or firefox."},"log in":{"login":"log in"},"password reset":{"login":"password reset"},"please enter your username and click \"send\" to receive an email with instructions on how to reset your password.":{"login":"please enter your username and click \"send\" to receive an email with instructions on how to reset your password."},"send":{"login":"send"},"timezone":{"login":"timezone"},"username":{"login":"username"},"you are using internet explorer, which is not supported anymore.":{"login":"you are using internet explorer, which is not supported anymore."},"client":{"materialitems":"client"},"destination contact":{"materialitems":"destination contact"},"destination location":{"materialitems":"destination location"},"material itemscol":{"materialitems":"material itemscol"},"matrix":{"materialitems":"matrix"},"receiver":{"materialitems":"receiver"},"route":{"materialitems":"route"},"last out of stock":{"materialtypes":"last out of stock"},"clients":{"menuitems":"clients"},"cost center contacts":{"menuitems":"cost center contacts"},"printer ips":{"menuitems":"printer ips"},"process defaults":{"menuitems":"process defaults"},"show in menu":{"menuitems":"show in menu"},"trolleys":{"menuitems":"trolleys"},"module description":{"modules":"module description"},"module name":{"modules":"module name"},"module path":{"modules":"module path"},"module version":{"modules":"module version"},"modules":{"modules":"modules"},"port":{"printerips":"port"},"printerip":{"printerips":"printerip"},"printerips":{"printerips":"printerips"},"printer":{"printers":"printer"},"printers":{"printers":"printers"},"url":{"printers":"url"},"test print":{"printtest":"test print"},"process default":{"processdefaults":"process default"},"- select contact from list":{"registercolli":"- select contact from list"},"cost code":{"registercolli":"cost code"},"number of collis":{"registercolli":"number of collis"},"order number":{"registercolli":"order number"},"register":{"registercolli":"register"},"there is no printer linked":{"registercolli":"there is no printer linked"},"collis":{"roles":"collis"},"contacts":{"roles":"contacts"},"cost center codes":{"roles":"cost center codes"},"cost center contact locations":{"roles":"cost center contact locations"},"create colli":{"roles":"create colli"},"import excel":{"roles":"import excel"},"location types":{"roles":"location types"},"print test":{"roles":"print test"},"process roles":{"roles":"process roles"},"routes":{"roles":"routes"},"search colli":{"roles":"search colli"},"trolleystest":{"roles":"trolleystest"},"location destination":{"searchcolli":"location destination"},"time/date":{"searchcolli":"time/date"},"hours out of stock delay":{"settings":"hours out of stock delay"},"zpl printer data":{"settings":"zpl printer data"},"a minimum length of {0}":{"translations":"a minimum length of {0}"},"a password must have":{"translations":"a password must have"},"are you sure you want to delete this {0}?":{"translations":"are you sure you want to delete this {0}?"},"at least {0} capitals":{"translations":"at least {0} capitals"},"at least {0} digits":{"translations":"at least {0} digits"},"at least {0} symbols":{"translations":"at least {0} symbols"},"can't delete {0} \"{1}\", there are {2} with this {0}.":{"translations":"can't delete {0} \"{1}\", there are {2} with this {0}."},"can't delete {0}!":{"translations":"can't delete {0}!"},"context":{"translations":"context"},"cost center locations":{"translations":"cost center locations"},"costcentercontactlocation":{"translations":"costcentercontactlocation"},"delete {0}":{"translations":"delete {0}"},"password successfully changed.":{"translations":"password successfully changed."},"press -enter to save":{"translations":"press -enter to save"},"register colli":{"translations":"register colli"},"success":{"translations":"success"},"viewcolli":{"translations":"viewcolli"},"you entered an incorrect current password.":{"translations":"you entered an incorrect current password."},"expiry":{"users":"expiry"},"identifier":{"users":"identifier"},"material item name":{"viewcollis":"material item name"},"package type":{"viewcollis":"package type"},"view colli":{"viewcollis":"view colli"},"view collis":{"viewcollis":"view collis"},"sector":{"viewcostcentercontactlocations":"sector"},"view cost center contact location":{"viewcostcentercontactlocations":"view cost center contact location"},"view cost center contact locations":{"viewcostcentercontactlocations":"view cost center contact locations"},"view trolley":{"viewtrolleys":"view trolley"},"view trolleys":{"viewtrolleys":"view trolleys"}}; function translate(original, context) { if (!original) return original; let _original = original; //.toLowerCase(); let translation; if (context && _translations[_original.toLowerCase()] && _translations[_original.toLowerCase()][context.toLowerCase()]) { translation = _translations[_original.toLowerCase()][context.toLowerCase()]; } else if (_translations[_original.toLowerCase()] && _translations[_original.toLowerCase()]['_']) { translation = _translations[_original.toLowerCase()]['_']; } else { translation = _translations[_original.toLowerCase()]; if ($.type(translation) !== 'string') { for (const prop in translation) { translation = translation[prop]; break; } } } if (!translation) { $.ajax({ url: Alltrack.BASE + 'translations/add/' + escape(_original.toLowerCase()) }).done(function(data, textStatus, jqXHR) { _translations[_original.toLowerCase()] = {_: data}; }); } return translation || original; } return { translate : translate }; })()); // IIFE