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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

CP locale is hardcoded inside the javascript translator 馃嚚馃嚟 #1186

Closed
rrelmy opened this Issue Jan 18, 2017 · 9 comments

Comments

Projects
None yet
6 participants
@rrelmy

rrelmy commented Jan 18, 2017

Expected behaviour

The JavaScript translator in the CP should respect the current locale and translate non english languages correctly

Actual behaviour

The JavaScript translator always uses english because the current locale is never set.

The translations are prefixed with the correct locale (Inside Statamic.translations) but the method Lang.setLocale is never used to set the correct locale.

A good place to see that is the cp.add_row button on grids.

Steps to reproduce

  1. Change CP language to de (or any other language)
  2. Create a translation directory for it (copy the original en version)
  3. use translate('cp.addons_empty') inside your JS console

Be aware that there is a fallback when no message is found the key is titleized (add_row => Add row)

Server configuration

Statamic version: 2.1.19

@rrelmy

This comment has been minimized.

rrelmy commented Jan 18, 2017

Related: #1162

@peda

This comment has been minimized.

peda commented Jan 18, 2017

I didn't debug it, but I do have the same issue with cp.add_row on grid fields (my setup is very similar)

Most of #1162 has been fixed in 2.1.19 but it seems like there is still some work to do.

@ebeauchamps

This comment has been minimized.

ebeauchamps commented Jan 18, 2017

ah, getting close!

@peimn

This comment has been minimized.

peimn commented Jan 18, 2017

#585 #issuecomment-209625019

@jaggy

This comment has been minimized.

jaggy commented Feb 2, 2017

We've rewritten how translations on the front end work so all the translations won't be all bottled up in the en prefix.

The translations on the front end should look like this when this gets out. 锟http://d.pr/i/I9nI

@jaggy

This comment has been minimized.

jaggy commented Feb 2, 2017

@rrelmy do you mind if You send me a zip of your project so I can see what's up? jaggy@statamic.com

@rrelmy

This comment has been minimized.

rrelmy commented Feb 2, 2017

@jaggy Just sent you a mail

@jaggy

This comment has been minimized.

jaggy commented Feb 2, 2017

Just got it. I'll let you know what I find.

@jaggy

This comment has been minimized.

jaggy commented Feb 2, 2017

Hey @rrelmy, thanks for the archive. Narrowed down the issue some of the people here are having. 馃憤

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment