Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong special char replacement when saving a translation #286

Open
igops opened this issue Sep 25, 2017 · 4 comments
Open

Wrong special char replacement when saving a translation #286

igops opened this issue Sep 25, 2017 · 4 comments

Comments

@igops
Copy link

igops commented Sep 25, 2017

Hello,

The actual problem I have is that encodeURIComponent breaks all my chars excepting english letters.
E.g. "Invalidate cache" turns to "Invalidate%20cache" after pressing Save button.

I had to change this block to fix it:

// web/bundles/lexiktranslation/js/translation.js:82

for (var name in translation) {
    // parameters[name] = encodeURIComponent(translation[name]);
    parameters[name] = translation[name];
}

My config is:

# Lexik Translations
lexik_translation:
    fallback_locale: [en]         # (required) default locale(s) to use
    managed_locales: [en, lv, ru] # (required) locales that the bundle has to manage
    grid_input_type: textarea     # text|textarea

PR with encodeURIComponent was added: #72

What I'm doing wrong?

@frenchcomp
Copy link

frenchcomp commented Sep 28, 2017

Hello,
I have the same issue. All non ascii characters and whitespace are urlencoded (%20, %C3%A9, %C3%A0, etc..)

Edit: I have no issue with 4.0.3, only with 4.0.4.

Thanks.

@idchlife
Copy link

Any info on this issue? Translations are saving urlencoded in any language except english, what seems to be the problem?

@frenchcomp
Copy link

Hi,
On a browser localized in France, all message translated (included english message) : In the translation grid are url encoded when they are edited (but not when there are imported). They are not urldecoded in twig, not in the admin grid.

@fundup
Copy link

fundup commented Oct 3, 2017

Same issue for me...

jorissteyn pushed a commit to ibuildingsnl/LexikTranslationBundle that referenced this issue Oct 5, 2017
Since PR lexik#72, all translation updates are sent URL-encoded to the
backend. To allow spaces and markup in translated messages the
datagrid handler must decode the messages before saving them.

Fixes issue lexik#286
sdieunidou pushed a commit that referenced this issue Oct 5, 2017
Since PR #72, all translation updates are sent URL-encoded to the
backend. To allow spaces and markup in translated messages the
datagrid handler must decode the messages before saving them.

Fixes issue #286
ubiedigital pushed a commit to ubiedigital/LexikTranslationBundle that referenced this issue Mar 12, 2018
Since PR lexik#72, all translation updates are sent URL-encoded to the
backend. To allow spaces and markup in translated messages the
datagrid handler must decode the messages before saving them.

Fixes issue lexik#286
ubiedigital pushed a commit to ubiedigital/LexikTranslationBundle that referenced this issue Mar 12, 2018
Since PR lexik#72, all translation updates are sent URL-encoded to the
backend. To allow spaces and markup in translated messages the
datagrid handler must decode the messages before saving them.

Fixes issue lexik#286
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants