Language packs and migration to UTF-8

Language packs and migration to UTF-8

autor N Hansen -
Počet odpovědí: 23
Note that if you have an existing installation with a non UTF-8 language pack, you shouldn't download and install a UTF8 language pack before migrating the database.

I
Is there somewhere one can find step-by-step instructions on how to handle languages when upgrading to 1.6? I don't find anything in the documentation.

Průměr hodnocení: -
V odpovědi na N Hansen

Re: Moodle 1.6 no Polish language pack in the language import utility

autor koen roggemans -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Moodle HQ Obrázek: Particularly helpful Moodlers Obrázek: Plugin developers Obrázek: Translators
Here you are Nicole. If you miss something ... it's a wiki.

http://docs.moodle.org/en/Upgrading_to_Moodle_1.6
V odpovědi na koen roggemans

Re: Moodle 1.6 no Polish language pack in the language import utility

autor N Hansen -
Thanks-But there is still one thing that isn't clear to me. Language packs are now in the Moodle folder in 1.5, but I thought they were supposed to be moved to the Moodledata folder in 1.6. My question is when in this whole upgrade process is one to place those langauge packs in the Moodledata folder? Before upgrading to 1.6, between upgrading to 1.6 and running the UTF-8 conversion, or after the UTF-8 conversion?
V odpovědi na N Hansen

Re: Moodle 1.6 no Polish language pack in the language import utility

autor koen roggemans -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Moodle HQ Obrázek: Particularly helpful Moodlers Obrázek: Plugin developers Obrázek: Translators
From http://docs.moodle.org/en/Upgrading_to_Moodle_1.6:

After the migration of the database, you may go to Administration >> Configuration >> Language and follow the 'Language import utility' link. You may select the desired language packs on the right pane and install them directly.

So It's after the migration. The point is that there is only one enconding possible to display on a page. So, when you have just upgraded to 1.6, your site is running in English, since there are no encoding problems in English ( ISO chars = UTF8 chars)
For most languages it is not possible to use the utf8 language pack in this state, because in that case, the data is in some encoding, while the interface is in utf8 and on the same page! So first thing to do is to convert the data to utf8 (=database migration) so the data is in utf8, and then install the non-english utf8 language packs, so interface and data are in the same encoding again.
If you don't want to migrate the database, you are stuck with the old 1.5 language packs, which are still supposed to work, but this is not a recommended configuration.
V odpovědi na koen roggemans

Re: Moodle 1.6 no Polish language pack in the language import utility

autor N Hansen -
Koen-I don't think I made myself clear enough. I'm not asking when one should go through the language upgrade process, but WHERE one should put the language packs and WHEN one should put them there.
V odpovědi na N Hansen

Re: Moodle 1.6 no Polish language pack in the language import utility

autor koen roggemans -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Moodle HQ Obrázek: Particularly helpful Moodlers Obrázek: Plugin developers Obrázek: Translators
Sorry for the communication problems Nicole úsměv. I'll try to answer your question.

WHERE
  • You can let Moodle 1.6 download and install the language packs for you (we get really spoiled administrators cool), so you shouldn't care about the location (admin >> language).
  • Custom made new language packs go in moodledata/lang. They have to be in a xx_utf8 folder and should be utf8 encoded.
  • Localisations of an existing xx_utf8 language pack should be called xx_utf8_local should be utf8 encoded and should also be put in the moodledata/lang folder.
WHEN
  • You should always use a language pack that matches your database content:
    Upgraded installations: first migration, then utf8 langpacks
    New 1.6 installations: immediately use utf8 langpacks
I hope this sort things out.
V odpovědi na koen roggemans

Re: More Questions about UTF8 migration (was Moodle 1.6 no Polish language pack in the language import utility)

autor N Hansen -
It still isn't entirely clear. I think these forums are going to be full of complaints about double brackets in a few days if it isn't made clearer. I still have questions:

  1. Does en_UTF8 stay in the same place where language packs always have been? Or does it go in the moodledata folder too?
  2. How am I supposed to name a custom language pack that is now called something like en_oe (dependent on en_UTF8) when I convert it to UTF8?
  3. I still don't understand when exactly the shift of files to moodledata takes place. At the time of upgrade to 1.6 or at the time of UTF8 migration?
  4. I also have some more specific questions. I had a chance to do some testing of Unicode characters at test.moodle.com but without access to the before and after database I'm not sure what exactly was converted and how. How will the UTF8 conversion handle unicode characters currently stored in the database with html entitities like the following (I've put spaces between the characters so it doesn't render this): & # 7 7 1 7 ;
  5. How will it handle single unicode characters currently stored in the database with a string of odd characters like this (I'm assuming it makes this combination of characters because I am using an older version of MySQL): ṯ







V odpovědi na N Hansen

Re: More Questions about UTF8 migration

autor koen roggemans -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Moodle HQ Obrázek: Particularly helpful Moodlers Obrázek: Plugin developers Obrázek: Translators
Hi Nicole,
I added some more info to http://docs.moodle.org/en/Upgrading_to_Moodle_1.6 >> languages. Please check if 1 and 2 are clear.

3. I still don't understand when exactly the shift of files to moodledata takes place. At the time of upgrade to 1.6 or at the time of UTF8 migration?

It's easy: before migration, 1.6 behaves for languages as a 1.5, except for the location of the language files. The point is to do the upgrade and the migration in one go. Both processes will run in English, after that, everything is utf8. All language files except en_utf8 should be in moodledata/lang

4. I also have some more specific questions. I had a chance to do some testing of Unicode characters at test.moodle.com but without access to the before and after database I'm not sure what exactly was converted and how. How will the UTF8 conversion handle unicode characters currently stored in the database with html entitities like the following (I've put spaces between the characters so it doesn't render this): & # 7 7 1 7 ;

Not sure, but both will be displayed correctly

5. How will it handle single unicode characters currently stored in the database with a string of odd characters like this (I'm assuming it makes this combination of characters because I am using an older version of MySQL): ṯ

If you mean you have several unicode chars between other chars, it wil never be displayed correctly, unless it is in English and the page encoding is already UTF8.
The mysql version is checked befor the migration. Make sure it is ok before you upgrade.
V odpovědi na koen roggemans

Re: More Questions about UTF8 migration

autor N Hansen -
It's easy: before migration, 1.6 behaves for languages as a 1.5, except for the location of the language files. The point is to do the upgrade and the migration in one go. Both processes will run in English, after that, everything is utf8. All language files except en_utf8 should be in moodledata/lang

This is not entirely true. I have upgraded to 1.6, but due to other issues I still need to test, I have not converted the database. Now, without having performed the conversion, if a course is set to a custom language since 1.5, say en_oe, it still shows en_oe strings, even though the language pack is NOT in moodledata/lang and still is in the moodle/lang folder. However, I cannot get any languages on the dropdown lists of languages for the site. It is completely empty. If I put en_oe or any other language pack in moodledata/lang, they still do not show up on the dropdown list. It's not just me as the previous post in this thread reported the same problem. I've been going crazy over this because I have read all the instructions and still have not figured out what is wrong because I have not found any instructions that clearly explain how to handle the upgrade of language packs from 1.5 to 1.6 pre-migration.
V odpovědi na koen roggemans

local languages in UTF-8

autor Juan Marín -
I post this comment in the wiki page (http://docs.moodle.org/en/Upgrading_to_Moodle_1.6)


== local languages in UTF-8==

It is clear that new moodle "speaks" utf-8, but how could I edit/create utf-8 php pages? That says, If I want to customize/edit the es-utf-8/moodle.php, how do i do it? if I use notepad or other word processors, the spanish characters like á, é, ñ... aren't available and if I put them in the page, moodle shows them as extrange characters.
I suppouse I need a traslator program between Utf-8 and iso-latin Wich?
V odpovědi na Juan Marín

Re: local languages in UTF-8

autor Juan Marín -
I reply to myself...
one solution is to use emacs as text editor en Windows systems. This program automatically recognices the encoding character set (utf-8, iso-latin....) and fix my problem.approve
V odpovědi na Juan Marín

Re: local languages in UTF-8

autor koen roggemans -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Moodle HQ Obrázek: Particularly helpful Moodlers Obrázek: Plugin developers Obrázek: Translators
The easyest sollution is to use the build in Moodle language editor: it also makes sure you don't forget any ; ' \ and other nasty symbols mrknout
V odpovědi na koen roggemans

Re: local languages in UTF-8

autor Sigurdur Jonsson -
Has there been any change made to the built in language editor in Moodle 1.6? I'm getting the same functionality as in 1.5 and I'm not sure how it makes sure I don't forget any symbols.

regards,
S.Fjalar
V odpovědi na Sigurdur Jonsson

Re: local languages in UTF-8

autor koen roggemans -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Moodle HQ Obrázek: Particularly helpful Moodlers Obrázek: Plugin developers Obrázek: Translators
Basicaly you should do the imput just like the shown English wording. Things like the $a, with or without quotes, occasionally a html tag etc, you just copy. You shouldn't add any other characters to escape. The language tool takes care of that (but is doing that already a few years mrknout ). New is that it now saves everything always in UTF8 characterset.
V odpovědi na koen roggemans

Re: local languages in UTF-8

autor Ahmed Metwally -

Hi guys,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I desperately need help, I upgraded my moodle from 1.6dev to 1.6.1 and database has been migrated. But all my Arabic courses after the Unicode has been applied became rubbish, I can not read any word, it looks like this ÇáÞÇåÑÉ ãÔÑæÚ ÇáÊÚáã . So is there any solution to retrieve these courses or to cancel that upgrade. Pleas save me.

 

Thank u in advance,

V odpovědi na Ahmed Metwally

Re: local languages in UTF-8

autor koen roggemans -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Moodle HQ Obrázek: Particularly helpful Moodlers Obrázek: Plugin developers Obrázek: Translators
It is very difficult to say something sensible about an upgrade from a 1.6dev installation. Since you started of from a developement version, there could even have been something wrong with the initial installation.
If you want to go back after a database migration, there is no other way then restoring a backup of your database and restoring your 1.6dev program files.

Once you have restored your Moodle to the former working state, we might find what went wrong. In which encoding was your 1.6 running before you ran the migration? (search for charset in the source of a webpage of your Moodle)
V odpovědi na koen roggemans

Re: local languages in UTF-8

autor Ahmed Metwally -

Thank u so much for repling. Unfortunately, I just backed up the moodledata folder. Do you think is it possible to restore the courses? Sorry I'm newbie somewhat in moodle. The last encoding was Arabic (windows) charset=windows-1256

Thanks

V odpovědi na Ahmed Metwally

Re: local languages in UTF-8

autor N Hansen -
Dr. Ahmed-There are two possible solutions. First of all, if you are with a hosting company they may have made a daily or weekly backup of your site at some point recently that could be restored. Secondly, the letters you showed look a lot like what you sometimes see on an Arabic Web site where the encoding of the browser is not compatible. I would check the database itself to see whether the same characters are there or not. In any case, the strange characters probably each correspond to a single Arabic letter and if worse came to worse you could probably do some kind of find and replace.
V odpovědi na Ahmed Metwally

Re: local languages in UTF-8

autor koen roggemans -
Obrázek: Core developers Obrázek: Documentation writers Obrázek: Moodle HQ Obrázek: Particularly helpful Moodlers Obrázek: Plugin developers Obrázek: Translators
If you had scheduled backup installed, you can find a backup of each course in your moodledata/nn/backupdata.

Can you check with phpmyadmin if your database is set to utf8?
Is the migration button disappeared from your admin page?

I tried to work out whether your data is utf8 and not shown correctly or windows-1256 and shown as if it was utf8 and it is the latter.
Your data is still in windows-1256 and your moodle shows it as utf8

Somehow your migration script went wrong (or didn't finish)
Is there only Arab on your site (English is also allowed mrknout ) ?
V odpovědi na koen roggemans

Re: local languages in UTF-8

autor Ahmed Metwally -

Dears Nicole and  Koen,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks a lot for your help.

No this moodle is under windows XP and installed on a pc to work through intranet in order for training the university staff members. Database encoding is UTF-8 and when I checked the encoding  through the internet explorer, it was also UTF-8 and when I changed it to Arabic (windows) the strange letters remained (it changed a little but still in the same unreadable shape) which shows that the encoding is indeed UTF-8. The migration button is sure not shown in the admin page. English is enabled and the English courses remained intact.

 

V odpovědi na Ahmed Metwally

Re: local languages in UTF-8

autor Charalambos Vrasidas -

hi ahmed,

even though o know nothing about databases, I followed james advice and went into the mysql database, selected the database that was set for moodle, and changed the collation for all tables to utf8_unicode_ci. I would always get ??????? for anything written in Greek in Moodle 1.6

I had to change all collations manually and it took me about 3 hours ... but now it works. I can show greek english and turkish no problem ... at least not yet ... as you know with these tech stuff, everything works fine, until it does not! : ) good luck

pambos

PS> James, thanks for the advice : )

 

V odpovědi na Charalambos Vrasidas

Re: Migration of languages in UTF-8

autor J. Chan -

Dear all,

Sorry that I forgot to put in ";" at the end of each paragraph for the scripts as described in my previous message at http://moodle.org/mod/forum/discuss.php?d=51827&parent=243937

The scripts has been modified and updated now. Perhaps I should rename it as migrationUTF8.sql

The script is for the purpose of migration of dbase to "set the default charset and the collation for the database to utf8". It could be used for most other languages, i.e. to make moodle display what you input --- all in "utf8_unicode_ci".

The script has, again, not been tested. I just copy and paste them.

However, for every new installations or upgrades of new modules or blocks, you have to enter phpMYAdmin, each time, to set the default charset and the collation for the database to utf8, as according to my previous message hereunder:

http://moodle.org/mod/forum/discuss.php?d=51827&parent=243870 

The above method is mainly for those who installed Moodle 1.6 or 1.6+ on a web host through the use of Fantastico in the C-panel.

Cheers

James

V odpovědi na J. Chan

Re: Migration of languages in UTF-8

autor Jeff Forssell -
I have a Moodle 1.6.1 on a Cpanel/fantastico host (Site ground). I was about to ask where one finds "phpMYAdmin" but I finally stumbled onto it myself. In case any other newbies are wondering:
In CPanel  chose "MySQL Databases" at the bottom of the page that opens you will find "phpMYAdmin".  Mine was already set to "utf8_unicode_ci" so that seems OK. I was surprised that "swedish" was already chosen but I suppose I'd made a choice earlier in CPanel.

What happens if I have a course in an 1.5.x Moodle that I've made a backup of and I try to make a copy on my 1.6.1 (on another site) by "restore"ing it. Will the Unicode translation be automatic?

Also: Scorm packages with unknown encoding I suppose are just distributed through Moodle without any translation.