I’d be open to a discussion however on how to provide translations for those features. Categories, specifically, are difficult because there is no place in the EE admin to enter an alternate language.
How about creating additional category groups suffixed with the language code?
Mark: first off, thank you for sharing this extension, and thank you for using the $SESS->cache array, appropriately prefixed. :-D
Some notes:
1) The table prefix is handled automatically when using $DB->query() 2) you might prefer to use $FNS->set_cookie() which honors the cookie prefs for the installation 3) Member custom fields could potentially be used to recreate the default fields in different languages. This would either require some setup by the user, or some automation by the extension, which would be best handled as an option and not a blind database manipulation. 4) Categories. I believe some changes I have made for 1.6 will assist you, but I can offer nothing concrete as implementation remains fluid until I am happy with it. For the present time, Ryan’s suggestion is perhaps a good idea.
@Ryan and Nathan
Great ideas! I love the idea of using a separate category group to define the translations. It will take a little bit of tweaking, but I think something along those lines could work quite well. The biggest challenge there is that you’d have to be very anal about keeping your category groups in sync.
@Derek,
@Rob,
Derek kind of gave it away, but when you click a language it redirects you to a new page with the /lang/_ja(suffix) appended to the end. That set’s a cookie and then redirects you back to the page without the suffix.
Very nice Mark!
A great addition to the various Multi Language efforts.
Unfortunately it uses the exact same name as my language switcher extension… (the one that changes a logged in member’s Localization Settings based on the ‘language’ variable set in path.php)
I’ve since renamed this extension to ‘Simple Translator’ to avoid a conflict with Cocoaholic’s language switcher.
@Cocoaholic,
I decided against merging the two extensions because they serve two fairly separate purposes. Yours works in the admin side of things (as far as I could tell) and mine on the front end, in the template side of things. Keeping them separate should make both easier to support and develop for. Plus, because you caught this early enough the 13 people who had already downloaded the extension shouldn’t be too troubled to update again.
What my extension does is change the ‘language’ variable (using a query) for logged in members.
This means that all templates affected by the language you chose in your Localization Setting will reflect the current language.
I’m talking about pages like: - Advanced search - Member List - Profile pages etc.
@lincolnpixel,
It should be at the top of the thread.
@Cocoaholic,
Huh, we’ll that makes sense then. Sort of as an aside, do those pages come with translations out of the box? Or do you have to download additional language packs for EE to get those pages to translate? I’ve never had a need to translate the admin side of things.
The problem right now with integrating the two extensions (which I’d like to do, now knowing how yours works a little better) is that I’m not using the built in EE list of available languages. I’ll have to look into using those before I can integrate your feature.
Yes, the language packs take care of the translations.
But again, I am not talking about admin pages (although those are affected as well) The pages I mentioned are Public pages!
😊
EDIT: Public pages, but the extension works for registered members only though. Read the WIKI article and you’ll understand why I made the extension in the first place.
Mr Mark, I’m getting this error.. Notice: Undefined offset: -1 in /home/crecondt/public_html/engine/extensions/ext.simple_translator.php on line 147
Notice: Uninitialized string offset: 0 in /home/crecondt/public_html/engine/extensions/ext.simple_translator.php on line 157 can you help, please.
@lincolnpixel,
Sorry about that. It should be fixed now in 1.0.4. (silly warnings, for even sillier mistakes on my part)
@Cocoaholic,
I realize the profile pages are public, I just refer to them as Admin pages because they aren’t managed through the Template tab, you can’t place normal template tags in them and they are just a bear to work with. I also read through the wiki article, and surely something like your extension is useful. I’m looking into a way to tie the two extensions together and also use the language packs built for EE.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.