Add a new language to cmsms mle?

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
sarah_h
Forum Members
Forum Members
Posts: 189
Joined: Tue Apr 25, 2006 8:30 am

Add a new language to cmsms mle?

Post by sarah_h »

Hi,

Well thanks to the help of many of you here, not least Alby (the legend!) I have a working cmsms mle site! Next question: How do I add a new language? In this case Welsh. I have someone who can help with translation but how do I add the functionality to mle?

Sarah
alby

Re: Add a new language to cmsms mle?

Post by alby »

sarah_h wrote:Well thanks to the help of many of you here, not least Alby (the legend!)


;D


sarah_h wrote:How do I add a new language? In this case Welsh. I have someone who can help with translation but how do I add the functionality to mle?


If there are a few changes only from en_US (I don't know), you can:

for admin part:
- create a folder admin/lang/cy_GB
- copy admin/lang/en_US.nls.php to admin/lang/cy_GB.nls.php
- copy admin/lang/en_US/admin.inc.php to admin/lang/cy_GB/admin.inc.php

for modules:
- copy modules/YOUR_MODULE/lang/en_US.php to modules/YOUR_MODULE/lang/ext/cy_GB.php

if there are many changes you should open a new translation at forge (there are others also who perhaps are interested, i.e. chipper)
Useful for CMSMS 2.0 also

Alby
sarah_h
Forum Members
Forum Members
Posts: 189
Joined: Tue Apr 25, 2006 8:30 am

Re: Add a new language to cmsms mle?

Post by sarah_h »

Hi Alby,

I've finally got around to trying to add a new language. I have read this post again but I'm confused over this:

Your instructions don't mention whether I need to update the SQL. When i converted the site to MLE I needed to run several queries which set up en, fr and it. Don't I need to do the same for cy so that the page contents can be used in Welsh also?

Hope you can help

Sarah
alby

Re: Add a new language to cmsms mle?

Post by alby »

sarah_h wrote:Your instructions don't mention whether I need to update the SQL. When i converted the site to MLE I needed to run several queries which set up en, fr and it. Don't I need to do the same for cy so that the page contents can be used in Welsh also?


Sure that you must add relative fileds (look README.FIRST):
ALTER TABLE cms_content ADD content_name_cy VARCHAR(160) NULL AFTER content_name;
ALTER TABLE cms_content ADD menu_text_cy VARCHAR(160) NULL AFTER menu_text;
ALTER TABLE cms_htmlblobs ADD html_cy TEXT NULL AFTER html;

There is UPDATE cms_content for entered content_cy but this depend of your setting (is same if you entered in any pages and Save)
I don't know if you have MLE extension then you must apply others 2 queries (look in README.extension)

Finaly you edit config_lang.php and put new language

Language files cy_GB are important because, in other case, you have en_US language

Alby
sarah_h
Forum Members
Forum Members
Posts: 189
Joined: Tue Apr 25, 2006 8:30 am

Re: Add a new language to cmsms mle?

Post by sarah_h »

Hi Alby,

I've made these changes to the SQL:

Code: Select all

ALTER TABLE cms_content ADD content_name_cy VARCHAR(160) NULL AFTER content_name;
ALTER TABLE cms_content ADD menu_text_cy VARCHAR(160) NULL AFTER menu_text;
ALTER TABLE cms_htmlblobs ADD html_cy TEXT NULL AFTER html;


I'm not sure what the extended means so I have not run the extra 2 queries.

and I've followed these instructions:

Code: Select all

create a folder admin/lang/cy_GB
copy admin/lang/en_US.nls.php to admin/lang/cy_GB.nls.php
copy admin/lang/en_US/admin.inc.php to admin/lang/cy_GB/admin.inc.php


I  amended the config.lang.php file like this:

Code: Select all

cy_GB ' => array(
   'block'=>'cy',
   'flag'=>'<img src="/path_cms_root/images/lang/fr.png" style="border:0; opacity:1;" alt="cymraeg" />',
   'text'=>'Cymraeg',
   'locale'=>'cy_GB .utf8@euro',
 )


When I go into admin>pages I see all the pages in english and I see links to english and welsh. So that looks ok but when I go to change the content of the welsh pages I cannot. The welsh link is greyed out. I can click it but it loads up the eng pages (the eng link I cannot click on so cmsms thinks this is the eng page!). I added a lang to the template to see what would happen and when I click the welsh link nothing changes!

