I don't think there's a well-established Slovenian translation of this song, so I'd go with something like Ko ti ostane samo ljubezen ("when love is the only thing you have left") or Ko imaš samo ljubezen ("when you only have love").
does a native Slovenian person have another suggestion for translating "when love is all you have" ? It could be "When all you have is love". In french, the song and that sentence (very) basically mean "love is the single true thing we (humans) have".
"You" doesn't designate someone, it could be "when we only have love" ("we" means men in general).
The suggestions from TNP are rather straightforward translations. The second one (Ko imaš samo ljubezen) is direct translation. In Slovenian, the second person singular pronoun "ti" (expressed or implied) often serves as generalized "anybody" like in French "on" or English "you". Some different translations are possible, of course. For example, Ko ostane samo ljubezen ("when only love remains", skipped pronoun) or Imeti samo ljubezen ("to have only love", infinite construction).