To simplify the question and maybe reproduce the problem, I made a simplier version of what I am doing. I have a form field with ajax. When it triggers it reloads a small piece of html. In it is t('text in one of tree languages'); If I open the page for the first time the same html is loaded and it is in the correct language. But after the reload from the ajax call it is in the website's default language. This only happens when logged in. It is possible that this has to do with the administrator language module. Any help would very much be appreciated.
Ajax Code at hook_form
function hook_form($form, &$form_state) {
$form['update'] = array(
'#value' => t('Update'),
'#type' => 'button',
'#ajax' => array(
'callback' => 'callback_function',
'wrapper' => 'div-to-replace',
'method' => 'replace',
'effect' => 'fade')
);
// Other form elements
}
Ajax callback function
function callback_function($form, $form_state) {
return t('test string that should get translated');
}