I'm not sure what the problem is. Could it be the 2 queries I did not run for extended?
alby

Re: Add a new language to cmsms mle?

Post by alby »

sarah_h wrote:I'm not sure what the problem is. Could it be the 2 queries I did not run for extended?


1. In extended version you have metadata_lang and titleattribute_lang
Have you metadata_en and titleattribute_en for example?


2. In README.FIRST you read:
II. Change or add (content_block) in: 'content_en,content_it,content_fr' string to match your 'block' config_lang.php

UPDATE cms_content SET prop_names = REPLACE(prop_names,'content_en','content_en,content_it,content_fr') WHERE prop_names LIKE '%content_en%';


Now you have already content_en,content_it,content_fr .....
But if you save a page in other languages should create relative 'content_cy' value necessary for Welsh page after
Edit and save a page in english and look if 'prop_names' filed of cms_content you have content_cy


Alby
sarah_h
Forum Members
Forum Members
Posts: 189
Joined: Tue Apr 25, 2006 8:30 am

Re: Add a new language to cmsms mle?

Post by sarah_h »

No, I don't seem have metadata_lang or titleattribute_lang. Do I need them?

I edited an eng page and it did save it and when I looked at I did see content_cy in the prop_names yes.

I added a new page in eng, then saved it. Then I edited the welsh version of that page and it changed the eng page. The flags are definitely not working correctly. When looking at eng pages the eng flag is not clickable but the welsh is. That's right but when I click on the welsh flag it stays grey and eng stays bright. Nothing changes when the welsh flag is clicked. So I never see any welsh content.

So it seems that the welsh pages are never selected this is the same on the site using the lang. Click on welsh and nothing changes although I do see &hl=cy_GB added to the url string.
alby

Re: Add a new language to cmsms mle?

Post by alby »

What is the version?

Alby
sarah_h
Forum Members
Forum Members
Posts: 189
Joined: Tue Apr 25, 2006 8:30 am

Re: Add a new language to cmsms mle?

Post by sarah_h »

Version CMSMS 1.4.1

I converted from a non-mle version. It all worked after the conversion. I just need to add another lang. I've been testing all afternoon and I cannot see anything wrong with what I've done. Maybe I'll have another look in the morning.
sarah_h
Forum Members
Forum Members
Posts: 189
Joined: Tue Apr 25, 2006 8:30 am

[solved] Re: Add a new language to cmsms mle?

Post by sarah_h »

Well, after lots of frustrating days i finally got it all working. How, by re doing everything again! So i MUST have missed something while I was working. I think it was during the MySQL changes. Moral of the story: ALWAYS keep notes!

Thanks Alby, for trying to help. Now I have notes and I should be ok if I need to do it again.

:)
TeXnik
Forum Members
Forum Members
Posts: 132
Joined: Thu Aug 07, 2008 12:45 pm
Location: Thailand

Re: Add a new language to cmsms mle?

Post by TeXnik »

As being one of the utmost lazy ones, I tried to generate text files which will be created according of the language selection, not successful. People experienced in php programming (I'm not :-\) should be able to get such files, which then can be copied to phpMyAdmin or directly insert the commands into the database.

Right now my test ML page works, but it get messed up each time I try to change the primary language and add another one.
alby

Re: Add a new language to cmsms mle?

Post by alby »

TeXnik wrote:Right now my test ML page works, but it get messed up each time I try to change the primary language and add another one.


Primary or default language as type string (label display) should be chosen the first time and never changed

Alby
TeXnik
Forum Members
Forum Members
Posts: 132
Joined: Thu Aug 07, 2008 12:45 pm
Location: Thailand

Re: Add a new language to cmsms mle?

Post by TeXnik »

Thanks. First I installed in English to see how it is working and decided later to change to German.

So now I have to install it new with a different primary language. Will a backup of the database work or must all the data created a new?
alby

Re: Add a new language to cmsms mle?

Post by alby »

TeXnik wrote:So now I have to install it new with a different primary language. Will a backup of the database work or must all the data created a new?


No, change in config_lang.php AND:
1. drop all your cookie site
2. close your browser and reopen

Alby
Peciura

Re: Add a new language to cmsms mle?

Post by Peciura »

Current CMSms-mle-fork can change default language on admin panel "Site Admin » Global Settings > MLE languages".
Locked

Return to “[locked] CMSMS MLE fork”