ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Multi-language support and implementation

May 26, 2012 12:32am

Subscribe [2]
  • #1 / May 26, 2012 12:32am

    JT Thompson

    745 posts

    I’m an EE professional developer and am being asked to incorporate double byte character sets for multi-language support in EE by a client. While I know the general mechanics of this (database to use Unicode) frankly I’ve never had to do this for a client in EE before so I’m reaching out to anyone who has experience in this who is willing to share some of the basics and “gotchas” in developing an EE website for multi-languages.

    The clients website is being designed for some major companies usage and some of them would like international support (not so much for the material of the site – for now – but mostly for the forum/chat area where people converse on their issues). I really would appreciate any help or guidance in this area.

    Thank You!
    -Jon

  • #2 / May 26, 2012 1:17am

    Bhashkar Yadav

    727 posts

    Hi JT,

    There is a very nice add-on for it Multi Language Support (MLS). It have good documentation also.

    Best Regards,

  • #3 / May 27, 2012 12:23pm

    ChiefAlchemist

    913 posts

    The plugin looks interesting.

    That said, to me, you can probably accomplish a lot of heavy lifting but using preload_replace. Low does a great post on it:

    http://gotolow.com/blog/snippets-and-preload-replace-variables

    In short, let’s say segment_1 is the language code. You could grab that and preload_replace it as a prefix to any field (or channel) that is language centric. For example, you might have fields:

    en_field_1
    it_field_1
    ca_field_1

    Each would contain the field_1 content as “translated” for that particular language. When the page for mysite.com/it/some-page come in, the preload_replace kicks in. One template, many permutations.

    Oh course this same architecture could be used in other ways. For example, customized landing pages (so to speak). For example:

    mysite.com/x1/some-page would be “x1 centric”

    but mysite.com/y2/some-page could be “y2 centric”.

    Note: I have used preload_replace (love it!) but not in the way I’ve just described. In theory it makes perfect sense but I can only speak of the theory 😊

  • #4 / May 27, 2012 1:18pm

    Bhashkar Yadav

    727 posts

    Well,

    there shouldn’t be any worry about segment or language code.

    Please read this article first Multi language site alternative

    “BL Multi Language Support” works something same way. i.e suppose you are setting 2 languages: fr, en.
    Then 2 folders fr,en will be created with a index.php file within it and a global variable for language_code which can be accessed anywhere by using {language_code}.

    Based on it, 2 language URLs can be generated :
    http://yoursite.com/fr/index.php/home
    http://yoursite.com/en/index.php/home (if you are not removing index.php)

    here segment_1 will be home i.e your template group name. other segments can be accessed in same way.

    Hope this would help you.


    Best Regards,

  • #5 / May 28, 2012 6:40am

    JT Thompson

    745 posts

    Thank you for all the responses, I really do appreciate the addons advice.

    What I’m looking most for is someone who has experience with multi-language implementation in EE to give some guidance, i.e. someone with experience in the implementation issues and caveats using EE channel fields and such with double byte characters, fonts, Db searches…

    Not looking to make the entire website multi-language (at this time), all that is needed in this case is just the ability for people to converse using different languages (like a forum or chat). It would be nice to add translator functionality (that could even be javascript based, or ajaxed if needed), although it is not a requirement by the client. I’m more concerned about the mechanics of implementation in other words:

    1. How the XSS in EE handles different languages.
    2. How will search be effected.
    3. How do I know what language the user is using?
    4. How do I know what font to use on the field (especially if I don’t know the language the user is using)?

    Would it be mandatory for a user to select from a list (like a dropdown) of supported languages before they type in their response? Is there a way to do a “best guess” by analyzing the field? Can I just select a broad multi-language font to cover all bases (I know they make multi-language fonts – but I don’t think there is a “super font”, some languages will need their own font I’m thinking)?

    An EE module would (I hope) address many of these issues on a site-wide basis, however, I’m looking for only basically one field (textarea) in a website that needs to be multi-linguistic (at this time), so I’m thinking a full blown module is overkill (It’s not the cost of the EE addon – could care less about that, my development time costs far more than any EE addon).

    Again thank you for your time!
    -Jon

  • #6 / May 28, 2012 8:32am

    ChiefAlchemist

    913 posts

    “An EE module would (I hope) address many of these issues on a site-wide basis, however, I’m looking for only basically one field (textarea) in a website that needs to be multi-linguistic (at this time), so I’m thinking a full blown module is overkill (It’s not the cost of the EE addon – could care less about that, my development time costs far more than any EE addon).”

    Hi Jon

    Pardon me for repeating myself but with a segment and a preload_replace you can define which field(s) to use, which fonts to use, etc. Preload_replace is find & replace on the fly. So imagine if you setup site A with static html. You then duped it and proceeded to do all the copy & pastes for a second language, third, and so one.

    (In a nut shell) Preload_replace is that within the context of EE and CMS.

    You would know better than I but this isn’t specifically a language issue per se. It’s a content targeting issue based on some value in the URL. That value can also be changed via dropdown or some other sort of selection by user UI. This it what EE does, yes? 😊 Language is just a twist on that capability.

    Search is the only issue that could make things funky. But that depends on how you decide to structure your channel(s) and entries. . If an entry has multiple fields for language you might have some issue. However, if an entry has for example a language category and you select with that, then that’s different.

    Perhaps it would help to ask how segment + preload_replace and/or categories isn’t going to meet you needs and then try to plug those holes?

  • #7 / May 29, 2012 3:02am

    JT Thompson

    745 posts

    I actually know about the trick of preload replace with snippets (been using it since day 1 of snippets - snippets are cool 😉 ).

    What I’m more concerned about is implementation issues and caveats of using a multi-language field in a channel (like the search issue and others I mentioned).

    I really need the questions I asked answered by someone with experience implementing a multi-language site, I’m confident I can do it, I’d just like an experienced guided hand if one can be found willing to reply.

    If not I’ll muddle thru it. :coolsmile:

    -Jon

  • #8 / May 29, 2012 8:56am

    ChiefAlchemist

    913 posts

    Suggestion: Ask the search question then. 

    Other than that, it’s not really a “language” issue per se.

    Also, I forgot to mention Low’s Seg2Cat. You probably know about that too but in case someone else reads this thread Seg2Cat is a must-use with just about any install, yes?

    Happy muddling.

    p.s. If you decide to ditch EE Search for Google Site Search / Custom Search I have a jQuery plugin (mostly baked) for that. Let me know if you’re interested.

  • #9 / Jun 13, 2012 8:21pm

    ChiefAlchemist

    913 posts

    Hey JT

    I’m curious…how it goin’? Any insights to share?

    Thx

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases