API Tour Translations

Q&A about the latest versions
Post Reply
User avatar
SMerriss
Posts: 60
Joined: Mon Sep 28, 2020 2:12 pm
Location: Columbus Ohio
Contact:

Hello everyone,

I just wanted to share a recent project of mine where I attempted to use an API to translate the tour. I had some success and some failures, but I wanted to put it all out there in case somebody else had a similar idea of tour translation, or maybe wanted to try this. Here is a link to the tour for anyone who's curious.

https://onsceneinteractive.com/tours/Co ... index.html

The reason for wanting to use an API was because this tour in particular was a giant with a lot of information that would be needed to be read in 5 languages. This process would also allow for easy language expansions in the future, as well as being able to use the same system for different tours, lightening the load while offering a new service to clients.

My goal was for a single button created within the pano software that would control a variable that could communicate with an outside program that would then translate everything in the tour. This was well past my level of understanding, so I hired a friend of mine who does software engineering to help with the process.

The API we decided to use was Microsoft AZURE because it was easier to understand over the Google Translate API. AZURE does not offer as many languages as Google, but the trade off for simplicity was worth it. Getting the API to work on its own with just plain text was a chore itself. Once we got it running, we were able to start the integration.

The largest obstacle we came across was figuring out a way to have a button within pano communicate with an outside program due to the file structure of the tour. The index.html file that is uploaded, isn't what is necessarily displayed to somebody viewing it. A dynamic HTML page is created which holds the variable value that controls which language is selected, not the HTML file that is uploaded. This is what ultimately caused us to pivot the project.

Because of this, everything in the tour needed to be translated manually, leading me to use the same system that so many have described before. But to keep load times as fast as possible, I made each of the teacher bios their own HTML page that could then be displayed in an Iframe. Because of this, we were able to use the translator API on all of the Iframes used in the tour. All teacher bios are use the API, but everything else is manually translated.
Screen Shot 2021-08-17 at 2.31.40 PM.png
Screen Shot 2021-08-17 at 2.31.40 PM.png (920.91 KiB) Viewed 1552 times
This button controls all of the hard coded translations in the tour
Screen Shot 2021-08-17 at 2.30.45 PM.png
Screen Shot 2021-08-17 at 2.30.45 PM.png (139.03 KiB) Viewed 1552 times
These translations are all controlled by the API

Like I said before, we had some success, but not to the scale we were shooting for. The main limitation was with Pano itself and how variables and skin elements are exported, making it extremely difficult to access information through multiple layers that could have possibly made it able to communicate with the API.

If I were to do this all again, I would probably just hardcode all of the translations due to having more control. I think what really came back to bite me was just the size of the project, and how much needed to be translated. I believe it would have been a lot easier to have worked with a smaller project before attempting something of this scale.

I hope I was able to describe everything and make it clear as to what the process looked like, but it is a lot of information to go over and a lot of technical jargon. If anyone has questions or needs clarification please let me know.

Thanks,
Spencer
Spencer Merriss
Multimedia Specialist

Website: https://www.spencermerriss360.com/
Email: merriss.spencer@gmail.com

Feel free to reach out! 🌟
User avatar
360Texas
Moderator
Posts: 3684
Joined: Sat Sep 09, 2006 6:06 pm
Location: Fort Worth, Texas USA
Contact:

Soft and Politely spoken: Back ground comment about upper level education: is spelled Columbia "College" Duh... oh ok I knew that and will correct.
Dave
Pano2VR Forum Global Moderator
Image
Visit 360texas.com
User avatar
Taka
Posts: 51
Joined: Fri May 28, 2021 3:15 pm
Location: Tokyo

Please include Japanese.٩(ˊᗜˋ*)و
deedee123
Posts: 285
Joined: Wed May 20, 2020 10:38 am
Location: NL

I would love to have a straightforward "built-in" way for adding multiple languages. I made a site for two languages by using the data fields for what they are not meant for (like adding translated text to "source" etc) , but there are not enough fields to do this for more than two languages. For any new project i think i would also go for duplicating, but this means any change to anything needs to be done for each language again, and switching 'seamless' isn't possible.
david
Post Reply