public static void TranslateProject(string apikey, string project_path, TranslatorDefinition transdef, Language sourceLanguage)
        {
            AndroidProject project = new AndroidProject(project_path);
            ResourceTranslator rt = new ResourceTranslator(project, transdef.CreateInstance(apikey), sourceLanguage);

            rt.TranslateProject();
        }
        public static void TranslateProject(string apikey, string project_path, TranslatorDefinition transdef, Language sourceLanguage)
        {
            AndroidProject     project = new AndroidProject(project_path);
            ResourceTranslator rt      = new ResourceTranslator(project, transdef.CreateInstance(apikey), sourceLanguage);

            rt.TranslateProject();
        }
        public Program()
        {
            //Set the UI to the specified culture.
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(_culturename);

            //Create the XslTransform and load the stylesheet.
            //XslTransform xslt = new XslTransform();
            XslCompiledTransform xslt = new XslCompiledTransform();
            xslt.Load(_stylesheet);

            //Load the XML data file.
            XPathDocument doc = new XPathDocument(_filename);

            //Create an XsltArgumentList.
            XsltArgumentList xslArg = new XsltArgumentList();

            //Add an object to get the resources for the specified language.
            ResourceTranslator resTran = new ResourceTranslator("Resources.Resource");
            xslArg.AddExtensionObject("urn:myResTran", resTran);

            //Add an object to calculate the circumference of the circle.
            Calculate obj = new Calculate();
            xslArg.AddExtensionObject("urn:myObj", obj);

            //Create an XmlTextWriter to output to the console.
            XmlTextWriter writer = new XmlTextWriter(Console.Out);

            //Transform the file.
            xslt.Transform(doc, xslArg, writer, null);

            writer.Close();
        }
Example #4
0
        /// <summary>
        /// Creates a new language manager
        /// </summary>
        /// <param name="langle">The language</param>
        public Babel(SupportedLanguage langle, ResourceTranslator translator)
        {
            this.Langle = langle;
            CultureInfo ci = this.Culture;

            Assets.Strings.Culture = ci;
            translator(ci);
        }