New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

globalseo

Package Overview
Dependencies
Maintainers
0
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

globalseo - npm Package Compare versions

Comparing version 2.1.42 to 2.1.43

2

package.json
{
"name": "globalseo",
"version": "2.1.42",
"version": "2.1.43",
"description": "Translate your React.js or Next.js app with AI",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -13,3 +13,3 @@ Enhance your website with GPT-4 powered translations. For more details, visit our integration guides: [globalseo.ai/integration](https://www.globalseo.ai/integration).

#### 1. Insert the Script
### 1. Insert the Script
Place the following script inside your <head> tag

@@ -28,3 +28,3 @@ ```html

API Key Configuration:
#### Script Configuration:

@@ -35,19 +35,18 @@ 1. **Important:** Replace YOUR_API_KEY with the actual API key obtained from your project. This is crucial for enabling the translation services.

Common Optional Configuration:
- data-use-browser-language: By default, this is set to automatically translate the website based on the user's browser language. If you prefer to disable this feature, set it to false.
- data-exclude-classes: Specify any CSS class names that should not be translated by the service. This is particularly useful for elements such as chatbots, which may not require translation. List the classes separated by commas (e.g., chatbot, no-translate).
- data-replace-links: By default, this is set to true, which allows the service to replace links with the translated URLs by appending the language code to the URL. If you wish to disable this feature, set it to false.
- data-auto-create-selector: By default, this is set to true, which automatically creates a language selector on your website (if you put the language selector code). If you prefer to create a custom language selector, set this to false.
- data-timeout: Set the delay (in milliseconds) before the translation service is activated. This is useful for ensuring that the page content is fully loaded before translation begins.
<!-- - data-dynamic-translation: By default, this is set to true, which enables dynamic translation of new content that is added to the page after the initial load. If you prefer to disable this feature, set it to false. Disabling this feature can prevent malicious actors from translating content that is not intended for translation. -->
- data-translate-attributes: If enabled, this feature will translate title & alt attributes of images and title attributes of links. This feature is intended to improve SEO and accessibility. By default, this is set to false. To enable this feature, set it to true.
#### Optional Configuration:
- **data-use-browser-language**: Automatically translates the website 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-replace-links**: Replaces links with translated URLs by appending the language code. Set to `false` to disable.
- **data-auto-create-selector**: Automatically creates a language selector if the code is present. Set to `false` for a custom selector.
- **data-timeout**: Delay (in milliseconds) before the translation service activates, ensuring the page content is fully loaded.
- **data-translate-attributes**: Translates `title` & `alt` attributes of images and links. Improves SEO and accessibility. Set to `true` to enable.
Advanced Optional Configuration:
- data-lang-parameter: Specify the URL parameter that should be used to set the language. By default, this is set to "lang". If you prefer to use a different parameter, you can set it to a custom value. For example if you set this value to "t", then the language selector will append "?t=de" to the URL when the user selects the German language.
- data-custom-language-code: Specify a custom language code that should be shown in the language selector. This is useful for displaying a different language name in the selector than the actual language code. For example, you can set this attribute to "kk=kz" to display "KZ" in the language selector instead of "KK" (because people may have familiarity with the country code "KZ" for Kazakhstan).
- data-translate-splitted-text (BETA) : Merge texts that are split into multiple elements (at least contains 1 inline element, e.g., <span> tags) into a single translation unit. By default, this is set to false. To enable this feature, set it to true. This feature is useful for translating text that is split into multiple elements, such as headings or paragraphs. For example: <h1 <span My</span <span Brand</span </h1 will be translated as a single unit. NOTE: This feature is in BETA and may not work as expected in all cases.
- data-exclude-contents: Specify text content that should not be translated by the service by using regular expressions. This is useful for excluding specific text from translation. The attribute value should be a string of regular expressions wrapped in double curly braces and separated by spaces. Format: "{{regex1}} {{regex2}} {{regex3}}". For example if you want to exclude all text that contains the word "My Brand", you can set this attribute to "{{My Brand}}". Or if you want match exact text, you can use "{{^My Brand$}}".
- data-translate-form-placeholder: By default, this is set to false, which disables the translation of form placeholders. If you prefer to enable this feature, set it to true. This feature is useful for translating placeholders in form fields.
#### Advanced Configuration
- **data-lang-parameter**: URL parameter for setting the language (default: "lang"). Use a custom value if preferred.
- **data-custom-language-code**: Custom language code for the language selector (e.g., `kk=kz` for "KZ" instead of "KK").
- **data-translate-splitted-text (BETA)**: Merges split text elements into a single translation unit. Set to `true` to enable (e.g., `<h1><span>My</span> <span>Brand</span></h1>`).
- **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.
#### 2. Add the language selector
### 2. Add the language selector
Enable users to select a language by adding:

@@ -71,3 +70,3 @@ ```html

## Excluding Text from Translation
⚠️ **Developer Notice:** Use the class "globalseo-exclude" to prevent translation of specific content, like chat pop-ups or user-generated text.
Use the class "globalseo-exclude" to prevent translation of specific content, like chat pop-ups or user-generated text.

@@ -74,0 +73,0 @@ Note: Input fields and iframes are ignored by default.

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc