afair when presta is running shop in ml env, to process things it applies current language of active visitor, not the language you're using in your shop backoffice or trying to apply w/ your script
moreover, presta all the time is pedantically tracking the settings of each visitor, & it restores the «correct» language (i.e. the language chosen by visitor || applied in shop fe by default) as far as the core gets the control back from your module
while developing some module you can easily & quickly retrieve visitor's language (along w/ bunch of other cool & useful things, btw) anytime you'll need to apply it in your code from Context object
just init it once at the startpoint
$context = Context::getContext();
& then use when needed, like
$langID = $this->context->language->id;
or
$customerID = $this->context->customer->id;
et cetera
in addition to my comment I'd also recommend to review the official developer's guide on Context object
hope it helps