I love Forem. And I'm not just saying that because this is my first post in this great community. It's such a well thought tool for the mind and th...
For further actions, you may consider blocking this person and/or reporting abuse
Oooh, I think @ce7in was looking at doing something similar to this with French, maybe?
Also, @varhal has a Ukrainian Forem that is self-hosted and might have some advice!
Thanks, @ellativity.
Hi and welcome, @leog.
Yes, the thing that you want to do is possible.
For example, I have forked Forem to make some changes for a demo Q&A community (studyhab.com/), and have been using it for about 6 months. There are some challenges, but it is possible.
Now, I have been trying to add multi-language support to Forem like WPML or Polylang for WordPress. In this way, you will be able to add different posts, comments, pages, etc. for different languages.
The URL structure will be like that:
If you set your main language as es, then your URL structure will be like that:
However, this will take some time. If you need a quick solution, you can add Spanish language support to your fork directly and can use it as your Forem image.
I have an important presentation to prepare, so I don't have enough time to explain it for now.
If you need some advice on how to do that, I can help you in 2 days.
I'm struggling with implementing more compact locale path on Forem.
In my experience whenever you'd leave the locale slot optional (like example.com/ => :en but example.com/fr/ => :fr), the software would misunderstand the second parameter as username. I'm looking for Rails config to work around this behavior but none have I found.
Any suggestions are welcome.
The url parameters are defined in routes.rb. So, you need to modify the routes to determine which parameter will refer to which value depending on your architecture. This might be confusing if you don't have such experience.
You can follow the guide to learn the basic principles of Rails' routing mechanism: guides.rubyonrails.org/routing.html
However, just modifying routes is not enough for all functions of Forem. You also need to follow the controllers and JavaScript functionalities to ensure everything works. You can write some tests to automatize this process.
Adding this kind of feature to Forem is a tricky task. So, we need to be careful and patient.
I have started to prepare a tutorial collection for dealing with custom forks of Forem, @leog. It'll also include adding new language supports. I want to inform you.
Yes, I'm exactly stuck at routes.rb. When the locale parameter is optional, the app seems sometimes to take what comes first as username or something that go to look up a nonexistent user like "fr". It prevents me from having a slick second level locale such as
example.com/fr/...
.Otherwise I have a virtually complete i18n setup covering both Rails and JS code. I cut corners on the JS part so it breaks a several tests but works great in production.
So a single-language instance can be easily deployed, but there is still a big obstacle to full m17n, which is injecting the locale parameter to every hardcoded link in tons of ERBs, otherwise they jump back to the default locale. (Sadly
default_url_options
only covers a tiny portion of their codebase...)Thank you @ce7in, much appreciated!
Ok, I got it. I'll examine and modify the routes of your Forem fork, and try to determine if it works. Then, I'll send a pull request to your fork.
Oh thank you for your kind help! My routes.rb currently has a sort of second level locale but not functional.
Also, feel free to ask me when I can be of any help.
Thank you very much @ellativity for bringing this to @ce7in’s attention. And thanks @ce7in for your help offer, it would be great, no rush at all.
I will most certainly go for just supporting Spanish without any other language, so hopefully that should simplify things a bit. I would need help with the changes to be done to be able to grab a fork as the source of the self host setup process, I’m guessing it involves publishing a container image with my changes to Docker Hub for example, to switch the forem container path to it.
Good luck on your presentation!
In that case, it will be easy for you.
Hey @ce7in! Any update on the tutorial you were preparing?
Thanks so much for responding so soon, @ce7in, and for being so helpful!
Good luck with your presentation!
Hi all! It's good to hear that forem is becoming more and more international. Looking forward to full multilingual support one day!
We are currently updating the translation for ux.pub by changing the locale files and the new updates do not work. After overwriting the yml files, the site looks completely broken, as if all the translation files are missing. Could you please advise:
Thank you!
I'm going to build a Forem for only one local language. I want to make sure is work?
Is it right?
Thank you for building Forem.
intreasting post