File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,15 +63,18 @@ const BetterContext = ({ context }: { context?: string }) => {
6363const PostDropdownMenu = ( { post, setTranslatedText } : { post : BSkyPost ; setTranslatedText : ( text : string ) => void } ) => {
6464 const handleTranslate = async ( event : React . MouseEvent < HTMLDivElement > ) => {
6565 event . stopPropagation ( ) ;
66- const response = await fetch ( 'http://localhost:8787' , {
67- method : 'POST' ,
68- body : JSON . stringify ( {
69- q : post . record . text ,
70- source : post . record . langs ?. [ 0 ] ?? 'auto' ,
71- target : navigator . language ,
72- } ) ,
73- headers : { 'Content-Type' : 'application/json' } ,
74- } ) ;
66+ const response = await fetch (
67+ process . env . NODE_ENV === 'production' ? 'https://translate.akari.blue' : 'http://localhost:8787' ,
68+ {
69+ method : 'POST' ,
70+ body : JSON . stringify ( {
71+ q : post . record . text ,
72+ source : post . record . langs ?. [ 0 ] ?? 'auto' ,
73+ target : navigator . language ,
74+ } ) ,
75+ headers : { 'Content-Type' : 'application/json' } ,
76+ } ,
77+ ) ;
7578 const json = ( await response . json ( ) ) as {
7679 alternatives : [ ] ;
7780 detectedLanguage : {
You can’t perform that action at this time.
0 commit comments