插件过滤器

Content translation filter (superseded)

filter_fulltranslateMoodle HQ

  • Moodle 1.9–5.1
  • 更新 2021-02-04

The Content translation filter provided a way to quickly translate the content of Moodle courses into different languages. Please now use the new plugin as it maintains translations when the original language content is updated and has many other improvements, but works largely the same way than this plugin did! it’s coming soon to the Moodle plugins database, but available now on github: https://github.com/andrewhancox/moodle-filter_translations
Please use the  new, improved plugin instead .
The filter should be placed as the first filter in the filter stack.
The filter parses and processes every piece of content including HTML texts and heading.
For each content item: If the current language is English, then the original text is returned untouched. Else hash the full original text as the HASHKEY to look into the translation database table.
If the key is found, then look for a translation in the current language. If the translation exists, then return the translation text Else get a translation using Google Translate API and store the result in the table, then return it.
Else the key was not found (it’s a new string), so create a new entry in the table, then get an automatic translation using a translate API, and store the result in the table, then return it.
In this way, the entire database table can be populated with English and other languages  simply by viewing the entire courses with the interface set to those languages.
The (undoubtedly imperfect) Google translations can be cleaned up using the Content translation manager tool.

返回插件目录