Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,7 +24,7 @@ def translate_code(code, from_language, to_language):
|
|
| 24 |
context = f"Translate the following {from_language} code snippet to {to_language}:\n\n{code}\n\nEnsure that the translation follows Python syntax and idioms, considering language-specific best practices. You may also need to add required imports/modules."
|
| 25 |
elif from_language == "Python" and to_language == "Ruby":
|
| 26 |
context = f"Translate the following {from_language} code snippet to {to_language}:\n\n{code}\n\nEnsure that the translation follows Ruby syntax and idioms, considering language-specific best practices. You may also need to add required gems/libraries."
|
| 27 |
-
|
| 28 |
context = f"Translate the following {from_language} code snippet to {to_language}:\n\n{code}\n\nEnsure that the translation follows Python syntax and idioms, considering language-specific best practices. You may also need to add required imports/modules."
|
| 29 |
elif from_language == "Python" and to_language == "Swift":
|
| 30 |
context = f"Translate the following {from_language} code snippet to {to_language}:\n\n{code}\n\nEnsure that the translation follows Swift syntax and idioms, considering language-specific best practices. You may also need to add required imports/frameworks."
|
|
|
|
| 24 |
context = f"Translate the following {from_language} code snippet to {to_language}:\n\n{code}\n\nEnsure that the translation follows Python syntax and idioms, considering language-specific best practices. You may also need to add required imports/modules."
|
| 25 |
elif from_language == "Python" and to_language == "Ruby":
|
| 26 |
context = f"Translate the following {from_language} code snippet to {to_language}:\n\n{code}\n\nEnsure that the translation follows Ruby syntax and idioms, considering language-specific best practices. You may also need to add required gems/libraries."
|
| 27 |
+
elif from_language == "Swift" and to_language == "Python":
|
| 28 |
context = f"Translate the following {from_language} code snippet to {to_language}:\n\n{code}\n\nEnsure that the translation follows Python syntax and idioms, considering language-specific best practices. You may also need to add required imports/modules."
|
| 29 |
elif from_language == "Python" and to_language == "Swift":
|
| 30 |
context = f"Translate the following {from_language} code snippet to {to_language}:\n\n{code}\n\nEnsure that the translation follows Swift syntax and idioms, considering language-specific best practices. You may also need to add required imports/frameworks."
|