If you modify a lang string of a plugin a new local lang file is created or an existing one is updated. In both cases a local lang file does exist in "<moodledata>/lang/<lang>_local/".
On the start of editing the lang string, in the database the tables "tool_customlang" and "tool_customlang_components" are filled with infos about all installed plugins.
Everything is fine so far.
If you uninstall the plugin now, nothing will be cleaned up. This means that all database entries and also the files remain untouched.
In some cases a debug message is created:
Unable to find the filename for the component theme_klass
- line 269 of \admin\tool\customlang\locallib.php: call to debugging()
- line 232 of \admin\tool\customlang\locallib.php: call to tool_customlang_utils::dump_strings()
- line 93 of \admin\tool\customlang\index.php: call to tool_customlang_utils::checkin()
To reproduce this the following steps must be done:
- You need access to the database tables of the moodle installation.
- Enable debugging for developers
- Install some plugin which defines at least one lang string
- Go to Site administration / language / language customisation
- Choose a language e.g. "English"
- Modify a lang string from the plugin you just installed before.
- Now you can find all plugins including this plugin in the table "tool_customlang_components" and all original lang identifiers and strings in the table "tool_customlang".
- In <moodledata>/lang/en_local/ is a file <pluginname>.php
- Uninstall the plugin.
- The database records and the local lang file still exist.
- Remove the local lang file
- Modify some other lang string from some other plugin from the English lang strings.
- After saving the modifications the debug message appears.
In my opinion, some kind of cleanup should be done. I think there are two possibilities to do that:
- The plugin manager removes the garbage for each plugin while it is uninstalled
- The plugin itself removes this stuff in a hook function