Redesign Your Town

Urban Regeneration in Four European Countries

User Tools

Site Tools


wiki_plugin_development

Translate Plugin Development

In order to make the wiki easier to use, I've developed a new dokuwiki plugin whitch I'm going to introduce you. As you know, In the wiki there is a page for glossaries where students translate common words for different situations. Then, they record themselves saying that words so the rest can hear the correct pronunciation. And lastly, they edit the glossaries and use a special tag (mp3play) to insert the sound player. That is really cool and useful, but we needed to do something more interactive.

The idea was to allow the editors of the page to use a new tag in the wiki editor, just as they use one to insert the sound. But this one will work different. Maybe yoy have seen some pages where, if you place the mouse over some word or content, a small tooltip is showed with useful information (or not). That was what we wanted to do, but with the recoded translation instead of the info. That is to say, a tag that means a word in which you place the mouse over and a tooltip is shown with the recorded translation. And that is what I did.

The plugin is really easy to use. Just open a page for editing as you usually do, and write the tag with the following syntax:

{{translate>words||mp3_file}}

For the mp3 file, you must insert the direction just like with mp3play plugin. At the end, It will look like this

Hello
Hello:

:


Hello World!
Hello World!:


I've made a little video showing the process. It doesn't have audio, but I think It's self-explanatory.


When you're using the plugin is important to be careful. By desing, this plugin can't be included in things like headers. It will simply not work, or even It could break the page design. Always remember that the preview feature is your friend.


This is everything for now. I'm currently working to use the plugin for even more amazing things, but for the moment this is all I can show you. I hope you'll find it useful. See you soon.

By Ángel García Jiménez (Kamisama666)

TOP

wiki_plugin_development.txt · Last modified: 2014/10/15 22:38 by antony