I used this add-on in the past:
https://devot-ee.com/add-ons/republic-variables
For a multi-language site, and it still worked on EE 4 even when it’s stated to only work up to version 3.
I yet have to upgrade to 6. I’m wondering if anyone else on EE 6 is using this add-on or if it still works. I’m planning on upgrading to 6 eventually, which means I don’t want to store all the work in that add-on just to found out it’s broken, or I have to switch to something else and re-do all files.
I found it quite useful to just create the text for a different phrase on different languages with the add-on, and then I was able to just use a variable like
{{lang}-dashboard}
On the template and it would use the user language automatically instead of hardcoding the text or having different template files for different languages.
If there is a similar add-on or way to achieve this without add-ons that would be better.
If memory serves me correctly, it just stored the text in EE as template variables.
Republic Variables may work in EE6 (not used it myself), but you’re right to be cautious.
Other options:
I’ve used https://eeharbor.com/low-variables for multi languages sites before, LV is like RV on steroids.
There’s also https://eeharbor.com/transcribe and https://expressionengine.com/add-ons/publisher which are full translation modules.
I’m aware of publisher, but seems out of my budget. Never tried Low Variables but I don’t need anything fancy. If I can edit the variables in files directly from IDE, that would be better, which Low Variables seems to do, but I’m curious how overkill something like that is for something this simple and how it affects performance.
Transcribe also seems very expensive. Ideally I would like to have all language variables in the same file for easier working when it comes to replacing text and translation. That way I can just use the search and replace on my IDE code editor.
I guess the price for Publisher or Transcribe is justified if you have more than one language and for bigger sites, but this is not my case right now. I just need to translate templates on a specific template group, not the whole site, and seems way to overkill to pay that much money to translate some template files. Normally for static stuff I just create a separate template group in that language, but for this situation I use tons of dynamic code and PHP and it would be a nightmare every time I fix one little but having to fix the same code in a several other templates.
To be honest, I’m a bit annoyed I need an add-on for this in 2021. Something like transcribe should be native to Expression Engine. Expression Engine must be the only CMS that does not support native multi-language files, unless you use extra stuff.
I guess I will just upgrade a test installation to 6 and check if Republic Variables still works.
A lot really depends if the site owner needs to be able to (easily) modify variables. If they do then Low Variables would work fine in your situation.
I’ve made numerous multilingual EE sites over the years, both with and without 3rd party addons, it’s all doable using native functionality for basic sites. Where you only need a couple of languages a mixture of channels, template and global variables should cover all bases, but as you say if you have multiple languages then Publisher or Transcribe can save a lot of time.
Language addons sound expensive but they can often reduce the amount of (billable) hours needed for the build.
Thank you for answering, Rob. My site is already multilanguage, but I just create different channels and template groups for each language. Only use two for now.
This made sense for me because there is a lot more than just text translation. Example, the images and graphics also have to be different, and basically it’s a completely different website for each language based on that type of local user.
This is for public facing pages which don’t involve that much work, and having this separation also allows different group of users to focus on their local site only. I rarely use channels on these templates and if I do, I just have a different one of each language since they hold different content anyway.
The problem is that now I’m creating an internal account area.
It does not contain consumable information like the public pages, it does not involve a lot of text, images or content, but it’s more dynamic generated content. It pulls info from databases and has tons of embeds and PHP code in some templates which do most of the magic.
I was going to use the same approach and just create a different account template group for each language, but then I noticed that in this specific case it would not work in a fluent way as it does not involve changing content but programming.
The programming is the same for everyone regardless of the user locale, and only small pieces of text are on the output like errors or success messages which I need to translate.
You mentioned you used native functions as well. I would love to explore that if possible.
Did you use some specific global variables or template partials? I’m curious about this, I don’t need this for channels just for templates, to replace the hard coded text with the specific user language. This is precisely what Republic Variables does and probably the other add-ons, but if this can be achieved without add-ons that would make it cleaner for upgrades in the future.
That way I can just keep everything in one account template group and just replace all the hard coded text with a variable. EE then just replaces this text with the user logged in language.
> Did you use some specific global variables or template partials?
Global variables mostly. Using Low variables I created input fields for each language, where each variable is named for the language, e.g.
en_logo (file field)
de_logo (file field)
en_telephone (text field)
de_telephone (text field)
en_some_option (radio button yes/no)
de_some_option (radio button yes/no)
en_general_error (rte field)
de_general_error (rte field)
en_things_list (grid field)
de_things_list (grid field)
…etc
Variables can then be assigned to template or partials accordingly.
Another approach is to use a “settings” channel set up with whatever custom fields you need. You’d then add one entry per language and call the appropriate entry data into your templates wherever needed.
Using a settings channel shouldn’t affect performance much at all, especially if you’re only using text input fields, plus you can cache the settings entries tag(s) as well. If you use a “lot” of complex fields like grids/relationship that will add a bit of extra overhead but once cached it should be fine.
As an example the last settings channel I used controlled things like primary + footer navigation links, generic global stuff like address/phone/map and a bunch of radio button groups to toggle things on/off - I probably used up to 4/5 entries tags in any template with no noticeable performance hit once cached.
For anyone else reading this. I installed EE on a local LAMP server and while the add-on installs fine and at first looks you can create languages and variables, it’s not compatible with EE 6.
It has several errors related to missing SQL tables it cannot find and other PHP errors when you go click on other sections like groups, settings, others.
I would not recommend Republic Variables with EE 6 unless the developer decides to make it compatible in the future.
Thank for you the advice Rob. The problem with using channels is that you need to edit every little word and phrase from the web panel. This is very impractical for me as I keep adding more and more translations.
The suggested add-ons seem to let you edit the files directly, but sadly none has all of them in a single file either. Its editing a bunch of individual files. This gets very messy very fast, in my case I need to translate individual words which would mean hundreds or thousands of individual variables/files for each word.
Sadly it seems that is the only solution, none works with a single consolidated locale file like other CMS work, which means they pull all language variables from that single file and you can just open it and browse and edit everything as required. Actually, the build in EE locale files also work like that but it does not seem it can be used for template or your website. Strangely the EE addons like the Wiki or the forum also have the locales consolidated.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.