|
Design
This is basic design document for the Plug-in IntroductionAny Chat Client which has support for plug-ins can be provided this language translation feature. Lingua-Franca plug-in would be basically a shared Object file or a dll file with core functions being There are four basic modules in the plug-in Chat Client Specific ModuleSkeleton of the chat client specific code would be Note The above design is highly specific to pidgin , more generic design will be made once we are ready to develop for other chat clients Plug-in Specific ModulesPlug-in has three modules User Interface
This can be got from the layer above , i.e from Chat Client API. This can be got from the XML Helper This can be got from the XML Helper The directory path to preferences XML Core Translation Module
char *lf_translate_outgoing_mesg(char *mesg,char *buddy)
{
char *to_lang ;
char *from_lang;
char *translated_mesg;
/* determine outgoing language preference for this buddy*/
to = get_lang_pref(buddy)
/* determine the language of the "mesg" */
from = determine_lang(mesg)
/* call the core translate method */
translated_mesg = translate (mesg,from ,to);
} char *lf_translate_incoming_mesg(char *mesg,char *buddy)
{
char *to_lang ;
char *from_lang;
char *translated_mesg;
/* determine incoming language preference */
to = get_incoming_lang_pref()
/* determine the language of the "mesg" */
from = determine_lang(mesg)
/* call the core translate method */
translated_mesg = translate (mesg,from ,to);
}char *translate(char *mesg,char *to, char *from) char *determine_lang(char *mesg)
{
List avail_translations;
char *translated_mesg;
while ( list->next != NULL)
{
avail = list->avail;
translated_mesg = translate(mesg,avail->from,avail->to);
if (strcmp(mesg,translated_mesg) !=0)
{
printf("Translation Available");
return avail->from;
}
}
return "NA";
}XML Helper ModuleThis module basically does the required XML processing , it has two sub modules
The User Preferences will be saved in an XML file , the DTD of this file will be soon given The translation service specific details are provided in an XML File , the DTD will be soon posted . |
Sign in to add a comment