Welcome Guest, Not a member yet? Register   Sign In
Website Internationalisation (i18n) help
#1

[eluser]doMynation[/eluser]
Good day everyone,

I implemented the i18n module in my CodeIgniter application and everything works fine.

Althought displaying the text seems a bit long, it's fine.

Here's an example of a the product description view:

Code:
<h2>&lt;?=lang('gazebo.description.title2')?&gt;</h2>

<p class="list">
    &lt;?=lang('gazebo.description.title2.par1')?&gt;;<br />
    &lt;?=lang('gazebo.description.title2.par2')?&gt;;<br />
    &lt;?=lang('gazebo.description.title2.par3')?&gt;;<br />
    &lt;?=lang('gazebo.description.title2.par4')?&gt;;<br />
    &lt;?=lang('gazebo.description.title2.par5')?&gt;<br />
</p>

However, when I need to display paragraphes with words that are links, it gets a bit messy:

Code:
<p>
    &lt;?=lang('gazebo.description.title4.par1.1')?&gt;
    <a href="&lt;?php echo site_url('someController/someFunction'); ?&gt;">
             &lt;?=lang('gazebo.description.title4.par1.link')?&gt;
        </a>
    &lt;?=lang('gazebo.description.title4.par1.2')?&gt;
</p>

Is there a more elegant way of doing it ? Because putting the html tags and the link into the language files wouldn't be very nice in my opinion.

Also, how do you deal with things that aren't text like images ?

What I thought is:

/images/english/ <-- contains images translated in english
/images/french/ <-- contains images translated in french

And then images are loaded from the english folder if english is the current language. This would work fine, however what happens if I have images that are common to all language and that don't need to be translated ?

I am open to suggestions Smile


Messages In This Thread
Website Internationalisation (i18n) help - by El Forum - 04-29-2009, 09:53 AM
Website Internationalisation (i18n) help - by El Forum - 05-01-2009, 10:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB