gitktrans.c

Go to the documentation of this file.
00001 
00018 #define GITK_LIB_C
00019 #define GITK_TRANS_C
00020 
00021 #include "gitkincludes.h"
00022 
00023 
00032 gboolean gitk_dialog_trans_initial(GitkDialogPtr const dialog) {
00033   xmlDocPtr res;
00034 
00035   gitk_log_intro();
00036   /*
00037   gitk_log("  before domain");
00038   if((res=gitk_dialog_trans_domain(dialog->src))) {
00039     xmlFreeDoc(dialog->src);
00040     dialog->src=res;
00041     dialog->ns=xmlSearchNsByHref(res,xmlDocGetRootElement(res),(const xmlChar *)GITK_NS_URL);
00042   }
00043   else return(FALSE);
00044   gitk_log("  after domain");//gitk_dialog_dump(dialog->dst);
00045   */
00046   /*
00047   gitk_log("  before i18n");
00048   (void)gitk_dialog_trans_i18n(dialog->src);
00049   gitk_log("  after i18n");
00050   */
00051   gitk_log("  before callback");
00052   gitk_dialog_trans_callback(dialog);
00053   gitk_log("  after callback");
00054   //gitk_dialog_dump(dialog->src);
00055   gitk_log("  before expansion");
00056   if((res=gitk_dialog_trans_expand(dialog->src))) {
00057     xmlFreeDoc(dialog->src);
00058     dialog->src=res;
00059     dialog->ns=xmlSearchNsByHref(res,xmlDocGetRootElement(res),(const xmlChar *)GITK_NS_URL);
00060   }
00061   else return(FALSE);
00062   gitk_log("  after expansion");
00063   gitk_log_outro();
00064   return(TRUE);
00065 }
00066 
00067 
00074 gboolean gitk_dialog_trans(GitkDialogPtr const dialog) {
00075   xmlDocPtr res;
00076 
00077   gitk_log_intro();
00079   gitk_log("  before domain");
00080   if((res=gitk_dialog_trans_domain(dialog->src))) {
00081     dialog->dst=res;
00082     dialog->ns=xmlSearchNsByHref(res,xmlDocGetRootElement(res),(const xmlChar *)GITK_NS_URL);
00083   }
00084   else return(FALSE);
00085   gitk_log("  after domain");//gitk_dialog_dump(dialog->dst);
00086   gitk_log("  before style");
00087   if((res=gitk_dialog_trans_style(dialog->dst))) {
00088   //if((res=gitk_dialog_trans_style(dialog->src))) {
00089     xmlFreeDoc(dialog->dst);
00090     dialog->dst=res;
00091     dialog->ns=xmlSearchNsByHref(res,xmlDocGetRootElement(res),(const xmlChar *)GITK_NS_URL);
00092   }
00093   else return(FALSE);
00094   gitk_log("  after style");//gitk_dialog_dump(dialog->dst);
00095 
00096   //-- do these as the last ones, so that nodes created during the transformation are translated as well
00097 
00098   gitk_log("  before i18n");
00099   if((res=gitk_dialog_trans_i18n(dialog->dst))) {
00100     // res==dialog->dst
00101     //xmlFreeDoc(dialog->dst);
00102     //dialog->dst=res;
00103     //dialog->ns=xmlSearchNsByHref(res,xmlDocGetRootElement(res),(const xmlChar *)GITK_NS_URL);
00104   }
00105   else return(FALSE);
00106   gitk_log("  after i18n");
00107   //gitk_dialog_dump(dialog->dst);
00108   gitk_log("  before expansion");
00109   if((res=gitk_dialog_trans_expand(dialog->dst))) {
00110     xmlFreeDoc(dialog->dst);
00111     dialog->dst=res;
00112     dialog->ns=xmlSearchNsByHref(res,xmlDocGetRootElement(res),(const xmlChar *)GITK_NS_URL);
00113   }
00114   else return(FALSE);
00115   gitk_log("  after expansion");
00116   gitk_log_outro();
00117   return(TRUE);
00118 }

Generated on Thu Oct 28 10:59:15 2004 for gitk by doxygen 1.3.6