# GTranslate

Some users may experience the following issue when using YayCurrency together with GTranslate (paid/proxy version):

* Currency automatically reverts to the default (e.g., EUR)
* Currency changes randomly when switching languages
* Selected currency does not persist across translated pages

This behavior is **not caused by YayCurrency itself**, but by server-side caching from translation proxies that do not respect YayCurrency’s cookie.

The good news:\
✅ **YayCurrency is fully compatible with GTranslate.** It just requires a simple cache configuration.

{% hint style="info" %}

### 💡 Why It Worked With the Free Version

The free version of GTranslate:

* Uses client-side JavaScript translation.
* Does NOT proxy your website through their servers.
* Does NOT cache HTML on their infrastructure.

The paid version:

* Uses **server-side proxy translation**.
* Caches translated pages on their servers.
* Must be configured to vary cache by important cookies.

That’s why upgrading to GTranslate (paid version) introduced the issue.
{% endhint %}

### Why This Happens

YayCurrency stores the selected currency in a cookie:

```
yay_currency_widget
```

This cookie ensures that:

* The selected currency persists across pages
* The correct currency loads across subdirectories and translated URLs

However, when using the **proxy version of GTranslate**, their server-side cache may not respect or vary by this cookie.

As a result:

* Cached pages may be served without considering the user's selected currency.
* The currency may revert to the default or behave inconsistently.

### The Solution

The fix is straightforward:

👉 **Ask GTranslate support to exclude the `yay_currency_widget` cookie from their proxy cache.**

Once this cookie is excluded:

* GTranslate will not serve cached pages that ignore the selected currency.
* The currency switch will remain stable across all translated pages.
* Everything will work perfectly.

### How to Fix It (Step-by-Step)

1. Contact **GTranslate Support**
2. Inform them that:
   * You are using YayCurrency.
   * YayCurrency stores currency in the `yay_currency_widget` cookie.
   * Their proxy cache must exclude this cookie.
3. After GTranslate configures this on their servers, the issue will be resolved.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yaycommerce.com/yaycurrency/compatibility/gtranslate.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
