예제 #1
0
파일: PoFile.cs 프로젝트: exectails/nettext
        public void ReadTestDePartially()
        {
            var po = new PoFile();
            po.LoadFromFile("../../Files/de-partially.po");

            Assert.Equal("Datei", po.GetString("File"));
            Assert.Equal("File", po.GetParticularString("some context", "File"));
            Assert.Equal("{0} Datei", po.GetPluralString("{0} file", "{0} files", 1));
            Assert.Equal("{0} files", po.GetPluralString("{0} file", "{0} files", 5));
            Assert.Equal("{0} file", po.GetParticularPluralString("some context", "{0} file", "{0} files", 1));
            Assert.Equal("{0} Dateien", po.GetParticularPluralString("some context", "{0} file", "{0} files", 5));
        }
예제 #2
0
파일: PoFile.cs 프로젝트: xyfc/nettext
        public void ReadTestDePartially()
        {
            var po = new PoFile();

            po.LoadFromFile("../../Files/de-partially.po");

            Assert.Equal("Datei", po.GetString("File"));
            Assert.Equal("File", po.GetParticularString("some context", "File"));
            Assert.Equal("{0} Datei", po.GetPluralString("{0} file", "{0} files", 1));
            Assert.Equal("{0} files", po.GetPluralString("{0} file", "{0} files", 5));
            Assert.Equal("{0} file", po.GetParticularPluralString("some context", "{0} file", "{0} files", 1));
            Assert.Equal("{0} Dateien", po.GetParticularPluralString("some context", "{0} file", "{0} files", 5));
        }
예제 #3
0
파일: PoFile.cs 프로젝트: xyfc/nettext
        public void ReadTestPlPartially()
        {
            var po = new PoFile();

            po.LoadFromFile("../../Files/pl-partially.po");

            Assert.Equal("plik", po.GetString("File"));
            Assert.Equal("File", po.GetParticularString("some context", "File"));
            Assert.Equal("{0} file", po.GetPluralString("{0} file", "{0} files", 1));
            Assert.Equal("{0} pliki", po.GetPluralString("{0} file", "{0} files", 2));
            Assert.Equal("{0} files", po.GetPluralString("{0} file", "{0} files", 5));
            Assert.Equal("{0} plik", po.GetParticularPluralString("some context", "{0} file", "{0} files", 1));
            Assert.Equal("{0} files", po.GetParticularPluralString("some context", "{0} file", "{0} files", 2));
            Assert.Equal("{0} pliko'w", po.GetParticularPluralString("some context", "{0} file", "{0} files", 5));
        }
예제 #4
0
파일: PoFile.cs 프로젝트: xyfc/nettext
        public void ReadTestDeUntranslated()
        {
            var po = new PoFile();

            po.LoadFromFile("../../Files/de-untranslated.po");

            Assert.Equal("File", po.GetString("File"));
            Assert.Equal("File", po.GetParticularString("some context", "File"));
            Assert.Equal("{0} file", po.GetPluralString("{0} file", "{0} files", 1));
            Assert.Equal("{0} files", po.GetPluralString("{0} file", "{0} files", 5));
            Assert.Equal("{0} files", po.GetParticularPluralString("some context", "{0} file", "{0} files", 5));
        }
예제 #5
0
파일: PoFile.cs 프로젝트: xyfc/nettext
        public void ReadTestRu()
        {
            var po = new PoFile();

            po.LoadFromFile("../../Files/ru.po");

            Assert.Equal("Файл", po.GetString("File"));
            Assert.Equal("Файл", po.GetParticularString("some context", "File"));
            Assert.Equal("{0} Файл", po.GetPluralString("{0} file", "{0} files", 1));
            Assert.Equal("{0} Файла", po.GetPluralString("{0} file", "{0} files", 2));
            Assert.Equal("{0} Файлов", po.GetPluralString("{0} file", "{0} files", 5));
            Assert.Equal("{0} Файлов", po.GetParticularPluralString("some context", "{0} file", "{0} files", 5));
        }
예제 #6
0
 /// <summary>
 /// Returns translated string in context as singular or plural,
 /// based on n, or id/id_plural if no translated version of id exists.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="id"></param>
 /// <returns></returns>
 public static string GetParticularPlural(string context, string id, string id_plural, int n)
 {
     return(_catalog.GetParticularPluralString(context, id, id_plural, n));
 }
예제 #7
0
파일: PoFile.cs 프로젝트: exectails/nettext
        public void ReadTestPl()
        {
            var po = new PoFile();
            po.LoadFromFile("../../Files/pl.po");

            Assert.Equal("plik", po.GetString("File"));
            Assert.Equal("plik", po.GetParticularString("some context", "File"));
            Assert.Equal("{0} plik", po.GetPluralString("{0} file", "{0} files", 1));
            Assert.Equal("{0} pliki", po.GetPluralString("{0} file", "{0} files", 2));
            Assert.Equal("{0} pliko'w", po.GetPluralString("{0} file", "{0} files", 5));
            Assert.Equal("{0} pliko'w", po.GetParticularPluralString("some context", "{0} file", "{0} files", 5));
        }
예제 #8
0
파일: PoFile.cs 프로젝트: exectails/nettext
        public void ReadTestDeUntranslated()
        {
            var po = new PoFile();
            po.LoadFromFile("../../Files/de-untranslated.po");

            Assert.Equal("File", po.GetString("File"));
            Assert.Equal("File", po.GetParticularString("some context", "File"));
            Assert.Equal("{0} file", po.GetPluralString("{0} file", "{0} files", 1));
            Assert.Equal("{0} files", po.GetPluralString("{0} file", "{0} files", 5));
            Assert.Equal("{0} files", po.GetParticularPluralString("some context", "{0} file", "{0} files", 5));
        }
예제 #9
0
파일: PoFile.cs 프로젝트: exectails/nettext
        public void ReadTestRu()
        {
            var po = new PoFile();
            po.LoadFromFile("../../Files/ru.po");

            Assert.Equal("Файл", po.GetString("File"));
            Assert.Equal("Файл", po.GetParticularString("some context", "File"));
            Assert.Equal("{0} Файл", po.GetPluralString("{0} file", "{0} files", 1));
            Assert.Equal("{0} Файла", po.GetPluralString("{0} file", "{0} files", 2));
            Assert.Equal("{0} Файлов", po.GetPluralString("{0} file", "{0} files", 5));
            Assert.Equal("{0} Файлов", po.GetParticularPluralString("some context", "{0} file", "{0} files", 5));
        }