Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/desentio/weploy-translate
weploy.ai - Translate websites with ai
https://github.com/desentio/weploy-translate
ai i18n i18n-tool i18next i18next-backend localization translation
Last synced: about 3 hours ago
JSON representation
weploy.ai - Translate websites with ai
- Host: GitHub
- URL: https://github.com/desentio/weploy-translate
- Owner: desentio
- Created: 2023-05-12T07:21:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-06T15:11:39.000Z (13 days ago)
- Last Synced: 2024-11-09T01:37:32.373Z (11 days ago)
- Topics: ai, i18n, i18n-tool, i18next, i18next-backend, localization, translation
- Language: JavaScript
- Homepage: https://weploy.ai
- Size: 1.5 MB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Enhance your website with GPT-4 powered translations. For more details, visit our integration guides: [globalseo.ai/integration](https://www.globalseo.ai/integration).
### About the Integration
To set up Globalseo, follow these steps:
1. **Sign Up**: Go to [Globalseo](https://app.globalseo.ai) and sign up.
2. **Create a Project**: Select the languages you want to translate your website into.
3. **Copy the Code**: Copy the generated HTML code.
4. **Embed the Code**: Add the custom code to the start of the `` tag and include the code for the language switcher.
5. **Save the Project**: Finalize by saving your project.### 1. Insert the Script
Place the following script inside your tag
```html```
#### Script Configuration:
1. Replace YOUR_API_KEY with the actual API key obtained from your project.
2. Set `data-original-language` to your website's primary language code.
3. Add the languages you want to translate your website to here: `data-allowed-languages`.#### Optional Configuration:
- **data-use-browser-language**: Automatically sets the language based on the user's browser language. Set to `false` to disable.
- **data-exclude-classes**: List CSS class names to exclude from translation, separated by commas (e.g., `chatbot, no-translate`).
- **data-exclude-ids**: List IDs to exclude from translation, separated by commas (e.g., `user-comment, code-snippet` will prevent translation of elements with ID `user-comment` and `code-snippet`).
- **data-exclude-paths**: List URL paths to exclude from translation, separated by commas (e.g., `/admin, /blog` will prevent translation of URLs containing `/admin` and `/blog`). NOTE: Each path should start with a `/`.#### Server Side Rendering Configuration:
- **data-translation-mode**: Modify the translated pages logic. Set to `subdomain` to point to subdomains (for example: de.domain.com), or `subdirectory` to point to paths (for example: domain.com/de). *DONT USE* if you are not using SSR (SSR only available in higher plans).View more options [here](#advanced-configuration).
### 2. Add the language selector
Enable users to select a language by adding:
```html
```## Excluding Text from Translation
Use the class "globalseo-exclude" to prevent translation of specific content, like chat pop-ups or user-generated text.Note: Input fields and iframes are ignored by default.
## Directing Users to a Specific Language Version
Direct users to a specific language version by using the /?lang=LANGUAGE_CODE URL parameter. For instance, example.com/?lang=ru will automatically translate the page into Russian.
## Advanced Configuration
- **data-translate-attributes**: Translates `title` & `alt` attributes of images and links. Improves SEO and accessibility. Set to `true` to enable.
- **data-lang-parameter**: URL parameter for setting the language (default: "lang"). Use a custom value if preferred.
- **data-timeout**: Delay (in milliseconds) before the translation service activates, ensuring the page content is fully loaded.
- **data-replace-links**: Replaces links with translated URLs by appending the language code. Set to `false` to disable.
- **data-custom-language-code**: Custom language code for the language selector (e.g., `kk=kz` for "KZ" instead of "KK").
- **data-exclude-contents**: Excludes specific text from translation using regular expressions. Format: `{{regex1}} {{regex2}}`.
- **data-translate-form-placeholder**: Translates form placeholders. Set to `true` to enable.
- **data-dynamic-translation**: Allow GlobalSEO to automatically generate new translations. Set to `false` to disable. If you have already reached the quota limit, setting this to false will prevent the error message from appearing on your site.
- **data-translate-select-options**: Translate options inside select tag. Set to `true` to enable. The `globalseo-exclude` class will still be respected.