Language customizations lost on upgrade

Language customizations lost on upgrade

by James Mackinnon -
Number of replies: 3

Hi all,

I've been running a test upgrade of a Moodle 1.9 site to 2.2, and it appears that the language customizations are lost. Looking in the moodledata dir, the "lang" dir gets renamed to "oldlang" and nothing seems to be moved across. Is this expected behaviour, or am I doing something wrong?

Thanks for any help!

In reply to James Mackinnon

Re: Language customizations lost on upgrade

by David Mudrák -
Core developers की तस्वीर Documentation writers की तस्वीर Moodle HQ की तस्वीर Particularly helpful Moodlers की तस्वीर Peer reviewers की तस्वीर Plugin developers की तस्वीर Plugins guardians की तस्वीर Testers की तस्वीर Translators की तस्वीर
Yes, this is expected behaviour. The upgrade process just renames the directory with your local modifications of the language pack but you have to prepare the correct syntax for the local string files for 2.x manually (alternatively you can re-edit them via the inbuilt tool that saves them in correct syntax).

Note there are several differences in how strings are formatted in 1.x and 2.x, most notably in the $a placeholders handling (must be wrapped in curly braces in 2.x) and no more exceptions for the percentual sign (no more need to have %% in 2.x to display %).

Hope this helps.
In reply to David Mudrák

Re: Language customizations lost on upgrade

by Séverin Terrier -
Documentation writers की तस्वीर Particularly helpful Moodlers की तस्वीर Testers की तस्वीर Translators की तस्वीर

Hi David,

A related question, just to be sure : this is the case when upgrading from 1.9 to 2.x !

But, if you upgrade from 2.0 to 2.2 (for example), do you loose your local modifications (or not, because files are defined the same way) ?

In reply to Séverin Terrier

Re: Language customizations lost on upgrade

by David Mudrák -
Core developers की तस्वीर Documentation writers की तस्वीर Moodle HQ की तस्वीर Particularly helpful Moodlers की तस्वीर Peer reviewers की तस्वीर Plugin developers की तस्वीर Plugins guardians की तस्वीर Testers की तस्वीर Translators की तस्वीर

This just affects upgrades from 1.9 to 2.x because there was the syntax change. During the upgrade from 2.x to 2.y, the local customizations are not lost.

By the way, if somebody is interested, there is a method in AMOS code that is able to convert strings from 1.x format to 2.x one. Some volunteer might want to use it as a start point for writing a tiny script that would convert all _local packs from 1.x to the new format. See the fix_syntax() definition at https://github.com/moodlehq/moodle-local_amos/blob/master/mlanglib.php#L642