Ejemplo n.º 1
0
        private static void LoadTranslators()
        {
            XmlDocument doc = new XmlDocument();

            doc.LoadXml(AssemblyResource.GetFileContents("translators.xml"));

            foreach (XmlNode node in doc.DocumentElement.ChildNodes)
            {
                if (node.Name != "language")
                {
                    continue;
                }

                try {
                    string language_code = node.Attributes["code"].Value.Trim();
                    string language_name = node.Attributes["name"].Value.Trim();

                    ProductTranslation translation = new ProductTranslation(language_code, language_name);

                    foreach (XmlNode person in node.ChildNodes)
                    {
                        if (person.Name != "person")
                        {
                            continue;
                        }

                        translation.AddTranslator(person.FirstChild.Value.Trim());
                    }

                    translations.Add(language_name, translation);
                } catch {
                }
            }
        }
Ejemplo n.º 2
0
        private static void LoadTranslators()
        {
            XmlDocument doc = new XmlDocument ();
            doc.LoadXml (AssemblyResource.GetFileContents ("translators.xml"));

            foreach (XmlNode node in doc.DocumentElement.ChildNodes) {
                if (node.Name != "language") {
                    continue;
                }

                try {
                    string language_code = node.Attributes["code"].Value.Trim ();
                    string language_name = node.Attributes["name"].Value.Trim ();

                    ProductTranslation translation = new ProductTranslation (language_code, language_name);

                    foreach (XmlNode person in node.ChildNodes) {
                        if (person.Name != "person") {
                            continue;
                        }

                        translation.AddTranslator (person.FirstChild.Value.Trim ());
                    }

                    translations.Add (language_name, translation);
                } catch {
                }
            }
        }