Use is_translation_project() in order to simplify checks
Use elif instead of else if

This will remove one unnecessary indentation level.
Use directory variable instead of request one

Might ease tracing from where the stuff comes.