You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Its a common requirement when using i8n libraries to have Translations with placeholders for interpolation e.g. :
{ "key": "{{what}} is {{how}}" }
I'm suggesting having a option within the DEEPL provider which solves this problem with the following approach.
Add a usePlaceholders option to the translate method. This will determine whether placeholders should be wrapped in HTML tags before translation. Modify the logic to check this option and decide whether to wrap and strip HTML tags around placeholders.
If usePlaceholders is true, the placeholders are wrapped in HTML tags (...).
After translation, the HTML tags are stripped off to restore the original placeholder format.
If usePlaceholders is false, the placeholders are not modified, and the text is sent as-is.
The text was updated successfully, but these errors were encountered:
Its a common requirement when using i8n libraries to have Translations with placeholders for interpolation e.g. :
{ "key": "{{what}} is {{how}}" }
I'm suggesting having a option within the DEEPL provider which solves this problem with the following approach.
Add a usePlaceholders option to the translate method. This will determine whether placeholders should be wrapped in HTML tags before translation. Modify the logic to check this option and decide whether to wrap and strip HTML tags around placeholders.
If usePlaceholders is true, the placeholders are wrapped in HTML tags (...).
After translation, the HTML tags are stripped off to restore the original placeholder format.
If usePlaceholders is false, the placeholders are not modified, and the text is sent as-is.
The text was updated successfully, but these errors were encountered: