Help with multiple language things

This is a FORK of the CMS Made Simple project and is not oficially supported in any way by the CMS Made Simple development team.
Locked
cpyu99

Help with multiple language things

Post by cpyu99 »

I successfully installed and made the cms multiple language versions working...
However, I cannot do somethings . Hope people in here can give some hints

Background:
I have CMSMADESIMPLE with 2 languages. One is chinese and another one is english.

Questions

Q1.) I have 2 images one with chinese words in it and one with english words in it.  I want to show chinese images when the system in chinese mode, and showing english images when english mode.

Currently, in multilple languages pack, all language for page are sharing single template, so I only can put one images (either english and chinese) in template.  Are there some modules or whatever tricks, so I can get the url tag ... hl=en and make my templates show a suitable images

my url ... http://www.autosolution-hk.com/prj/cmsm ... php?&hl=en

Q2) How News module can be multiple languages ?


THANKS A LOT IN ADVANCE..
alby

Re: Help with multiple language things

Post by alby »

cpyu99 wrote: I successfully installed and made the cms multiple language versions working...
However, I cannot do somethings . Hope people in here can give some hints
Tomorrow I publish a version MLE 1.1.1-SVN  ;)

cpyu99 wrote: Q1.) I have 2 images one with chinese words in it and one with english words in it.  I want to show chinese images when the system in chinese mode, and showing english images when english mode.

Currently, in multilple languages pack, all language for page are sharing single template, so I only can put one images (either english and chinese) in template.  Are there some modules or whatever tricks, so I can get the url tag ... hl=en and make my templates show a suitable images

my url ... http://www.autosolution-hk.com/prj/cmsm ... php?&hl=en
In this version of MLE you can add in template:

Code: Select all

{if $smarty.get.hl == 'en'}
 <img src="en.png" />
{elseif $smarty.get.hl == 'b5'}
 <img src="b5.png" />
{/if}
In my version:

Code: Select all

 <img src="{$lang}.png" />

cpyu99 wrote: Q2) How News module can be multiple languages ?
Add new categories:
General_en, General_b5
and add a similar above example

Alby
Pierre M.

Re: Help with multiple language things

Post by Pierre M. »

Hello alby,
alby wrote: Tomorrow I publish a version MLE 1.1.1-SVN  ;)
Nice :-)
Please tell us more about this dev. Is it a followup of katon's 1.0.2-MLE ? It is a "technology preview" of Official 2.0 ? Is it something else of your own ?

I'd like to read from you about "single tree, news", multilang implementation design and "TCN".

Pierre M.
alby

Re: Help with multiple language things

Post by alby »

Pierre M. wrote: Hello alby,
alby wrote: Tomorrow I publish a version MLE 1.1.1-SVN  ;)
Nice :-)
Please tell us more about this dev. Is it a followup of katon's 1.0.2-MLE ? It is a "technology preview" of Official 2.0 ? Is it something else of your own ?

I'd like to read from you about "single tree, news", multilang implementation design and "TCN".
Ok, it's a followup of katon's 1.0.2-MLE

I had a site with MLE 1.02.
I wanted upgrade to new version of official release of CMSMS and I couldn't wait 2.0 release for security problem  :-\
It's very very "great and simple" for users but this project is dead  :'(

I have apply patch parts to 1.07, 1.08 and in production with 1.1 and I think that works.
Now, I have apply to 1.1.1 (SVN revision 4080).

Principal differences:

- Limited difference (in number and part) of files for relative simple synch with official CMSMS release

- Change language array config_lang.php to locale (no en,es but p.e. en_GB,es_MX) for finest language selection

- Selected language is define in:
  locale, frontend language, current language (in this way CMSMS load current locale language for ALL modules)

- Define a smarty compileid language dependant for avoid compiling and caching problem with a unique template for all languages

- Increment of caching at level of official release (caching of MLE 1.02 is off)

- Smarty template variable {$lang} assign to current locale language (p.e. en_US, it_IT) and {$currlang} (p.e. en, it) for use in metadata language tag

- Define a personal language file (mle/lang/*.php) for template, you use {$mle_translation.your_key_for_translation}

- Try to recognize user visited and display relative language (TCN plus cookie), DEFAULT LANGUAGE if not. It's the method of php site and similar to this

- Add use of additional content block (language dependant transparent) {content block="contentblockXXXX"}


Tomorrow I make an post with more detail and link to complete release and a zip of changed files only

Alby
Last edited by alby on Wed Aug 22, 2007 8:34 pm, edited 1 time in total.
alby

Re: Help with multiple language things

Post by alby »

alby wrote: Tomorrow I publish a version MLE 1.1.1-SVN  ;)
See this post

Alby
xmas3
Forum Members
Forum Members
Posts: 41
Joined: Sat Jul 28, 2007 9:22 am

Re: Help with multiple language things

Post by xmas3 »

Hi, Im using the Albys proposed snippet of code for getting the lang parameter from url

Code: Select all

{if $smarty.get.hl == 'sk_SK'}
         
	({$job->year})  {$job->title_sk} <br />
          <span>{$job->content_sk}</span>

{elseif $smarty.get.hl == 'en_GB'}
        
        ({$job->year})  {$job->title_en} <br />
          <span>{$job->content_en}</span>

{elseif $smarty.get.hl == 'de_DE'}
         
        ({$job->year})  {$job->title_de} <br />
          <span>{$job->content_de}</span>
It works fine, but not if I use the pretty urls.
Can you help me how to modify the template script?

Thanks, bye Miro
alby

Re: Help with multiple language things

Post by alby »

xmas3 wrote: It works fine, but not if I use the pretty urls.
Can you help me how to modify the template script?
I move in proper forum (this topic had not seen in previous!)

Try with $lang variable:

Code: Select all

{if $lang == 'sk_SK'}
         
	({$job->year})  {$job->title_sk} <br />
          <span>{$job->content_sk}</span>

{elseif $lang == 'en_GB'}
        
        ({$job->year})  {$job->title_en} <br />
          <span>{$job->content_en}</span>

{elseif $lang == 'de_DE'}
         
        ({$job->year})  {$job->title_de} <br />
          <span>{$job->content_de}</span>
Alby
xmas3
Forum Members
Forum Members
Posts: 41
Joined: Sat Jul 28, 2007 9:22 am

Re: Help with multiple language things

Post by xmas3 »

Yeah,
it works now! Thanks!
Locked

Return to “[locked] CMSMS MLE fork”