Skip to content

Commit

Permalink
Merge pull request #1116 from AI4Bharat/xlit-api-proxy
Browse files Browse the repository at this point in the history
use xlit api proxy through shoonya-backend
  • Loading branch information
ishvindersethi22 authored Oct 10, 2024
2 parents f3a557d + b4084fb commit 3f75e7f
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 5 deletions.
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@ai4bharat/indic-transliterate": "^1.3.6",
"@ai4bharat/indic-transliterate": "^1.3.8",
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@heartexlabs/label-studio": "^1.4.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,8 @@ const AllAudioTranscriptionLandingPage = () => {
>
{stdTranscriptionSettings.enableTransliteration ? (
<IndicTransliterate
customApiURL={`${configs.BASE_URL_AUTO}/tasks/xlit-api/generic/transliteration/`}
apiKey={`JWT ${localStorage.getItem('shoonya_access_token')}`}
lang={stdTranscriptionSettings.targetlang}
value={stdTranscription}
onChange={(e) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,8 @@ useEffect(() => {
>
{stdTranscriptionSettings.enableTransliteration ? (
<IndicTransliterate
customApiURL={`${configs.BASE_URL_AUTO}/tasks/xlit-api/generic/transliteration/`}
apiKey={`JWT ${localStorage.getItem('shoonya_access_token')}`}
lang={stdTranscriptionSettings.targetlang}
value={stdTranscription}
onChange={(e) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,8 @@ useEffect(() => {
>
{stdTranscriptionSettings.enableTransliteration ? (
<IndicTransliterate
customApiURL={`${configs.BASE_URL_AUTO}/tasks/xlit-api/generic/transliteration/`}
apiKey={`JWT ${localStorage.getItem('shoonya_access_token')}`}
lang={stdTranscriptionSettings.targetlang}
value={stdTranscription}
onChange={(e) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,8 @@ useEffect(() => {
>
{stdTranscriptionSettings.enableTransliteration ? (
<IndicTransliterate
customApiURL={`${configs.BASE_URL_AUTO}/tasks/xlit-api/generic/transliteration/`}
apiKey={`JWT ${localStorage.getItem('shoonya_access_token')}`}
lang={stdTranscriptionSettings.targetlang}
value={stdTranscription}
onChange={(e) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ import UnfoldMoreOutlinedIcon from '@mui/icons-material/UnfoldMoreOutlined';
import { IconButton, Tooltip } from "@mui/material";
import { Add, MoreVert, Remove } from "@material-ui/icons";
import TransliterationAPI from "../../../../redux/actions/api/Transliteration/TransliterationAPI";
import configs from "../../../../config/config";

const TranscriptionRightPanel = ({
currentIndex,
Expand Down Expand Up @@ -804,6 +805,8 @@ const TranscriptionRightPanel = ({
{ProjectDetails?.tgt_language !== "en" &&
enableTransliteration ? (
<IndicTransliterate
customApiURL={`${configs.BASE_URL_AUTO}/tasks/xlit-api/generic/transliteration/`}
apiKey={`JWT ${localStorage.getItem('shoonya_access_token')}`}
lang={targetlang}
value={item.text}
onChange={(event) => {
Expand Down Expand Up @@ -871,6 +874,8 @@ const TranscriptionRightPanel = ({
(ProjectDetails?.tgt_language !== "en" &&
enableTransliteration ? (
<IndicTransliterate
customApiURL={`${configs.BASE_URL_AUTO}/tasks/xlit-api/generic/transliteration/`}
apiKey={`JWT ${localStorage.getItem('shoonya_access_token')}`}
lang={targetlang}
value={item.acoustic_normalised_text}
onChange={(event) => {
Expand Down
5 changes: 5 additions & 0 deletions src/ui/pages/container/Glossary/AddGlossary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
} from "@ai4bharat/indic-transliterate";
import "../../../../IndicTransliterate/index.css";
import { MenuProps } from "../../../../utils/utils";
import configs from "../../../../config/config";

const AddGlossary = ({
openDialog,
Expand Down Expand Up @@ -278,6 +279,8 @@ const AddGlossary = ({

{ Sourcedata.length > 0 && selectedSourceLang !== "en" ? (
<IndicTransliterate
customApiURL={`${configs.BASE_URL_AUTO}/tasks/xlit-api/generic/transliteration/`}
apiKey={`JWT ${localStorage.getItem('shoonya_access_token')}`}
lang={Sourcelanguage.LangCode ? Sourcelanguage.LangCode : (Sourcedata.length > 0 ? Sourcedata[0]?.LangCode : "hi" )}
value={SourceText}
onChangeText={(SourceText) => {
Expand All @@ -293,6 +296,8 @@ const AddGlossary = ({
/>)}
{ data.length > 0 && selectedTargetLang !== "en" ? (
<IndicTransliterate
customApiURL={`${configs.BASE_URL_AUTO}/tasks/xlit-api/generic/transliteration/`}
apiKey={`JWT ${localStorage.getItem('shoonya_access_token')}`}
lang={Targetlanguage.LangCode ? Targetlanguage.LangCode : (data.length > 0 ? data[0]?.LangCode : "hi")}
value={targetText}
onChangeText={(targetText) => {
Expand Down
3 changes: 3 additions & 0 deletions src/ui/pages/container/Glossary/SuggestAnEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
getTransliterationLanguages,
} from "@ai4bharat/indic-transliterate";
import "../../../../IndicTransliterate/index.css";
import configs from "../../../../config/config";

const SuggestAnEdit = ({
openDialog,
Expand Down Expand Up @@ -147,6 +148,8 @@ const [Targetlanguage, setTargetlanguage] = useState([]);

{ targetData.length > 0 && targetlang !== "en" ? (
<IndicTransliterate
customApiURL={`${configs.BASE_URL_AUTO}/tasks/xlit-api/generic/transliteration/`}
apiKey={`JWT ${localStorage.getItem('shoonya_access_token')}`}
lang={Targetlanguage.LangCode ? Targetlanguage.LangCode : (targetData.length > 0 ? targetData[0]?.LangCode : "en" )}
value={targetText}
onChangeText={(targetText) => {
Expand Down
3 changes: 3 additions & 0 deletions src/ui/pages/container/Transliteration/Transliteration.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import TransliterationAPI from "../../../../redux/actions/api/Transliteration/Tr
import useMediaQuery from '@mui/material/useMediaQuery';
import { useDispatch, useSelector } from "react-redux";
import { useParams } from "react-router-dom";
import configs from "../../../../config/config";
const Transliteration = (props) => {
const { onCancelTransliteration ,setIsSpaceClicked,isSpaceClicked,setShowTransliterationModel} = props;
const params = useParams();
Expand Down Expand Up @@ -226,6 +227,8 @@ const Transliteration = (props) => {
</Grid>

<IndicTransliterate
customApiURL={`${configs.BASE_URL_AUTO}/tasks/xlit-api/generic/transliteration/`}
apiKey={`JWT ${localStorage.getItem('shoonya_access_token')}`}
lang={selectedLang.LangCode ? selectedLang.LangCode : (data.length > 0 && (params.taskId || params.id) ? data[0]?.LangCode : "hi")}
value={text}
onChangeText={(val) => {
Expand Down

0 comments on commit 3f75e7f

Please sign in to comment.