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

Menu - Cannot change URL's in sub item per language #120

Closed
herrvigg opened this issue Jun 21, 2018 · 30 comments
Closed

Menu - Cannot change URL's in sub item per language #120

herrvigg opened this issue Jun 21, 2018 · 30 comments
Labels
enhancement New feature or request legacy issue Legacy issue imported from original repo need info The submitter must provide more info

Comments

@herrvigg
Copy link
Collaborator

herrvigg commented Jun 21, 2018

Issue by mediafish
Tuesday Apr 07, 2015 at 08:17 GMT
Originally opened as qTranslate-Team/qtranslate-x#120


Hi,

In Appearance > Menus I have one menu.

Now I created sub Custom sub item with URL's but I cannot change the URL's per language - when changing one URL it applies to all languages which is not what I would expect.

I created various ID's on my page - in this case on the page web-design for example: Hosting

In the English version the URL to it would be
en/web-design/#hosting
In the Spanish version the URL to it would be
/diseno-web/#hosting
In the German Version the URL to it would be
de/webdesign/#hosting

But it does not let me create different URL's and save them in the Menu Structure > Custom sub item.
Now I can create different Navigation Labels and Title Attributes for each language and it saves them but it does not save the different URL's... which is very strange.

I deactivated all plugins except qtranslate-x and activated the theme 2014 having this same result.

@herrvigg herrvigg added the legacy issue Legacy issue imported from original repo label Jun 21, 2018
@herrvigg herrvigg added legacy PR Legacy PR imported from original repo and removed legacy issue Legacy issue imported from original repo labels Jun 22, 2018
@herrvigg herrvigg changed the title Arabic language updates Menu - Cannot change URL's in sub item per language Jun 23, 2018
@herrvigg herrvigg added enhancement New feature or request legacy issue Legacy issue imported from original repo need info The submitter must provide more info and removed legacy PR Legacy PR imported from original repo labels Jun 23, 2018
@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Tuesday Apr 07, 2015 at 17:04 GMT


Hi, please, read FAQ https://wordpress.org/plugins/qtranslate-x/faq/, topic "How can I prevent URL of a custom menu item from being converted".

Please, take the latest version from github, like https://github.com/qTranslate-Team/qtranslate-x/archive/3.2.9.8.3.zip, as 'setlang=no' feature was broken in some of earlier versions.

Also, for Spanish you need 'es/diseno-web/#hosting', otherwise it will not switch language: https://qtranslatexteam.wordpress.com/2015/02/26/browser-redirection-based-on-language/.

I am closing it now, to save clicks, we can continue discussion under closed issue, or can re-open it, if needed.

@herrvigg
Copy link
Collaborator Author

Comment by mediafish
Wednesday Apr 08, 2015 at 08:40 GMT


Hi again,

I have the latest version installed.

I go to: Appearance / Menus / English Tab
In the Custom sub item URL I add: en/web-design/#hosting
I hit Save Menu
I go to Spanish Tab
In the Custom sub item URL I add: es/diseno-web/#hosting
I hit Save Menu
Now I hit the English Tab again to see the URL and it changed the URL to: es/diseno-web/#hosting

Conclusion: I cannot add different URL's per langauge in the menu sub item - but I must be able to do this as those are the basics of a multilingual site or not?

So I do not know why you are closing this thread as for me it is a bug. Please explain. And re-open this thread as I think it is not working as it should.

we should be able to add different URL's per language in custom sub items - but it is not possible

You can check on my dev site if you like...

Thanks

@herrvigg
Copy link
Collaborator Author

Comment by Grafcom
Wednesday Apr 08, 2015 at 09:40 GMT


explained one and another here:
https://wordpress.org/support/topic/cannot-change-permalinks-1?replies=12

@herrvigg
Copy link
Collaborator Author

Comment by mediafish
Wednesday Apr 08, 2015 at 10:37 GMT


It is explained that it is not working right now ;-)

@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Wednesday Apr 08, 2015 at 16:25 GMT


Ok, indeed, it seems I misread the issue.

But it does not let me create different URL

This is right, the URL field is not multilingual, and it is not needed to be. Put basic bare URL there and conversion to active language happens automatically when menu is rendered on front-end. Is that what you need? The FAQ I cited, explains how to cancel this behaviour if needed.

@herrvigg
Copy link
Collaborator Author

Comment by mediafish
Wednesday Apr 08, 2015 at 17:17 GMT


Hi,

Thanks yes it does create URL's but not translated ones.

I believe the whole problem already starts when creating pages.

I create a page and call it:

English: Photography
German: Fotografie
Spanisch: Fotografía

Now the SEF URL's for those pages should be:

English: mysite.com/en/photography
German: mysite.com/de/fotografie
Spanish: mysite.com/es/fotografía

But this is not the case! It creates the URL's

English: mysite.com/en/photography
German: mysite.com/de/photography
Spanish: mysite.com/es/photography

So as you see it creates SEF pages but NOT translated ones and "photography" is not translated.

When creating one page - I cannot change the permalinks of those pages as per language - I can only change them for all languages.

Example: When I change the permalink on the Spanish Tab of "Photography" to "fotografia" in the permalink and save it - it saves it for all Languages instead of only for one language in this case Spanish - as I selected the Spanish Tab.

I can translate those URLs to their correspondent language using "qTranslate slug" Plugin and then yes I can add the slugs to each language and my URL's look as they should:

English: mysite.com/en/photography
German: mysite.com/de/fotografie
Spanish: mysite.com/es/fotografía

HOWEVER this does not work for Custom sub Item URL's:

When I do the translations with "qTranslate slug" it does not create the slugs if you add a Custom sub item Link to "Photography"

It then again creates the non translated URL's such as (It takes you to the correct place in the frontend but with a URL that is NOT Translated.)

English: mysite.com/en/photography/#sub-item
German: mysite.com/de/photography/#sub-item
Spanish: mysite.com/es/photography/#sub-item

instead of expected:

English: mysite.com/en/photography/#sub-item-english
German: mysite.com/de/fotografie/#sub-item-deutsch
Spanish: mysite.com/es/fotografía/#sub-item-espanol

I believe that if you made the native wordpress permalinks inside the Pages translatable and work with qTranslate-X it would already solve the whole problem - but that is just a guess...

and if you could solve the problem from that point the third party plugin "qTranslate slug" would not be needed and nobody would depend on their dev's...

I hope you understand the problem now. As I believe anybody who wants his URL's SEF in a multilingual environment wants them to be translated in the according language.

@herrvigg
Copy link
Collaborator Author

Comment by Grafcom
Wednesday Apr 08, 2015 at 17:31 GMT


Again, qTranslate Slug causes problems.

A workaround with SEF urls is possible. you say "But this is not the case! It creates the URL's"
Yes, therefore, you must create them manually. See my example with hosting. Create manual links in your menu!
Full URLs:
English: http://www.mysite.com/en/photography
German: http://www.mysite.com/de/fotografie
Spanish: http://www.mysite.com/es/fotografía
And these are still SEF urls.
And let the Navigation Labels empty on the languages you do not want to see the link.

@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Wednesday Apr 08, 2015 at 18:17 GMT


@mediafish: this should be addressed to QTranslate Slug plugin, not here. We used to be in touch with them, but they went silent: not-only-code/qtranslate-slug#108. Unless they start acting again, we plan to re-implement -slug functionality under q-X natively, and then this problem will be gone. Until then, I suggest not to use QTranslate Slug, since the problem you address here is not the only one, you will discover more as you go deeper.

BTW, if we do this, it will be done in this way:

English: http://www.mysite.com/photography
German: http://www.mysite.com/fotografie
Spanish: http://www.mysite.com/fotografía

since slug defines the language, unless it is spelled the same, then /xx/ language code will be added.

@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Wednesday Apr 08, 2015 at 18:32 GMT


BTW, @mediafish and @Grafcom, what would you think is better, to add /xx/ for slugs spelled the same, or to require from user to always spell them differently?

@herrvigg
Copy link
Collaborator Author

Comment by mediafish
Wednesday Apr 08, 2015 at 18:44 GMT


Hi,

Thanks but I do not want to talk to qTranslate Slug... as I think qTranslate-X should offer SEF URL's in their own Plugin - as the Plugin is Good and should really offer this - I think it is basic to have URL's translated to their according language....

The URL's must be:

English (If main language of the site no /en/ is shown at least on my site and this is good...): http://www.mysite.com/photography
German: http://www.mysite.com/de/fotografie
Spanish: http://www.mysite.com/es/fotografía

AGAIN: I think if you fixed that we can translate Permalinks inside pages for each language - the problem would be solved...

The user should be able to add those in the according language

@johnclause what do you mean by: "slugs spelled the same" ?

@herrvigg
Copy link
Collaborator Author

Comment by Grafcom
Wednesday Apr 08, 2015 at 18:56 GMT


@johnclause

  • what would you think is better, to add /xx/ for slugs spelled the same, or to require from user to always spell them differently? -

/xx/ should just be the language identifier, as is now also, I think

@herrvigg
Copy link
Collaborator Author

Comment by mediafish
Wednesday Apr 08, 2015 at 19:30 GMT


@johnclause

yes language identifier should stay as now... if that is the question

@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Wednesday Apr 08, 2015 at 20:10 GMT


AGAIN: I think if you fixed that we can translate Permalinks inside pages for each language - the problem would be solved...

I do not get what you are saying here ... Slugs currently come from QTranslate Slug plugin, and that plugin has to be modified to make it work correctly with q-X. If we re-implement it, we will have to also provide an import function to import the slug data from Q-Slug to q-X.

what do you mean by: "slugs spelled the same" ?

In most of the cases slug will be different for each language, and then language code /xx/ becomes redundant in the url, as many people noticed. Then it makes sense to drop language code like '/xx/' from url, since slug already defines the language - it will look nicer then. I think there is no disagreement on that, everybody to whom I mentioned it, agreed, do you think so?

However, when in rare case two languages would have the same spelling (for example, british and american can have that easily), then we have to decide, whether we force users to make slugs different anyway or to put back /xx/ language code in url.

I personally is not strongly decided, but I am inclined to the forcing users to use different urls, since this gives them opportunity to do something more creative than robotic /xx/. They can still do 'slug-en' or something like this, which resembles the robotic way too, if nothing else is better.

What do you think?

@herrvigg
Copy link
Collaborator Author

Comment by Grafcom
Wednesday Apr 08, 2015 at 20:54 GMT


@johnclause

  • In most of the cases slug will be different for each language, and then language code /xx/ becomes redundant in the url, as many people noticed.
  • I think there is no disagreement on that, everybody to whom I mentioned it, agreed, do you think so?

No, I disagree.

For example: mediafish uses mysite.com/de/fotografie (German)
in Dutch it would it be mysite.com/nl/fotografie

photography (fotografie) is the same in both languages.
In the Netherlands we use Home for the Home page also as in English. German is Startseite (I love that language)

More and more English words are as a name and then this goes wrong.

Art Journals for example is an understanding (concept)

That's what Marit :-) and I think.

@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Wednesday Apr 08, 2015 at 23:19 GMT


I do not see how what you are saying contradicts to the fact that URL like

http://www.mysite.com/fotografía

looks better than

http://www.mysite.com/es/fotografía

while they both define the language? What is it exactly you disagree with? I think there is a misunderstanding here. Besides, I remember you, @Grafcom, about a month ago, asking why do we need extra /es/ in a case like this ;)

In any case, I guess we will have options for users to define how they want it.

@herrvigg
Copy link
Collaborator Author

Comment by mediafish
Thursday Apr 09, 2015 at 07:41 GMT


Good morning,

Here my experience and known standards for multilingual sites I have worked with over the last 10 years:

1.) We must keep the language codes - there is no doubt about that.

a) Now for the main language it does not show the language code on my site now - which is fine and I will show you why.

(However Joomla for example offers the option to chose if you want to show the main language with language code or without)

