Translation problem in module

Translation problem in module

by Serafim Panov -
Number of replies: 7

Hello!


I've strange problem with my module after updating moodle to 2.7 

I see [maximumsize] and [allowdeleting]

I see this even after adding new lines in my lang/en/module.php file:

$string['maximumsize'] = 'Max size';

$string['allowdeleting'] = 'Allow Deleting';


translation problem with my module


Where is the problem?

Average of ratings: -
In reply to Serafim Panov

Re: Translation problem in module

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

Please try to purge caches. if it helps, let me recommend to put the following line into your config.php at your development machine:

$CFG->langstringcache = false;
In reply to David Mudrák

Re: Translation problem in module

by Serafim Panov -

It is doesn't help. Maybe need to change my language file location? current location: "module/lang/en/module.php"

In reply to Serafim Panov

Re: Translation problem in module

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
What is your plugin type and plugin name? For all plugins, the expected location is lang/en/plugintype_pluginname.php. Only activity modules (plugintype 'mod') are exception as they use lang/en/pluginname.php for legacy reasons.
In reply to David Mudrák

Re: Translation problem in module

by Serafim Panov -

I'm making videoboard version for moodle 2.7. It is moodle module. But I can't solve this issue and can't understand why. I've attached my current lang file. New lines at the end of file.


https://github.com/spnova/videoboard

In reply to Serafim Panov

Re: Translation problem in module

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

OK. Make sure the get_string() call reads

get_string('maximumsize', 'videoboard')

or even better try to commit the version that does not work for you to a separate branch in your repository so we can see it in context. And turn the debugging mode to DEBUG_DEVELOPER and let those debug messages be displayed. It reports useful information on missing strings (such as expected location).