Exemplo n.º 1
0
 public void PoProxy_PoFilesInCommonFolder_EachPoFileHasLanguageName()
 {
     foreach (string file in Directory.GetFiles(BasilProject.ApplicationCommonDirectory, "*.po"))
     {
         var poProxy = new ConfigTool.InterfaceLanguageControl.PoProxy(file);
         Assert.IsNotEmpty(poProxy.ToString(), String.Format("Could not extract language name from po file: {0}", file));
     }
 }
Exemplo n.º 2
0
        public void PoProxy_TransifexStyleLanguageTeamLinePresent_FindsValidLanguageString()
        {
            string contents = @"
# An additional comment
'Language-Team: Spanish <*****@*****.**>\n'
".Replace("'", "\"");

            using (var tempFile = new TempFile(contents))
            {
                var poProxy = new ConfigTool.InterfaceLanguageControl.PoProxy(tempFile.Path);
                Assert.AreEqual("Spanish", poProxy.ToString());
            }
        }
Exemplo n.º 3
0
        public void PoProxy_LegacyStyleTranslationLinePresent_FindsValidLanguageString()
        {
            string contents = @"
# Spanish translation for wesay
# An additional comment
".Replace("'", "\"");

            using (var tempFile = new TempFile(contents))
            {
                var poProxy = new ConfigTool.InterfaceLanguageControl.PoProxy(tempFile.Path);
                Assert.IsNotEmpty(poProxy.ToString());
            }
        }