This is due to the fact that we have country specific domains for example mine ends in mysite.es and my language structure looks like this:

Spanish: mysite.es/fotografia
English: mysite.es/en/photography
German: mysite.es/de/fotografie

So as you see there is no need to add a language code to the Spanish version due to its domain ending. .es it makes it perfectly clear to users that the language will be Spanish

Now if you had a site such as: mysite.com and you wanted your main language in Spanish - it would be nice to have the option to add the language code to your site - however this is optional but the URL would be more SEF

Spanish: mysite.com/es/fotografia
English: mysite.com/en/photography
German: mysite.com/de/fotografie

2.) @johnclause "AGAIN: I think if you fixed that we can translate Permalinks inside pages for each language - the problem would be solved..."

I am talking about the WP integrated Permalinks inside Pages - I am not talking about qTranslateSlug

Goto: Pages / Yourpage - that is how it looks like:

Language Tabs on Top

Yourpage Title
Permalink: http://mysite.com/yourpage Edit - View Page - Get Shortlink

When you click the edit button you can change the link - this is WP integrated! But unfortunately this is not integrated in qTranslate-X

You should make those Permalinks Translatable and then nobody would rely on a third party Plugin like qTranslateSlug.

  1. The same should work for Categories -> Post / Categories / Add new Category

We can translate the name of the Category but not the Slug of each language - this must be translatable as well on a well working multilingual Plugin...

So those are the main problems I see - there are certain standards - and please do not take the language codes out - EVER. Leave it as an option for the users if they want to show language code in their main language or not - but do not take them out as this would be re-inventing the whole wheel and we do not need that...

  1. @Grafcom - go to Youtube and search: How German Sounds Compared To Other Languages - ROFL!!!

Thanks

@herrvigg
Copy link
Collaborator Author

Comment by Grafcom
Thursday Apr 09, 2015 at 07:57 GMT


@mediafish,

  • (However Joomla for example offers the option to chose if you want to show the main language with language code or without)

qTranslate also, see Settings - Languages - Advanced Settings - URL Modification Mode - Hide URL language information for default language. You can choose.

@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Thursday Apr 09, 2015 at 17:14 GMT


@mediafish thanks for the input - very valuable 👍

Item 1) was already addressed by @Grafcom, indeed we have that option too.

  1. You should make those Permalinks Translatable

Ok, now I understand what you meant. This is exactly what we are going to do if we re-implement -slug under -x. There is also "Slug" item, when you pull "Screen Options" down, and that one will also respond to Language Switching Buttons. However, it requires a lot of coding due to specific of slug being a part of url, it is not similar to any other translatable field. Look how much code QTranslate Slug has, this is what we would have to add approximately. Having Q-Slug plugin as an example makes it much easier, but still, it is a lot of work. I am not even sure, we may implement it as a separate plugin too.

@herrvigg
Copy link
Collaborator Author

Comment by mediafish
Friday Apr 10, 2015 at 07:23 GMT


@Grafcom - thanks ok - I was not sure if it did or if it was by default only know the Plugin for 2 weeks.

@johnclause - good :-) I understand this is a free plugin and requires a lot of coding... however I think qTranslate Slug is not using the native Permalinks of WP it is using their own system as Permalinks are hidden when using qTranslateSlug and their own custom fields for slugs appear - so there might be an easyer way.

I just hoped your Plugin could do this already... as I am really fed up with the blown up WPML - so I really think you could be successful even charging for it - if it works of course - let's hope you will implement it one day - or WP adds multilingual use to it's core...

@herrvigg
Copy link
Collaborator Author

Comment by LC43
Sunday Apr 12, 2015 at 17:54 GMT


hi, sorry for being silent :)

yes, qts is big.. a big mess! :D but its working, and i've just updated qts language widget to play nice with qtx!

@herrvigg
Copy link
Collaborator Author

Comment by mediafish
Monday Apr 20, 2015 at 11:23 GMT


@LC43

Just updated the version to qTranslateX Version 3.2.9.9.3 and qTranslate Slug Version 1.1.16 and I can still not translate custom URL's in the menu (sub-items) per language - so - no need to talk ;-)

