PanLingua is a simple shortcut to searching for preprints on bioRxiv.org using non-English search terms, intended to streamline access to preprints for readers who speak any of the 104 languages currently supported by Google Translate. Most of the work is done by Google and bioRxiv:
- A user arrives at panlingua.rxivist.org. They are presented with a search box and a list of languages supported by the Google Cloud Translate API.
- The user inputs a search term in their chosen language and submits the form.
- The user's input is sent to the Google Cloud Translate API, which provides an English translation of the search term.
- The translated search term is used to generate a URL of the standard bioRxiv search.
- The generated bioRxiv URL is passed to translate.google.com, which provides a translated version of that page in whatever language was originally selected by the user.
- The user is redirected to the translate.google.com page with the search results.
- Humberto Debat, research scientist, Instituto Nacional de Tecnología Agropecuaria (IPAVE-CIAP-INTA)
- debat.humberto at inta.gob.ar
- Rich Abdill, PhD student, University of Minnesota
- rabdill at umn.edu
Setting up third-party services
- Only the Translation API is required.
- Sign up for a Google Cloud account and enable the Cloud Translation API.
- Follow their instructions for creating a service account and obtaining a credentials file. This file is how the PanLingua will authenticate to the Google API.
- Rename this file
google_cloud_credentials.jsonand put it in the application's root directory (the same directory holding this README and
- Google reCAPTCHA is optional, but highly recommended if you're exposing your website to the public.
- Sign up for reCAPTCHA v3.
- Once registration is complete, you'll be given a public and private key for the reCAPTCHA API. Paste these values into
- For local development, you'll likely have to disable reCAPTCHA; the client-side code won't work if it's run from
localhostinstead of whatever production URL you specified to Google.
- Google Analytics is optional.
- Sign up for an Analytics account.
UA-123456. Copy this ID and set it as the value for the
Working on PanLingua locally does not require Docker, but you can avoid cluttering your local environment by installing it for free.
Once Docker is installed and running in the background, you can launch a development environment by running command from the application's root directory:
docker run -it --rm --name panlingua -p 8120:80 -v "$(pwd)":/app --env GOOGLE_APPLICATION_CREDENTIALS="/app/google_cloud_credentials.json" python:slim bash
You run this command, the PanLingua application should be available in your browser at
You can also launch the application outside of a container. (Using a virtual environment is not required, but is also probably a good idea.) To run the app locally, navigate to the application's root directory and run the following commands:
export GOOGLE_APPLICATION_CREDENTIALS="$(pwd)/google_cloud_credentials.json" pip install -r requirements.txt python main.py
There are many options for running a Python application in production; we leave these decisions to you. One important note is that the
GOOGLE_APPLICATION_CREDENTIALS environment variable must be set wherever the application is running.