-
Notifications
You must be signed in to change notification settings - Fork 447
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
Ensure that all languages are indexable by crawlers #699
Comments
I've switched to a link in my ui branch of OMP. I'll update it for OJS too, but as you discussed in email, we still need to propogate via URL. |
OJS uses links for the language switcher (can't remember when this was implemented). But I think the issue of propagating the language within the URL is more in your wheel house. Assigning back to you unless you'd like me to look further. |
Sure, I'll take a look. |
Hmm. I don't like constructs that only show up for search engines, e.g. via user agents. So we're left with adding the language to system URLs in the general case, which I'm hesitant to impose on single-language journals; adding this as an optional mode could provide flexibility for both types of users, but switching between them might be catastrophic as all URLs would change. We could potentially have the URL generation code add a URL parameter for language, which would allow interoperability between the two modes -- but this would need to behave well with e.g. POST forms and Javascript, which might not be expecting URL parameters to suddenly get included. Deferring pending more consideration. |
Greetings @asmecher I have already got some experience in PHP and Java EE, so hope if you guide me I could manage this problem. From where to start? |
Hi @Vitaliy-1 -- the code for this is pretty much constrained to |
Thanks for reply @asmecher , Hmm, Can you show me an example of URL mapping? I know that So, I am thinking about something like:
Maybe just create new page with this url pattern and redirect like this to it. But in Java it is possible to map one servlet to several url patterns. I am confused. |
Hi again, @asmecher It's not easy without much experience in programming to read and understand others` code. But I know that you haven't got much time for helping others to write the code. After browsing classes I found I have created a mockup of a plugin here to manage this hook: https://github.com/Vitaliy-1/localeRedirect/blob/master/LocaleRedirectPlugin.inc.php Can you confirm that I am on the right path? Or you wouldn't use this hook for specified earlier task? |
Another approach, that I found, is to modify
So the question remains what approach is better in your opinion? Or non of them? And will google actually see that page for selected locale? |
@Vitaliy-1, my worry is about ambiguity in URLs. If I'm reading correctly, this would result "equivalent" URLs like...
However, that last one could be read two ways: a galley view with article ID "smecher17", galley ID "pdf", or an article view with locale "smecher17" and article ID "pdf". We can code around it here but there will be lots of knock-on complication, e.g. in parsing URLs for statistics calcuations in the log files. I think it's definitely necessary to...
What about using an optional URL parameter, e.g.: |
Greetings @asmecher While writing the code I have encountered a problem with language toggle. As an example of changing locale:
The lines above are changing actual locale text only on any second request (but session locale is changing immediately). Only way that I found includes:
Is there more clear way? |
Ahh, The problem can be managed by assigning values inside constructor of |
@Vitaliy-1, rather than working via session parameters, I'd suggest adding a facility to the |
Thanks for guidance @asmecher There is another one problem, after applying modifications as per your advice. My AppLocale class: https://github.com/Vitaliy-1/AppLocale/blob/master/AppLocale.inc.php This how I call |
Hi @asmecher I have managed to make a separate URL for non-primary locale. After looking over several options and reading google guidelines about multilanguage sites I pick up a variant with separate subdomain. It has no conflicts with main code, OJS picks requests to subdomains without a need to pointing them in the apache configuration files. Only subdomain registering is needed. Have checked on the production system and it works fine with already started and new user sessions. One problem was to make a switcher on a admin dashboard side, because standard tools for routing current location weren't working in usernav.tpl (as it is not actually a page), but it was managed with But I wasn't able to code an appropriate setter for AppLocale class, so I have done the modification for SubmissionManager class - setting the currentLocale var for user session depending on presence of subdomain in URL. Do you actually need this sort of a plugin for public use? If so, how can I manage a setter for changing languages? |
Hi @jyhein (and maybe @ajnyga), what about sitemap -- does it need to contain all languages? -- s. https://developers.google.com/search/docs/specialty/international/localized-versions. |
My thinking was that the sitemap would guide to the primary language (via the link without the language code) and each page would have further information for search engines in the page header. But of course adding the links to that sitemap would be doable. Just leads to a massive sitemap of course in some cases. |
Yes, lets leave it as it is for now... Also, as @jyhein said, it seems, only one way from 3 listed in that Google page needs to be supported... |
pkp/pkp-lib#699 Show locale in url in multilingual contexts
pkp/pkp-lib#699 Show locale in url in multilingual contexts
pkp/pkp-lib#699 Show locale in url in multilingual contexts
pkp/pkp-lib#699 Show locale in url in multilingual contexts
#699 Show locale in url in multilingual contexts
pkp/pkp-lib#699 Show locale in url in multilingual contexts
pkp/pkp-lib#699 Show locale in url in multilingual contexts
pkp/pkp-lib#699 Show locale in url in multilingual contexts
All merged, thanks a lot! |
@bozana / @jyhein, I'm re-opening this because it breaks my installation (specifically #9628). My local OJS is installed to With the PR applied, the path gets mixed into the The Can you test with the case where OJS is not installed in the server's root directory? |
Describe the problem you would like to solve
Users can switch languages while reading a multilingual journal. However, the currently active language is stored in a cookie on the user's device and not in the URL. As a result, a search engine crawler can not index information in languages other than the journal's primary language.
Describe the solution you'd like
No consensus has been reached on a proposed solution.
Who is asking for this feature?
Multilingual journals that want to be indexed by Google (not Google Scholar).
Additional information
See http://forum.pkp.sfu.ca/t/keep-ui-archivable-by-heritrix-web-crawler/3207/6 for details.
The text was updated successfully, but these errors were encountered: