View the GitHub project here or download the latest release here.
View the Java Docs here.
The Language Translation Integration project integrates with third-party translation services like Google Cloud Translation or Microsoft Cognitive Services. Translated text can be added as custom metadata, or appended to (or cleared from) an item's text.
Begin by downloading the latest release of this code. Extract the contents of the archive into your Nuix scripts directory. In Windows the script directory is likely going to be either of the following:
%appdata%\Nuix\Scripts
- User level script directory%programdata%\Nuix\Scripts
- System level script directory
This translator makes use of the LibreTranslate project. LibreTranslate provides a translation server which can be ran locally. You will need to install and run the LibreTranslate server.
You will need a Google Cloud Platform account to access the Google Cloud Translation API. Use the following steps to sign up for an account:
- Sign up for an account here, https://cloud.google.com/translate/
- From the Google Cloud Platform Console select
APIs & Services
- From the API Dashboard select
Enable APIs and Services
- Search for and enable the
Google Cloud Translation API
- On the Google Cloud Translation API overview select
Credentials
- Click
Create credentials
and selectAPI Key
- Copy the API key provided
The script makes use of a RubyGem which must be installed using the following command run via Command Prompt from your Nuix Workstation installation directory
c:\Program Files\Nuix\Nuix 7.8>jre\bin\java -Xmx500M -classpath lib\* org.jruby.Main --command gem install easy_translate --user-install
You will need a key for Microsoft's Translator Text API. This can be obtained by:
- Signing into Microsoft Azure.
- Navigating to Cognitive Services.
- Adding & configuring a Text-Translation Service.
- Once created the API key is accessible from the console.
The script requires a case be opened and items are selected.
Once you have selected items and started the script, an input dialog will prompt the user to select from the available NuixTranslator
options. The selected NuixTranslator
will prompt for settings (if required) and present a progress dialog as it runs through the current selected items.
The script uses sticky settings which are kept within the script's directory. Each NuixTranslator
will have its own sticky settings, and settings can be saved/loaded through JSON.
NuixTranslator
is the base class, for initializing settings and progress dialogs as it runs through the current selected items. It contains methods for getting an item's original text, appending translated text, or adding translations as custom metadata.
Translation options are implemented as NuixTranslator
subclasses, each defining a constant NAME
string for itself (mostly used when showing dialogs), and a public method .run(items)
to get the input settings and iterate over the selected items.
New translation options can be added by creating a NuxiTranslator
subclass .rb file in the script's "Translators" subdirectory.
- Language - The translation target language.
- Operation - Append Text or Add Custom Metadata.
Uses Google Cloud Translation through the EasyTranslate gem.
Adds the ability to detect an item's language, annotating the item's language as a tag or custom metadata.
- Apply detected language as custom metadata
- Custom Metadata Field Name - Custom metadata field name to use
- Tag items with detected language?
- Tag Name - Applied tag will be
<Tag Name>|<Detected Language>
- Tag Name - Applied tag will be
Uses the Microsoft Translator Text API.
Once you have installed the LibreTranslate server and have it running, open a Nuix case, select the items you would like to translate and run the script. When prompted, select the choice Libre Translate.
If you have your LibreTranslate server running on localhost
and port 5000
then for API URL you will provide the value http://localhost:5000/translate
. Then choose the source language, translation destination language and other options.
Special thanks to @Trekky12 for contributing the LibreTranslate connector!
Removes translation text from selected items, obtaining an item's original text using methods from NuixTranslator
.
This script relies on code from Nx to present a settings dialog and progress dialog. This JAR file is not included in the repository (although it is included in release downloads). If you clone this repository, you will also want to obtain a copy of Nx.jar by either:
- Building it from the source
- Downloading an already built JAR file from the Nx releases
Once you have a copy of Nx.jar, make sure to include it in the same directory as the script.
Copyright 2019 Nuix
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.