Пример #1
0
        /// <summary>
        /// Returns a StringArray with all string not in
        /// arr.
        /// </summary>
        public StringArray GetStringsNotIn(StringArray arr)
        {
            StringArray ret = new StringArray();

            foreach (StringItem item in strings)
            {
                if (item.Id != 6)               // "XBMC SVN"
                {
                    StringItem stringItem = null;
                    arr.GetStringById(item.Id, ref stringItem);
                    if (stringItem == null)
                    {
                        ret.Add(item);
                    }
                }
            }

            return(ret);
        }
Пример #2
0
        /// <summary>
        /// Save the current language file
        /// </summary>
        public void Save()
        {
            StringArray strings = new StringArray();

            enumerator = TranslatorArrayEnumerator.All;
            foreach (TranslatorItem item in this)
            {
                if (item.State == TranslationState.Translated || item.State == TranslationState.Changed)
                {
                    strings.Add(item.StringTranslated);
                }
            }

            strings.Sort();

            ArrayList comments = new ArrayList();

            comments.Add("Language file translated with Team XBMC Translator");
            if (Settings.Instance.TranslatorName != "")
            {
                comments.Add("Translator: " + Settings.Instance.TranslatorName);
            }
            if (Settings.Instance.TranslatorEmail != "")
            {
                comments.Add("Email: " + Settings.Instance.TranslatorEmail);
            }

            DateTime time = DateTime.Now;

            comments.Add("Date of translation: " + time.GetDateTimeFormats(System.Globalization.CultureInfo.InvariantCulture)[0]);
            comments.Add("$" + "Revision" + "$");
            if (versionOriginal > 0.0)
            {
                comments.Add("Based on english strings version " + versionOriginal.ToString(System.Globalization.CultureInfo.InvariantCulture));
            }

            strings.Save(Settings.Instance.FilenameTranslated, (string[])comments.ToArray(typeof(string)));

            modified = false;
        }
Пример #3
0
        /// <summary>
        /// Returns a StringArray with all string not in
        /// arr.
        /// </summary>
        public StringArray GetStringsNotIn(StringArray arr)
        {
            StringArray ret=new StringArray();

            foreach (StringItem item in strings)
            {
                if (item.Id!=6) // "XBMC SVN"
                {
                    StringItem stringItem=null;
                    arr.GetStringById(item.Id, ref stringItem);
                    if (stringItem==null)
                        ret.Add(item);
                }
            }

            return ret;
        }
Пример #4
0
        /// <summary>
        /// Save the current language file
        /// </summary>
        public void Save()
        {
            StringArray strings=new StringArray();

            enumerator=TranslatorArrayEnumerator.All;
            foreach (TranslatorItem item in this)
            {
                if (item.State==TranslationState.Translated || item.State==TranslationState.Changed)
                    strings.Add(item.StringTranslated);
            }

            strings.Sort();

            ArrayList comments=new ArrayList();
            comments.Add("Language file translated with Team XBMC Translator");
            if (Settings.Instance.TranslatorName!="")
                comments.Add("Translator: "+Settings.Instance.TranslatorName);
            if (Settings.Instance.TranslatorEmail!="")
                comments.Add("Email: "+Settings.Instance.TranslatorEmail);

            DateTime time=DateTime.Now;
            comments.Add("Date of translation: "+time.GetDateTimeFormats(System.Globalization.CultureInfo.InvariantCulture)[0]);
            comments.Add("$"+"Revision"+"$");
            if (versionOriginal>0.0)
                comments.Add("Based on english strings version "+versionOriginal.ToString(System.Globalization.CultureInfo.InvariantCulture));

            strings.Save(Settings.Instance.FilenameTranslated, (string[])comments.ToArray(typeof(string)));

            modified=false;
        }