-
Notifications
You must be signed in to change notification settings - Fork 671
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
support multi-lingual #6546
Comments
The name of |
Looks like all the |
In the preview, it appears that this doesn't exist: https://deploy-preview-1494--devopsdays-web.netlify.com/events/2017-sao-paulo/welcome/ I noticed this because I have /welcome/ hardcoded into the partials for future/past/etc. (it worked locally with an alias, and worked post-merge. I seem to recall something about this being expected, but just in case it wasn't...) |
Changing filenames isn't exactly how the hugo multi-lingual works. They have the same logical filename; they just append the language. That is to say, we can change the content, but changing filenames of some pretty essential navigation elements ( |
The welcome page thing works for sao-paulo because on their
Something like that is going to break hardcore in the new theme, because I do some checking to see if you're on the One way around that, if we have to, is to have an optional override in the Relevant code is at https://github.com/devopsdays/devopsdays-theme/blob/0.2.6/layouts/event/single.html#L41-L43 Another option is to make the "welcome" page a different type from That actually will possibly help with backwards compatibility for the events that pre-date the new theme, so I am kinda into it. |
Maybe too late for contribute. :) I think could be more easy to maintain if you can keep name files and just add a suffix in the filename. Debian Documentation, for example, they just put ".pt" in the filename and keep links and references in english. https://www.debian.org/releases/stable/amd64/apbs01.html.**en**#preseed-methods |
@fike not too late! This is going to not be solved quickly :) That said, what you described is basically the end result of Hugo's multi-lingual feature, which totally accounts for translated CONTENT, but it won't handle the lower level code type objects like "welcome" and "location" as terms in the data files :) But I think the translated content is where we should start. |
If folks don't want to click through, here's the gist:
|
OK, so the way this ends up working isn't "automagic", in terms of, it won't figure out the users language and automatically translate stuff. It basically creates a new "site" structure, say devopsdays.org/es for spanish, devopsdays.org/fr for the french content, etc. So what I was thinking, is that we could add little flags to the top nav for all the languages we support, and then when you click on them, you're in the site of that language, so to speak. |
Instead of adding little flags to the top nav for all the languages we support, this site http://bittersmann.de/articles/no-flags/ gives some good examples of handling multilingual site. We could try using the simples IMO that Gunnar mentions, which is Language Negotiation. |
I suggest leaving off bikeshedding on the details of the implementation until we take this one on, which is likely months from now. Given the major impact of this type of effort to the rest of the site and my intent to not make major changes when events are happening, this is probably around 2017Q4. |
This issue is already tracked in prodpad so the GH issue artifact won't be needed until we are ready to work on this large project. |
Re-opening |
I'm concerned we are going to get bit by this bug: gohugoio/hugo#2699 The issue seems to be that when there are files with identical names, they start to mess with each other's translations. Since we duplicate file names A LOT, this is probably going to be a problem. This seems to be on an upcoming milestone for Hugo though, so I'm not too worried about it. |
Actually, it doesn't seem to be a problem (the aforementioned bug), at least not so far. I started a bit of a POC on the global nav, at least...this might not be too terrible. The biggest issue is that the manner in which we generate the event-level nav (driven by content in the yaml file) might have to be re-visited. |
There have been a few releases of Hugo since this thread was opened, specifically around adding even more multilingual features. I highly suggest we don’t create our own implementation but use the features the framework provides. |
We can wait. :) |
I'm not even sure if this is even possible or not, or would add too much complexity. But I've seen some sites that have implemented this feature and at first glance from a usability stand point seems painless. But not sure with the theme we have is even a viable solution. Just throwing it out there for discussion. |
Bringing this one back up as I have a minor spike i've been hacking on this morning; multi-language support in Hugo is a LOT easier these days, and I think we can enable the framework for this with relative ease. It'll be the responsibility of each event to make the different language versions for their pages as they want to, but what we can do is make sure that:
|
How may I help on this? :) |
@somatorio I'll have a working branch up shortly with some of the efforts I'm doing! Definitely will need help with some translations. |
okay so this is fun...there's some stuff in our code that is going to make this harder than you would think. So, to give context, the way multi-lingual works, it ends up rewriting the path/url of the page. So let's say that there's a french version of the code of conduct for 2023- Chicago, instead of Why is this an issue? because the way that the "look up info about an event" code works, the way it figures out which city/year is being referred, is from the url, ie:
So with translated content, the value of going to have to think this one through |
doesn't look like the url structure in multi-lang hugo is configureable, so we will need to come up with a larger solution Really, the fix has to be that we somehow don't use the URL in that way to detect the slug. I'm wondering if we can do something like "take the key that comes after you find "events" but that's...sloppy
|
okay good news. that wasn't terribly hard to do. It's a little sloppy but it's working. I now check for the event slug this way:
I also had to fix something elsewhere that uses the url to figure out if it should show the event navbar etc! |
Take a look at #13724 to see the WIP Check it out in real time on this page https://deploy-preview-13724--devopsdays-web.netlify.app/events/2023-chicago/conduct note! the only thing that actually works is on that particular page, notice it shows the translated options toward the top (it only displays that on pages that have translations) note that the "languages" menu in the main navbar doesn't actually work, don't get excited :)
|
We have events that are already written in non-English languages. It would be super rad to be able to allow organizers, sponsors, etc in those countries to toggle some selected pages like https://www.devopsdays.org/sponsor/ and https://www.devopsdays.org/organizing/ into other languages if available.
See http://gohugo.io/content/multilingual/ for details.
The text was updated successfully, but these errors were encountered: