I'm trying to follow the moodledocs instructions on how to create a local language. I've gotten to:Add a string for parentlanguage to this file, which points to the language which is the most similar to yours.
Does anybody know what the syntax for this line would be if my parent language was en_utf8?
The format would be: $string['parentlanguage'] = 'en_utf8';
However, if you use the language editor tool in Moodle at Admin --> Configuration --> Language --> Edit strings --> moodle.php you can just type in the value in the box without worrying about the syntax.
Also, if you are using Moodle 1.6 and the parent language is en_utf8 you don't really need to set it, as this is the default parent language whenever the parentlanguage string is left blank.
Hope this helps,
Ok, so I don't have to add a string to langconfig.php if I'm using en_utf8. So I have created the folder moodledata/lang/en_local_utf8 (I've also tried en_utf8_local because moodledocs are not clear on the name) and put a copy of the file langconfig.php from moodle/lang/en_utf8 into it. Now if I go to configuration>>variables I do not have a selection for en_local?
I also can't edit strings in en_utf8. If I go to configuration>>lang and click edit strings I get the message that I can't edit strings unless I move en_utf8 to moodledata/lang folder. So I move en_utf8 to moodledata/lang and then when I click edit strings the message says it can't find the english language pack? So then I tried moving moodle/lang/en to moodledata/lang and I got the same message. I wonder what the purpose of the en folder is in 1.6?
So now I have two issues 1) creating a local language and 2) editing strings in en_utf8 via moodle.
try to download development (aka HEAD) version of Moodle and use new admin/lang.php. Maybe it will help you. We have not managed to include this improved tool in release 1.6, but I hope that it might be part of stable Moodle in 1.6.1
From the moodle docs, try the following:
- Name the local language pack you are creating en_local. Place it in moodledata/lang.
- In administration --> configuration --> Variables --> Interface make sure that the "langlist" variable is empty or includes en_local.
- Remember that if "language cache" (in the same section as 2 above) is set to yes it will take some time for the changes to be reflected in the language menu.
- You should never edit the en_utf8 language pack, that is why it is in a different directory and is locked to editing (never move en_utf8 from its default home in the lang directory). Instead, edit your local language pack en_local.
- You don't need an en folder in 1.6 so it can be safely deleted.
I'm not sure where you got your steps but I can't find them in moodle docs. The file and folder references in Moodle docs do not reflect the way 1.6 installs. There is no moodledata/lang/en on a fresh install. When you speak of creating an en_local folder do you mean en_local_utf8 (like en_us_utf8). Once that folder is created do I need to copy langconfig.php in there before it will show up in the configuration>>variables lang menu? Either way I can't get moodledata/lang/en_local, en_local_utf8 or en_utf8_local to show up in any configuration drop downs.
I think my installation and setup is good because I am able to go in and edit strings in en_us_utf8 from within moodle.
I had a few issues when customising my en_utf8 language.
You might like to look at the discussion I had not long ago.
Anyway, the correct directory for en_utf8 is;
In my situation I just manually copied the language files that I wanted to modify from moodle/lang/en_utf8 to /moodledata/lang/en_utf8_local.
I then used a text editor to modify the language files in /moodledata/lang/en_utf8_local.
The moodle code automatically checks the _local directory first for the required language file and if not found then looks in moodle/lang/en_utf8.
I did not try and use the web interface to edit so I can't help out there.
Not all of the steps I listed are in Moodledocs but some of them were. Other information is in the translation section of Moodledocs. I know that this is a little complicated but you can do it - you are almost there I am sure! Actually answering your questions has helped me to learn more about the changes in 1.6 regarding languages - I wasn't on top of all the details until now.
On a fresh install, there are no folders in moodledata/lang because you have not added any other languages there yet. If after installation you use the language import utility to add other languages (eg Japanese, French etc.), then they will be downloaded to moodledata/lang and it will no longer be empty. If you have en_us_utf8 in your Moodle you must have added it there, either manually or using the language import utility in Adminstration --> Configuration --> Languages.
There is a moodle/lang/en (not moodledata/lang/en, both en and en_utf8 go into moodle/lang, while all others go in moodledata/lang), but it is only for sites not using unicode - which will be uncommon as unicode is the default for Moodle 1.6. From the Readme in moodledata/lang/en: "This language pack "en" is a *stub* language pack for backward compatibility with old sites not using Unicode. It simply makes the en_utf8 pack appear under the old latin encoding. Do NOT add new strings or help files here, please use en_utf8 for all new strings." So it is not used for most sites.
Yes, I should have said to name your customized language pack en_utf8_local (not en_local_utf8). If you use this name format then it is checked automatically before the corresponding default language. Don't forget to copy the langconfig.php file from the en_utf8 pack to the en_utf8_local pack you are creating (but you don't need to add the parent language string, both because en_utf8 is the global default and also because the "local" name is checked together with the corresponding language - unless you want the parent language to be en_us_utf8).
From the translation page (the same link as above): "It [the local pack en_utf8_local] will not appear in the language menus for selection and your users do not need to change their settings." So the reason you are not seeing the customized language pack in the menu is because you are not supposed to! The local pack en_utf8_local and the main pack en_utf8 are checked together (local one first, then the main one) and the language menu only shows one entry for both of them.
Hope all this helps - it has me!
Thank you for sticking with me on this. Here's where I'm at:
I have moodledata/lang/en_utf8_local with langconfig.php and moodle.php within. I can manually edit the local moodle.php to change strings. The only remaining issue is that when I go to configuration>>language>>edit strings I get the following message "to edit this language pack, you need to put it in /home/XXXX/moodledata/lang".
Should I be able to edit the _local moodle.php from within administration?
The last issue you mention appears to be a bug that has not been finally fixed yet.
By the way, don't forget to search forums for an answer to questions such as this - it's amazing how much you can solve by doing this.
That bug has a status of resolved? Also I went in and rewrote some of the moodledocs on this so that the next person along this path will have some better info.
I did try searching the forums before I posted - I guess I just didn't look back far enough (1 month). Also, maybe mistakenly, I treated moodledocs as if it reflected the communities best thinking on the topic area. Seems to me that when a problem is found or solved in the forums it should be reflected in moodledocs. IMHO
Again, thanks for your help with this.
In the meantime, I've got a problem. Since I have not upgraded to unicode, all my language packs are still in moodle/lang. They do not work if I put them in moodledata/lang. That's ok with me, but the problem comes when I try to set a course language. No languages show up at all on the list of choices, including my existing custom packs in moodle/lang. So if I edit a course's settings, it loses the language pack because there is no choices. I can get the custom language pack back if I go into my database and type it in directly in the record for that course's settings, but not from within Moodle.
So my question is, why aren't my languages showing up on the list? Is it because the code in Moodle 1.6 assumes you are using unicode and assumes your language packs are in moodledata/lang? I don't think so, because I have put some language packs there as well. But I don't see any other plausible explanation either so I am stumped.
I'm reluctant to try another go at upgrading to unicode until I can actually get it working without unicode. I don't want to add a second problem. So any help would be appreciated.
Its the string that starts "Hi! For full access to courses you'll...". First, I'd like to determine if I'm changing the correct string. I've narrowed it down to these three:
Other related settings are as follows:
$string['thislanguage'] = 'English'; $string['thischarset'] = 'iso-8859-1'; $string['locale'] = 'en'; $string['parentlanguage'] = 'en_utf8';
/www/university/moodle/lang/en_utf8/langconfig.php $string['locale'] = 'en.UTF-8';
I did not make edits or additions to /www/university/moodle/lang/en_utf8/ Admin panel settings: Administration > Language > Language Settings
Default Language [English (en)]
Cache language menu [x]
Sitewide locale [en_us]