deepugaur commited on
Commit
8c0610d
·
verified ·
1 Parent(s): 98c8da4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -7,13 +7,11 @@ def translate_word(word):
7
  now_utc = datetime.datetime.utcnow()
8
  now_ist = now_utc + datetime.timedelta(hours=5, minutes=30)
9
 
10
- # Check if current time is between 9 PM and 10 PM IST
11
- if now_ist.hour == 21 and now_ist.minute < 60:
12
- return "Error: Translation service unavailable between 9 PM and 10 PM IST"
13
-
14
  # Check if word starts with a vowel
15
  if word[0].lower() in 'aeiou':
16
- return "Error: Words starting with vowels cannot be translated"
 
 
17
 
18
  # Translate the word using Google Translator
19
  try:
 
7
  now_utc = datetime.datetime.utcnow()
8
  now_ist = now_utc + datetime.timedelta(hours=5, minutes=30)
9
 
 
 
 
 
10
  # Check if word starts with a vowel
11
  if word[0].lower() in 'aeiou':
12
+ if now_ist.hour == 21 and now_ist.minute < 60:
13
+ return "Error: Words starting with vowels cannot be translated between 9 PM and 10 PM IST"
14
+
15
 
16
  # Translate the word using Google Translator
17
  try: