-#ifdef WITH_WARNINGS
-#warning How do we get the local language here??
-#endif
- string const doclang = buf->getLanguage()->babel();
+ // How do we get the local language here??
+ lyx::pos_type curr_pos = parOwner()->getPositionOfInset(this);
+ lyx::Assert(curr_pos != -1);
+ string const curr_lang =
+ parOwner()->getFont(buf->params,
+ curr_pos).language()->babel();
+