How does translation (gettext) work for translating config file of plugin?

WordPress doesn’t automatically translate anything, you need to use the __ and _e functions, even in your config file, if you want it to be translateable.

define( 'CONSTANT', __( 'some string', 'textdomain' ) );