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

Multilingual page pickers #22

Open
gmclelland opened this issue Nov 2, 2016 · 4 comments
Open

Multilingual page pickers #22

gmclelland opened this issue Nov 2, 2016 · 4 comments

Comments

@gmclelland
Copy link
Contributor

Just had an idea. I'm not sure it is possible, but how about adding a client-side language picker to each place these pickers are shown?

Maybe a dropdown select field for choosing the EN, ES, DE just like you did in the AdminOnSteriods configuration options?
untitled 2016-11-02 15-42-44

Selecting a different language would only show/select pages in that specific language. The autocomplete page input, page tree picker, select child page picker, and select file picker would only show/select pages in that language.

I was thinking that after choosing a different language it would perform an ajax request to replace the field's contents.

This would allow a user to pick or browse pages in a language that is different from the user's language.

example:fieldtype-assisted-url
untitled 2016-11-02 15-56-10

Here are some other examples where these pickers appear.

example: ckeditor-page-linker
image

example: parent page selector
image

example: AdminOnSteriods NavItems page picker
image

@rolandtoth
Copy link
Owner

rolandtoth commented Nov 2, 2016

Well I found a workaround that could work, setting the "lang" GET parameter with a hook:

$this->addHookBefore('ProcessPageList::execute', function(HookEvent $event) {
            $this->input->get['lang'] = 1020;
        });

Of course 1020 needs to be dynamic, which could be achieved by the picker (select), eg. placing a cookie. Plus the "Select page" field would need to be reloaded as well.

This change would also make the labels to be translated to the target language ("Choose"), and of course the page titles that appear. The latter would make it hard for English editors to pick the right page if they see the page titles in Chinese or Russian, for example.

Perhaps it were more handy (and safe) to leave the user language as is, and use these buttons (EN, DE, ES, etc) to "convert" paths to the corresponding language paths? Eg. "/contact-us" to "/de/kontakt-uns"? This could be more easily achieved using a small ajax call I guess.

@rolandtoth
Copy link
Owner

From UI point of view it would be better to add the DE, ES, etc buttons on each row next to Choose. I'm not sure if this could achieved easily, perhaps this should be in the core instead.

@gmclelland
Copy link
Contributor Author

I'm really not sure what the best interface would be? I like your ideas as well. I wonder how we can get more user interface ideas from the community? Maybe mention this on the AdminOnSteriods forum post?

I tried looking at how other CMS implement something like this, but I couldn't find any good implementations.

I really just wanted to do a brain dump and get these ideas out of my head. I didn't want to get busy and just forget about them.

I also wanted to give you another possible feature to add for v100!

Maybe @ryancramerdesign could look at these ideas as well?

@rolandtoth
Copy link
Owner

I think the best would be to create a forum topic about this, and adding a feature request for PW GitHub to make Ryan know about it.

The main issue is to determine what the user would need - would he need to see page titles in his language (set in his Profile), or localized titles. I would say that the former sounds more logical but maybe others have different views.

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

2 participants