@tilde-nlp/website-translator 7.1.8 → 7.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
WebsiteTranslator.Options.api.clientId = 'x-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
|
|
3
3
|
|
|
4
4
|
// Step #1: Specify embedded languages of your webpage that has translation already
|
|
5
|
-
WebsiteTranslator.Options.translation.thirdPartyTranslationLanguages = ['en', 'fr']
|
|
5
|
+
WebsiteTranslator.Options.translation.thirdPartyTranslationLanguages = ['en', 'fr', 'de']
|
|
6
6
|
// Step #2: Set language of the webpage that is currently rendered
|
|
7
7
|
WebsiteTranslator.Options.currentLanguage = document.documentElement.getAttribute('lang')
|
|
8
|
+
|
|
8
9
|
console.log('Current document language: ' + WebsiteTranslator.Options.currentLanguage)
|
|
9
10
|
// Step #3: Add custom logic to use embedded translations instead of machine translation
|
|
10
11
|
WebsiteTranslator.Options.translation.onLanguageSelected = function (selectedLanguage) {
|