-
-
Notifications
You must be signed in to change notification settings - Fork 137
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
Wagtailmenu Internationalisation #74
Comments
Hi @begonaalvarezd. Thanks for the kind words. I'm glad you're finding it useful. Do you have a separate site set up for each language, or are you introducing the different languages in a more integrated way? If you were creating an actual 'Site' for each language, I guess the simplest answer would be to create a separate menu for each site, and they should be picked up automatically. The In order to access those translated strings on pages, you'll need to use the With that in place, it should be possible to swap out I think you'll still be stuck for |
Woooow! That solved the issue! I am serving both translations under the same site so the doubled menu was not an option for me, but your answer is! I have been using your package for couple of days and didnt step into By now I dont plan to have Thank you very very much for replying so fast! Great support 👍 |
Ah, cool. Glad you managed to work it out :) The Just a heads up: There are some changes planned for |
Hello again @ababic I have a simple new question. I am facing a new issue with you solution for "key page links becoming just 'toggles' in multi-level drop-downs" for multi-language sites. The field Thank you very much for your time :) |
Hey @begonaalvarezd. I think you should be able to solve this without resorting to overriding metaclasses :) The repeated menu items are actually added by the |
If you think about how wagtail provides the I think using an abstract |
Great! This worked beautifully :) I am very very new to both python and Django and I still over-complicate my solutions hehe. Thank you so much again for your great support. Solved and closed issue! |
No worries. Multilingual wagtail sites are very common, so my hope is that this conversation will be useful to others trying to solve the same problem. I should probably think about putting a page in the documentation about it, too (when I get around to creating documentation!) |
Hi, I have been strugling with switching languages and multilingual menus for the websites I have been working on, for the last two years. I appreciate greatly wagtailmenus. I've got wagtailmodeltranslation working, so I have extra fields for the fields I want to translate (ex. title_en, title_fr, url_path_en, url_path_fr, etc,) and it is working well for me, but when it comes to figuring out how create multilingual menus, it is beyond me. I like your idea of having some guidelines in the docs on how to create multilingual menus, it would be greatly appreciated. In the meantime, I will get better acquainted with wagtailmenus and try to understand the previous posts on the subject. Thank you, Alain |
Hey @agelinas! The first step is to ensure the And, if you're using
For EDIT: You might also want to look at the |
Hi @ababic, So I decided to use the recommended content internalisation in the Wagtail documentation :
.....
` I was thinking that if I simply added (duplicated) the fields that need translations for each language : ex. link, link_fr, link_en, and copy the content of the active language into the original field (link in this example) at runtime, would this work ? I think that is how django-modeltranslation works. If so and if you have the time, could you please provide a few guidelines or hints on how to go about it. Thank you, I much appreciate what you're doing. |
Hi @agelinas, If you were looking at taking this approach for menus, then you may find this example in the docs useful: If most of your menu items are links to pages, and you're wanting to derive menu item text from a similar field on your page models, there's a setting you can use to achieve that: EDIT: Removed note on 'using specific pages for menu generation', as wagtailmenus has since been updated to always use specific pages. Hope this helps! :) |
Thanks @ababic I did find examples in your docs for managing multiple languages by duplicating fields and what is involved (The link you sent me: I should have checked your documentation for updates since I last read it, sorry!) The documentation is very helpful and I already have managed to do the flatmenu adaptations and will soon work on main menu as per your guidelines. Thank you, much appreciated! |
Hi everyone! @ababic's links don't work anymore and I was still searching for references on how to internationalize my main menu. I'm currently using From this discussion, I now get I should be creating a custom menu item, but without the documentation references, it's all still very hazy to me. |
Hi @MrCordeiro. Only the last link there is broken. That's because |
Ah, I see! So maybe I'm searching for references in the wrong place. Just saw @perepicornell's commend on issue #242... would that be the way to go? |
@MrCordeiro That all depends on how you're doing internationalisation in your project really. The solution on #242 might be the way to go if you're using https://github.com/wagtail/wagtail-localize (with language-specific trees being automatically synced). That's certainly easiest from an editor perspective, as you define the menu once, and that automatically works for all locales. |
@ababic it worked great! I'm not yet familiarized with all translation options for Wagtail, but that looked like a good solution. Is there a reason (other than the lack of time, of course) why we can't integrate that into the package? In case there's an impediment, that snippet could perhaps be added as a recipe on the docs instead - which would be something I feel I could tackle with a PR. What do you think? (I could also make the Django 4.0 adaptations while at it too) |
@MrCordeiro I must admit, I've let this app fall off my radar, as it's not something I use any longer (plus, I haven't worked at rkhleics for years). So, any help would be appreciated. |
Fair enough. I didn't even know rkhleics was a company... If they forgot about it, maybe this package should be maintained by jazzband then. I'll open an issue so I can refer to it and start working on the PR. |
Hi there, I use Wagtail-Localize and Wagtailmenus together. I found a solution to make the menu localized but it's so easy that I'm pretty sure I have forgotten something 😅. I have created a Main Menu and the following template:
Using link_page.localized, the url and title that are displayed depend on the location code. I only create one menu and let the translation happen in the template. I don't beleive this workarround to be so easy. Where did I miss something? 😂 |
Hello! First of all thank you for this package :)
I am adapting my website to be multi-language flowing the oficial Internationalisation tutorial from Wagtail using
TranslatedField
class because, sadly, I cannot use wagtail-modeltranslation since it not compatible with Django 1.10. I am trying to include, therefore, also an international menu based on the selected language. I have seen that to render the menu titles you do:Is there a possibility to define a simple internationalized title? I have tried and tried but I really dont manage to get it working.
Any help would be appreciated, thanks!
The text was updated successfully, but these errors were encountered: