1) Make sure "settings" is properly defined:
/** @const */
var settings = {};
2) Make sure "settings" lang is properly defined:
/** @const */
settings.lang = "fr" ;
3) Make sure the value is referenced after it is defined:
if (settings.lang == "en") ...
In advanced mode this will be inlined and removed, if settings is not used in a way that prevents property collapsing (for instance, passing "settings" as a parameter to a function will cause the value to escape and be uncollapsible).
This is simplified, if you use @define:
/** @const */
var settings = {};
/** @define {string} */
settings.lang = "fr";
You should get a warning if the definition of the define is not valid in some way.