Skip to content

Commit

Permalink
feat:Gemini translation improved
Browse files Browse the repository at this point in the history
  • Loading branch information
HU Xin authored and HU Xin committed Sep 13, 2024
1 parent 466aede commit 572d798
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/translate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9' # Specify Python version
python-version: '3.12.3' # Specify Python version

- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion assets/flutter_i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@
"you_will_be_directed_to_the_main_app": "You will be directed to the main app",
"account_setup_complete": "Account Setup Complete!",
"entering_the_app": "Entering the App",
"in": "Loading..",
"in": "Loading...",
"google_drive_secured_storage": "Google Drive secured storage",
"icloud_secured_storage": "iCloud Secured storage",
"make_sure_you_have_stored_your_keys_correctly_in_your_x": "Make sure you have stored your keys correctly in your {0}",
Expand Down
4 changes: 1 addition & 3 deletions assets/flutter_i18n/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ def translate(text, target_language):
response = model.generate_content(
[f"this is an API, please just translate the following English text to {target_language}: {text}"]
)
# Extract the translated text
translated_text = response.result.candidates[0].content.parts[0].text.strip()
return translated_text
return response.text.strip()

def main():
language_dict = {
Expand Down

0 comments on commit 572d798

Please sign in to comment.