Thank you for reaching out to Adobe Community.
I would request you to kindly try and use the below code and see if it helps:
return user.header('accept-language').indexOf('de') > -1
Thanks for reaching out to Adobe Target community .
Can you please let us know the browser language on which you want to base your targeting activity?
I am trying to do something similar, but with language and locale.
What exactly does the user.header('accept-language') get? usually the accept language has locale and factor weighting included. Accept-Language - HTTP | MDN
for example if i wanted to create a profile script differentiating england from united states for english, i would need to parse the language and locale. would the user.header("accept-language") give me "en-gb" or "en-us"?
Does using console.log work for debugging these scripts? It is difficult to use the built in target parameters without know exactly what it provides.
any help would be much appreciated!