If you want you can test it on my site... no way it is working.

I want the English URL for my sub-item to be: en/webdesign/#maintenance
I want the Spanish URL for my sub-item to be: es/diseño-web/#maintenance

It simply does not save the URL per language but saves 1 URL for all

Also I get the Warning Message: Qtranslate Slug:
This plugin requires at least WordPress 3.3 and either qTranslate-X (2.9 or newer), or mqTranslate (2.6.2.4 or newer), or qTranslate (2.5.8 or newer)

But my WP Version is 4.1.1 - qTranslateX Version 3.2.9.9.3 so why the warning?

@herrvigg
Copy link
Collaborator Author

Comment by mediafish
Monday Apr 20, 2015 at 14:28 GMT


Got rid of warning message as I had to access the site with FTP the folder name must be qtranslate-x but it was qtranslate-x-master so I changed it but only got rid of warning message -

I can still not translate sub item URL's to according language - it translates always all URL's to the same..

@herrvigg
Copy link
Collaborator Author

Comment by koen84
Monday Apr 20, 2015 at 15:34 GMT


I hope to have language dependant slugs soon, this is quite important for SEO. Now it looks like it's possible, but it's not, because it -as stated by others- simply changes things for all languages.

That said, i also agree that it should keep the language indentifiers in the URLs, because it's much more clear to the user (especially if not all content is translated) and better for SEO (definitely not force unique slugs across languages).

/de/fotografie
/nl/fotografie

should both be able to exist.

And then things like

/en/photography

@herrvigg
Copy link
Collaborator Author

Comment by koen84
Monday Apr 20, 2015 at 15:47 GMT


@LC43 : this convo seems to be both about the menu links AND permalinks per language, no ?

@herrvigg
Copy link
Collaborator Author

Comment by LC43
Monday Apr 20, 2015 at 15:48 GMT


@mediafish , you're right, custom links aren't parsed by qts. let me see if i can fix it next releasee.

@koen84, if you're not using not-only-code/qtranslate-slug yet, you should ;)

@herrvigg
Copy link
Collaborator Author

Comment by koen84
Monday Apr 20, 2015 at 15:49 GMT


Besides the URL / slug for pages and posts, it would be good if we could apply it also to categories.

@herrvigg
Copy link
Collaborator Author

Comment by LC43
Monday Apr 20, 2015 at 15:50 GMT


you can

@herrvigg
Copy link
Collaborator Author

Comment by koen84
Monday Apr 20, 2015 at 15:50 GMT


@LC43 : how should i make sure it uses this not-only-code/qtranslate-slug ? Also, i read to NOT use qtranslate slug ?

@herrvigg
Copy link
Collaborator Author

Comment by LC43
Monday Apr 20, 2015 at 15:54 GMT


@koen84 , qtx was running too fast away from the original qtranslate, so things broke a lot. We were always compatible with qtranslate and mqtranslate. I've updated qts to be compatible again with qtx now that mqtranslate stop being actively developed.

you can use it from the main wordpress site: wordpress.org/plugins/qtranslate-slug

@herrvigg
Copy link
Collaborator Author

Comment by mediafish
Monday Apr 20, 2015 at 16:50 GMT


@LC43 and @koen84 - I started this topic and its about translating sub item URL's.
I tested it today various times and it is not possible... so your message is not correct as you say yourself: "you're right, custom links aren't parsed by qts. let me see if i can fix it next releasee."

@koen84 - with the latest qTranslate Slug https://wordpress.org/plugins/qtranslate-slug/ together with the latest qTranslate-X Beta Version https://github.com/qTranslate-Team/qtranslate-x/archive/master.zip you can translate category names - just make sure after installation of qTranslate-X to access the site with FTP the folder name must be qtranslate-x but it is probably qtranslate-x-master... if that is done it translates categories - but NOT menu sub item URL's...

So thanks for posting but it does not concern this topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request legacy issue Legacy issue imported from original repo need info The submitter must provide more info
Projects
None yet
Development

No branches or pull requests

1 participant