Skip to content

Issue with Interpolation Misalignment in Large Translation Files #65

@Guigeek973

Description

@Guigeek973

Hello,

I'm encountering a strange issue while translating a large JSON file that contains around 3600 keys. Specifically, starting from approximately the 600th key, string interpolation placeholders (e.g., {{value}}) begin to appear in the wrong places in the translated output.
I use Deepl, but i don't think it's specific to deepl api.

For example, in the original French file (fr.json), I have:
"askMultiValidate": "Êtes-vous sûr(e) de vouloir valider {{ count }} réseaux ?",
"noData": "Aucune donnée ne correspond au filtre "{{ count }}"",
"pendingRequest": "Requête en attente de validation de {{fullName}}",
"success": "{{firstname}} {{lastname}} a bien été lié à {{whiteLabel}}",

But in the Spanish translation (es.json), I get:
"askMultiValidate": "¿Está seguro de que desea validar {{ count }} redes?",
"noData": "Ningún dato coincide con el filtro "{{ filter }}"",
"pendingRequest": "Solicitud pendiente de validación de {{ count }}",
"success": "{{ filter }} {{fullName}} ha sido enlazado a {{firstname}}",

As you can see, the {{ count }} placeholder has been incorrectly replaced with {{ filter }} in the second key. This misplacement continues for all subsequent keys that use interpolation.

Interestingly, if I isolate and translate only the affected keys (e.g., by removing all the others and running the translation command again), the placeholders are correctly preserved.

It seems like the translation process is somehow misaligning interpolation variables beyond a certain point. Do you have any idea what might be causing this behavior?

Contact me (email in bio github) if u need to get a sample of my json files... i will be very grateful if u can find why i got some bad interpolation !

Thanks u a lot for your nice package and reactivness ! @while1618

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions