Languages are making me crazy!

Languages are making me crazy!

by Brian Maynes -
Number of replies: 17

I have read so many threads about languages that I am going crosseyed! Any help from the experts here would be greatly appreciated.

We have just upgraded from Moodle 1.5.3 > 1.7.1 (we are not in production yet). I'm trying to get my mind around custom string changes. We do not need a completely new language, but would simply like to make modifications to the standard en_us_utf8 language pack and override some basic strings.

My current language folders are as follows:

\moodle\lang
     en (delivered, contents unmodified)
     en_utf8 (delivered, contents unmodified)

\moodledata\lang
     en_us_utf8 (created after installing en_us language using the utility)

I have en_us selected as my Default Language and it is displayed as the 'editable language' when I go into Admin > Language > Language editing and select Edit words or phrases.

However, it shows that changes will be saved to a folder called en_local. What the heck is this? Sure enough, Moodle creates the folder en_local in \moodledata\lang, and copies moodle.php to that folder...changes are then saved to the moodle.php file accordingly.

Here's my problem:
- I don't see the changes made to moodle.php in en_local.
- Why can't I change the name of this folder (en_us_custom for example) and have my changes get saved to that folder?

What am I missing?

Regards,
Brian

Average of ratings: -
In reply to Brian Maynes

Re: Languages are making me crazy

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Hi Brian,

have you read http://docs.moodle.org/en/Translation ?
In reply to David Mudrák

Re: Languages are making me crazy

by Brian Maynes -

David,

Yes...I have read that no less than 3 times. I think my confusion stems from the fact that I'm not clear which \lang folder specific files should be in.

Edit: Just poked around a bit more, and now my language changes are taking effect. However, whenever I go into Language EditingEdit Words or Phrases, Moodle wants to create a en_local folder to store my string changes. I already have a en_utf8_local folder containing moodle.php (where my current changes are stored) and the langconfig.php file.

Why doesn't it allow me to reference my existing en_utf8_local folder for all changes?

In reply to Brian Maynes

Re: Languages are making me crazy

by Brian Maynes -

Still can't see any of my custom string changes. To recap, I have installed the en_us_utf8 language in Moodle (in addition to the default en language delivered with Moodle). Both are in the \moodle\lang folder. I have en_us_utf8 selected as my default language.

I have only two folders in my \moodledata\lang folder:

\en_local (because Moodle won't let it be anything else. No matter what I do, it wants to put all my changes in this folder!!)
     langconfig.php (points to en_us_utf8 as the parent language)
     moodle.php (contains the changes I want displayed but aren't)
\en_us_utf8 (which appears to be a subset of the standard en_us_utf8 folder in the \moodle\lang folder.

Can anyone point me to where I may be going wrong? I have read and checked everything I can think of.

Regards,
Brian

In reply to Brian Maynes

Re: Languages are making me crazy

by ned moltoya -
have you tried putting your changes in \en_us_utf8_local?
In reply to ned moltoya

Re: Languages are making me crazy

by Brian Maynes -
OK...I tried your suggestion (which I had done at one time I think) and *some* changes are reflected, but not all. Not to mention, I still have the issue of Moodle wanting to put all edited strings in a folder called en_local...not en_us_utf8_local under \moodledata\lang.
In reply to Brian Maynes

Re: Languages are making me crazy

by ned moltoya -
did you copy langconfig.php and moodle.php to en_us_utf8_local and did you modify them according to http://docs.moodle.org/en/Translation ?
In reply to ned moltoya

Re: Languages are making me crazy

by Brian Maynes -

Yes and yes.

I would just like to know why Moodle insists on putting any language string changes I make in Edit words or phrases into the moodle.php file located in a \moodledata\lang\en_local folder, and not in en_us_utf8_local. If I click "switch" it creates an en_local_local folder! I'd like to get rid of en_local altogether.

Here's what I have currently (in detail):

\moodledata\lang\en_local (contains the same files as en_us_utf8_local below, moodle writes all changes to this folder)

langconfig.php
<?php
$string['locale'] = 'en_US.UTF-8';
$string['oldcharset'] = 'ISO-8859-1';
$string['parentlanguage'] = 'en_us_utf8';
$string['strftimedate'] = '%%B %%d %%Y';
$string['strftimedateshort'] = '%%B %%d';
$string['strftimedatetime'] = '%%B %%d %%Y, %%I:%%M %%p';
$string['strftimedaydate'] = '%%A, %%B %%d %%Y';
$string['strftimedaydatetime'] = '%%A, %%B %%d %%Y, %%I:%%M %%p';
$string['strftimedayshort'] = '%%A, %%B %%d';
$string['strftimerecent'] = '%%I:%%M %%p,%%b %%d';
$string['strftimerecentfull'] = '%%a, %%b %%d %%Y, %%I:%%M %%p';
$string['thischarset'] = 'UTF-8';
$string['thisdirection'] = 'ltr';
$string['thislanguage'] = 'en_local';
?>

\moodledata\lang\en_us_utf8 (installed language pack, unmodified)

\moodledata\lang\en_us_utf8_local (contains same files as en_local above)

langconfig.php
<?php
$string['locale'] = 'en_US.UTF-8';
$string['oldcharset'] = 'ISO-8859-1';
$string['parentlanguage'] = 'en_us_utf8';
$string['strftimedate'] = '%%B %%d %%Y';
$string['strftimedateshort'] = '%%B %%d';
$string['strftimedatetime'] = '%%B %%d %%Y, %%I:%%M %%p';
$string['strftimedaydate'] = '%%A, %%B %%d %%Y';
$string['strftimedaydatetime'] = '%%A, %%B %%d %%Y, %%I:%%M %%p';
$string['strftimedayshort'] = '%%A, %%B %%d';
$string['strftimerecent'] = '%%I:%%M %%p,%%b %%d';
$string['strftimerecentfull'] = '%%a, %%b %%d %%Y, %%I:%%M %%p';
$string['thischarset'] = 'UTF-8';
$string['thisdirection'] = 'ltr';
$string['thislanguage'] = 'en_us_utf8_local';
?>

If there's a problem in one of these langconfig.php files, I'm baffled as to what it is. Argh!

In reply to Brian Maynes

Re: Languages are making me crazy

by ned moltoya -
hmm maybe try setting $string['parentlanguage'] for en_local to 'en'

and I don't have a definition for $string['locale'] in there
In reply to ned moltoya

Re: Languages are making me crazy

by Brian Maynes -

Thanks Ned.

My changes seem to be displaying more consistently now, but I'd still like to know why Moodle wants to put my changes in en_local rather than en_us_utf8? It seems very clugey to have 3 separate language folder under \moodledata\lang\ when only 1 is ever being updated.

Brian

In reply to Brian Maynes

Re: Languages are making me crazy

by Robert Brenstein -
This sounds like a bug. You should enter it into the bugtracker.
In reply to Robert Brenstein

Re: Languages are making me crazy

by Brian Maynes -
I'm surpirsed nobody else has reported this "issue"...if it is, in fact, a bug. Personally, I think it's how I have my language settings and/or langconfig.php configured (details above), but I haven't received many other suggestions to try, so I'm just dealing with it for now.
In reply to Brian Maynes

Re: Languages are making me crazy

by Juan Marín -
I have experienced the VERY SAME ¿bug?
Yesterday I did a migration from 1.6.3 non utf to 1.7.2 And run the migration script. Almost all was correct BUT lang is making me crazy really.

I suffer the very same steps and confussion as Brian (unli change es_es in the place of en_us and I am still confussing. (I`working with linux server)

My priority now is to inderstand, the extrange behavior of es_utf_local directory (I couldn´t change, rename or delete ) more, It seems to be the folder moodledata/lang bloqued (I couldn´t add new folders in it (and three days ago I could ¿?¿?¿?¿?).

by the way, wich permissions are recommended to have the Lang/ folder (now it has some restricted permissions and tye propietary is web-data (and others folders in moodledata are read/write/execute for ALL). At the begining I hope the problem was only due to diferent groups/permissions (my local folder was created by admin propietary but es_es_utf8 was created by web-data (installed by mooddle amin/language page)). But when I try to edit strings manually appear the es_local and continue the headhache (may I delete it?)




In reply to Juan Marín

Re: Languages are making me crazy

by Juan Marín -
I'm not sure If the permissions of the lang folder are correct?

Now are:
//../moodledata/lang rwxr-xr-x
//../moodledata/lang/es_juan_ut rwxrwxrwx
//../moodledata/lang/es_es_utf8 rwxrwxrwx

HAve I to change it?
In reply to Juan Marín

Re: Languages are making me crazy

by Juan Marín -
I hope I solved the problem following this steps:
  • Manually chmod and set permissions 777 to all folders and archives in lang/ (if i don't do this, moodle create a new folder -as a message says in edit string page-)
  • Deleting the folders created by languaje edit string script
  • Upload my local lang folder NAMED es_es_utf8_lo (and set permissions to all)
  • I created some new variables in loca folderl but weren't read by moodle forms... So I copy them and add this variables to the end of moodle.php in parent language folder/moodle.php (this is not what I want to do -may be problems when upgrade parent language- but Now it functions)
  • deleting $string['locale'] in langconfig in my local lang folder
In reply to Juan Marín

Re: Languages are making me crazy

by Brian Maynes -

Juan...thanks for the response. Although we are not running under Unix/Apache, I do think our permissions to the \moodledata\lang folder are correctly set in IIS6.

I had already removed the $string['locale'] = 'en_US.UTF-8'; line from both the en_local folder and the en_us_utf8_local folder, although I have not touched the files in the en_us_utf8 folder. This folder was created by Moodle when I installed the "en_us" language pack.

My language string changes seem to be taking effect, although I'm still not sure if it's by accident. As a basic test, I renamed the en_local folder (XXXXX_en_local) and all my string changes reverted back to their original Moodle names. Renaming my en_us_utf8_local folder in the same manner did not do anything...all the changes contained in en_local were displayed as normal. I just don't like this en_local folder!!!! It makes no sense.

Also, I'd love for someone to explain to me what the "switch" button is supposed to do on the Edit words or phrases page. When I click this, it creates a en_local_local folder. Argh!!!

In reply to Brian Maynes

Re: Languages are making me crazy!

by Brian Maynes -

OK...I figured out my problem. I had completely spaced the fact that there is a "lang" column in the mdl_user table. I had this set to "en_local" for all users, which is why Moodle kept storing my lang changes in the "en_local" folder. Updating this field to "en_us_utf8" solved my problem. Now all my language string changes are being written to the \moodledata\lang\en_us_utf8 folder as they should be.

Now I only have 1 custom language folder in my \moodledata\lang folder called "en_us_utf8".

Embarassed. blush

In reply to Brian Maynes

Re: Languages are making me crazy!

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Hi Brian,

good to hear you are OK now. Just to explain your question
"Also, I'd love for someone to explain to me what the "switch" button is supposed to do on the Edit words or phrases page. When I click this, it creates a en_local_local folder."

When you edit string on the Edit words or phrases page, your changes are saved in moodledata\lang\en_us_utf8 by default. You can switch this location to moodledata\lang\en_us_utf8_local (i.e. "current_language_code"+"_local") by pressing the button, if you want to do just some small customizations of this package. Bacause you had en_local set as current language, the switch button created strange language pack en_local_local.