VRHandsFrame

日本語ページ

Deployment of personal translation servers

VRHandsFrame’s translation functionality is by default based on a single translation server that is shared by all users.
Since the translation server uses a service called Google App Script (GAS), the number of translations is limited (5000 times/day). In other words, in the default state, 5000 times/day of translation resources are shared by all users.

This page explains how to use GAS to deploy a personal translation server in VRHandsFrame.
By using your own personal translation server, each user can use the full 5000 times/day translation resource.

*These are the installation procedures as of May 2022; changes in Google’s specifications or updates to VRHandsFrame may result in changes to the procedures.

Index

  1. Create a Google account and sign in
  2. Set the translation script in GAS and get a Deployment ID
  3. Set Deployment ID (GAS Key) to VRHandsFrame

1. Create a Google account and sign in

Please create a Google account and log in.
If you already have an account, you do not need to create a new account.

2.Set the translation script in GAS and get a Deployment ID

Open this link and click on “New project” in the upper right corner to
Open the Create New Project page.

Copy the script below and overwrite the script set up in the new project.

function doPost(e) {
//console.log(e.postData.contents);
var p = JSON.parse(e.postData.getDataAsString());
var translatedText = LanguageApp.translate(p.text, p.source, p.target);
//console.log(translatedText);
return ContentService.createTextOutput(translatedText);
}


Overwrite the script and save the project.



Next, click the blue “Deploy” button in the upper right corner and select “New deployment”.


Click on the gear icon in the upper left corner and select “Web app”.


Enter some description in the “New Description” field.

Change the “Who has access” field to “Anyone“.

Do not change the “Execute as” field.
(Make sure your Gmail address is filled in).

When you have finished making changes to the input fields, click the Blue “Deploy” button in the lower right corner to proceed.

On the next window, copy the “Deployment ID”.

Finally, click the “Done” button to complete the deployment.


If you want to check the “Deployment ID” of a deployed project later, you shall select “Manage deployments” .

3. Set Deployment ID (GAS Key) to VRHandsFrame

Set the “Deployment ID” copied in step 2 in VRHandsFrame. The “Deployment ID” is stored in VRHandsFrame as a parameter named “GAS Key”.

GAS Key settings should be made for “Global Settings”.
The GAS Key applied to the “Global Settings” is automatically cloned in the “Application Settings”.

There are two methods to set up the GAS Key

[Method 1: Paste from the VR dashboard (recommended)]

With the “Deployment ID” copied, select the “Paste & Test” button in the “Translation” tab on the SteamVR dashboard.

If the personal translation server is correctly set up and the GAS Key is successfully pasted, the GAS Key will appear in the “Google Apps Script API Key” field. In addition, the word “OK” will appear on the left side of the button.

After pasting the GAS Key, select the Save button to save the “Global Settings” status.

[Method 2: Edit the config file with a text editor from Desktop]

Edit the config file at the VRHandsFrame folder directly with a text editor such as Notepad.
Please do this while VRHandsFrame is not running.

The Global Settings config file is stored in a json format file at the following path

Global Settings:
\VRHandsFrame_Data\StreamingAssets\config\global.json

Paste the “Deployment ID” copied in step 2 into the “GASKey” parameter in the config file.

Be sure to close the text editor after editing the config file.
If you leave the config file open, you may not be able to make other configuration changes on the VR dashboard.