input: Write a function to translate a text from English to French using the `googletrans` library. If the input text is empty, return an empty string. Ensure the function handles empty inputs correctly.
  assert translate_to_french("Hello, this is a sample text to translate.")=='Bonjour, ceci est un texte d\'exemple à traduire.'
  assert translate_to_french("")==''
  assert translate_to_french("What time is it?")=='Quelle heure est-il ?'
  assert translate_to_french("I love programming.")=='J\'adore programmer.'
  assert translate_to_french("The weather is nice.")=='Le temps est agréable.'
output: def translate_to_french(text):
      if not text:
          return ""
      from googletrans import Translator
      translator = Translator()
      translation = translator.translate(text, src='en', dest='fr')
      return translation.text