Add a new language to cmsms mle?
Add a new language to cmsms mle?
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
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
Re: Add a new language to cmsms mle?
sarah_h wrote: Well thanks to the help of many of you here, not least Alby (the legend!)
If there are a few changes only from en_US (I don't know), you can: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?
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
Re: Add a new language to cmsms mle?
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
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
Re: Add a new language to cmsms mle?
Sure that you must add relative fileds (look README.FIRST):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?
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
Re: Add a new language to cmsms mle?
Hi Alby,
I've made these changes to the SQL:
I'm not sure what the extended means so I have not run the extra 2 queries.
and I've followed these instructions:
I amended the config.lang.php file like this:
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?
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;
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
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',
)
I'm not sure what the problem is. Could it be the 2 queries I did not run for extended?
Re: Add a new language to cmsms mle?
1. In extended version you have metadata_lang and titleattribute_langsarah_h wrote: I'm not sure what the problem is. Could it be the 2 queries I did not run for extended?
Have you metadata_en and titleattribute_en for example?
2. In README.FIRST you read:
Now you have already content_en,content_it,content_fr .....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%';
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
Re: Add a new language to cmsms mle?
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.
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.
Re: Add a new language to cmsms mle?
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.
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.
[solved] Re: Add a new language to cmsms mle?
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.
Thanks Alby, for trying to help. Now I have notes and I should be ok if I need to do it again.
Re: Add a new language to cmsms mle?
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.
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.
Re: Add a new language to cmsms mle?
Primary or default language as type string (label display) should be chosen the first time and never changedTeXnik 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.
Alby
Re: Add a new language to cmsms mle?
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?
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?
Re: Add a new language to cmsms mle?
No, change in config_lang.php AND: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?
1. drop all your cookie site
2. close your browser and reopen
Alby
Re: Add a new language to cmsms mle?
Current CMSms-mle-fork can change default language on admin panel "Site Admin » Global Settings > MLE languages".