Jump to content

Recommended Posts

Posted

I've got a website with multiple languages and two of them are Chinese and Russian. Since both use characters nobody of us can read we have some big problems to insert links from the editor. If we want to pick a page we can't see what page to select.

Is there any way to display the page titles in another language? How do you select a page from a language you can't read?

Thanks! 

Posted

By default everything in processwire is displayed in the language of the user. So if you change your user to use any of the readable languages it should be used for page select fields as well.

Posted

Well, not everything :-) I am not talking about UI or ProcessWire phrases.

I am talking about the text editor and on how to insert links/select pages. Those titles depends on the language you are editing and do not change with your user profile settings.

I am wondering if nobody else came across this :-) I have about 70 links per language and no idea how to insert them. I am afraid the only way is to go to a language I can read, change from the front-end the language and copy paste the URL.

Page-Select.png

Posted

Well, that's certainly not great and not the logic I'd expect. I think in this case really the user-language should be used for the page list instead of the field language. You can change the behavior by changing ProcessPageEditLink.module the js config in init() to the following: 

$this->config->js('ProcessPageEditLink', array(
			'selectStartLabel' => $this->startLabel, 
			'langID' => ($user->language ? (int) $user->language : 0), // Change this line
			'pageID' => $id,
			'pageUrl' => $this->page->url,
			'pageName' => $this->page->name, 
			'rootParentUrl' => $this->page->rootParent->url,
			'slashUrls' => $this->page->template->slashUrls,
			'urlType' => $this->urlType,
			'extLinkRel' => $this->extLinkRel, 
			'extLinkTarget' => $this->extLinkTarget, 
			'extLinkClass' => $this->extLinkClass, 
			));
Posted

Thank you. This changes the title – but it also changes the URL. Thus I always will get the link to my default language.

Posted

Now I understand why it was that way. I think you'd need Ryan to implement a "two" languages strategy into ProcessPageList, so it's using labels in the user's language and urls in the fields language. Currently the module just overwrites the users language.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...