Commit 2c8c165 1 parent 9d7fea0 commit 2c8c165 Copy full SHA for 2c8c165
File tree 1 file changed +8
-7
lines changed
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -289,16 +289,17 @@ async def translate(
289
289
290
290
pron = origin
291
291
try :
292
- pron = data [0 ][1 ][- 2 ]
292
+ # Get pronunciation from [0][1][3] which contains romanized pronunciation
293
+ if data [0 ][1 ] and len (data [0 ][1 ]) > 3 :
294
+ pron = data [0 ][1 ][3 ]
295
+ # Fallback to previous methods if not found
296
+ elif data [0 ][1 ] and len (data [0 ][1 ]) > 2 :
297
+ pron = data [0 ][1 ][2 ]
298
+ elif data [0 ][1 ] and len (data [0 ][1 ]) >= 2 :
299
+ pron = data [0 ][1 ][- 2 ]
293
300
except Exception : # pragma: nocover
294
301
pass
295
302
296
- if pron is None :
297
- try :
298
- pron = data [0 ][1 ][2 ]
299
- except : # pragma: nocover # noqa: E722
300
- pass
301
-
302
303
if dest in EXCLUDES and pron == origin :
303
304
pron = translated
304
305
You can’t perform that action at this time.
0 commit comments