Пример #1
0
        // ~~

        public virtual string BeenFound(
            TRANSLATION items_translation
            )
        {
            TRANSLATION
                result_translation = new TRANSLATION();

            result_translation.AddText(" sido encontrad");

            if (items_translation.Genre == GENRE.Female)
            {
                result_translation.AddText("a");
            }
            else
            {
                result_translation.AddText("o");
            }

            if (items_translation.IntegerQuantity > 1)
            {
                result_translation.AddText("s");
            }

            return(result_translation.Text);
        }
Пример #2
0
        // ~~

        public override string TheItemsHaveBeenFound(
            TRANSLATION items_translation
            )
        {
            TRANSLATION
                result_translation = new TRANSLATION();

            result_translation.AddText(TheItems(items_translation));
            result_translation.AddText(Have(items_translation));
            result_translation.AddText(BeenFound(items_translation));
            result_translation.AddText(".\n");

            return(result_translation.Text);
        }
Пример #3
0
        // ~~

        public virtual string Have(
            TRANSLATION items_translation
            )
        {
            TRANSLATION
                result_translation = new TRANSLATION();

            if (items_translation.IntegerQuantity <= 1)
            {
                result_translation.AddText(" ha");
            }
            else
            {
                result_translation.AddText(" han");
            }

            return(result_translation.Text);
        }
Пример #4
0
        // ~~

        public virtual string TestConditions(
            int value
            )
        {
            TRANSLATION
                result_translation = new TRANSLATION();

            result_translation.AddText(GetIntegerText(value));

            if (value < 0)
            {
                if (value < -20)
                {
                    result_translation.AddText(" < -20");
                }
                else if (value < -10)
                {
                    result_translation.AddText(" < -10");
                }
                else
                {
                    result_translation.AddText(" < 0");
                }
            }
            else if (value > 0)
            {
                if (value > 20)
                {
                    result_translation.AddText(" > 20");
                }
                else if (value > 10)
                {
                    result_translation.AddText(" > 10");
                }
                else
                {
                    result_translation.AddText(" > 0");
                }
            }
            else
            {
                result_translation.AddText(" = 0");
            }

            result_translation.AddText("\n");

            return(result_translation.Text);
        }
Пример #5
0
        // ~~

        public override string TheItems(
            TRANSLATION items_translation
            )
        {
            TRANSLATION
                result_translation = new TRANSLATION();

            if (items_translation.IntegerQuantity == 0)
            {
                if (items_translation.Genre == GENRE.Female)
                {
                    result_translation.AddText("Ninguna ");
                }
                else
                {
                    result_translation.AddText("Ningún ");
                }
            }
            else if (items_translation.IntegerQuantity == 1)
            {
                if (items_translation.Genre == GENRE.Female)
                {
                    result_translation.AddText("La ");
                }
                else
                {
                    result_translation.AddText("El ");
                }
            }
            else
            {
                if (items_translation.Genre == GENRE.Female)
                {
                    result_translation.AddText("Las ");
                }
                else
                {
                    result_translation.AddText("Los ");
                }

                result_translation.AddText(items_translation.Quantity);
                result_translation.AddText(" ");
            }

            result_translation.AddText(items_translation);

            return(result_translation.Text);
        }
Пример #6
0
        // ~~

        public override TRANSLATION Helmets(
            int count
            )
        {
            TRANSLATION
                result_translation = new TRANSLATION();

            if (count == 1)
            {
                result_translation.AddText("helmet");
            }
            else
            {
                result_translation.AddText("helmets");
            }

            result_translation.SetQuantity(count);

            return(result_translation);
        }
Пример #7
0
        // ~~

        public override TRANSLATION Swords(
            TRANSLATION count_translation
            )
        {
            TRANSLATION
                result_translation = new TRANSLATION();

            if (count_translation.GetEnglishCardinalPlurality() == PLURALITY.One)
            {
                result_translation.AddText("sword");
            }
            else
            {
                result_translation.AddText("swords");
            }

            result_translation.SetQuantity(count_translation.Quantity);

            return(result_translation);
        }
Пример #8
0
        // ~~

        public virtual string BeenFound(
            TRANSLATION items_translation
            )
        {
            TRANSLATION
                result_translation = new TRANSLATION();

            result_translation.AddText(" été trouvé");

            if (items_translation.Genre == GENRE.Female)
            {
                result_translation.AddText("e");
            }

            if (items_translation.IntegerQuantity > 1)
            {
                result_translation.AddText("s");
            }

            return(result_translation.Text);
        }
Пример #9
0
        // ~~

        public override TRANSLATION Swords(
            TRANSLATION count_translation
            )
        {
            TRANSLATION
                result_translation = new TRANSLATION();

            if (count_translation.IntegerQuantity <= 1)
            {
                result_translation.AddText("espada");
            }
            else
            {
                result_translation.AddText("espadas");
            }

            result_translation.SetQuantity(count_translation.Quantity);
            result_translation.SetGenre(GENRE.Female);

            return(result_translation);
        }
Пример #10
0
        // ~~

        public override TRANSLATION Helmets(
            int count
            )
        {
            TRANSLATION
                result_translation = new TRANSLATION();

            if (count <= 1)
            {
                result_translation.AddText("yelmo");
            }
            else
            {
                result_translation.AddText("yelmos");
            }

            result_translation.SetQuantity(count);
            result_translation.SetGenre(GENRE.Male);

            return(result_translation);
        }
Пример #11
0
        // ~~

        public override TRANSLATION Swords(
            TRANSLATION count_translation
            )
        {
            TRANSLATION
                result_translation = new TRANSLATION();

            if (count_translation.GetFrenchCardinalPlurality() == PLURALITY.One)
            {
                result_translation.AddText("épée");
            }
            else
            {
                result_translation.AddText("épées");
            }

            result_translation.SetQuantity(count_translation.Quantity);
            result_translation.SetGenre(GENRE.Female);

            return(result_translation);
        }
Пример #12
0
        // ~~

        public override string TheItems(
            TRANSLATION items_translation
            )
        {
            TRANSLATION
                result_translation = new TRANSLATION();

            if (items_translation.IntegerQuantity == 0)
            {
                result_translation.AddText("No ");
            }
            else if (items_translation.IntegerQuantity == 1)
            {
                result_translation.AddText("The ");
            }
            else
            {
                result_translation.AddText("The ");
                result_translation.AddText(items_translation.Quantity);
                result_translation.AddText(" ");
            }

            result_translation.AddText(items_translation);

            return(result_translation.Text);
        }
Пример #13
0
        // ~~

        public override string TheItems(
            TRANSLATION items_translation
            )
        {
            TRANSLATION
                result_translation = new TRANSLATION();

            if (items_translation.IntegerQuantity == 0)
            {
                if (items_translation.Genre == GENRE.Female)
                {
                    result_translation.AddText("Aucune ");
                }
                else
                {
                    result_translation.AddText("Aucun ");
                }
            }
            else if (items_translation.IntegerQuantity == 1)
            {
                if (HasFirstCharacter(GetLowerCase(items_translation.Text), "aâeéêèiîoôuû"))
                {
                    result_translation.AddText("L'");
                }
                else if (items_translation.Genre == GENRE.Female)
                {
                    result_translation.AddText("La ");
                }
                else
                {
                    result_translation.AddText("Le ");
                }
            }
            else
            {
                result_translation.AddText("Les ");
                result_translation.AddText(items_translation.Quantity);
                result_translation.AddText(" ");
            }

            result_translation.AddText(items_translation);

            return(result_translation.Text);
        }
Пример #14
0
        // ~~

        public override string TheItemsHaveBeenFound(
            TRANSLATION items_translation
            )
        {
            TRANSLATION
                result_translation = new TRANSLATION();

            result_translation.AddText(TheItems(items_translation));

            if (items_translation.IntegerQuantity == 1)
            {
                result_translation.AddText(" has");
            }
            else
            {
                result_translation.AddText(" have");
            }

            result_translation.AddText(" been found.\n");

            return(result_translation.Text);
        }
Пример #15
0
        // ~~

        public virtual string Dump(
            TRANSLATION this_translation
            )
        {
            TRANSLATION
                result_translation = new TRANSLATION();

            result_translation.AddText("\"" + this_translation.Text + "\" / \"" + this_translation.Quantity + "\" / '" + this_translation.GetQuantityFirstCharacter() + "' / ");

            if (this_translation.HasIntegerQuantity)
            {
                result_translation.AddText(GetIntegerText(this_translation.IntegerQuantity) + " / ");
            }

            if (this_translation.HasRealQuantity)
            {
                result_translation.AddText(GetRealText(this_translation.RealQuantity) + " / ");
            }

            result_translation.AddText(GetPluralityText(GetCardinalPlurality(this_translation)) + " / " + GetPluralityText(GetOrdinalPlurality(this_translation)) + " / " + GetGenreText(this_translation.Genre) + "\n");

            return(result_translation.Text);
        }
Пример #16
0
        // ~~

        public virtual string TestFunctions(
            )
        {
            bool
                opposite_boolean;
            int
                opposite_integer;
            double
                opposite_real;
            string
                opposite_string = "";
            TRANSLATION
                opposite_translation_translation = new TRANSLATION(),
                inverse_translation_translation  = new TRANSLATION(),
                result_translation = new TRANSLATION();

            opposite_boolean = GetOppositeBoolean(true);
            opposite_integer = GetOppositeInteger(1);
            opposite_real    = GetOppositeReal(1.0);
            opposite_string  = GetOppositeString("one");
            opposite_translation_translation = GetOppositeTranslation(new TRANSLATION("one", "1"));
            inverse_translation_translation  = GetInverseTranslation(new TRANSLATION("x", "1"));
            result_translation.AddText(GetBooleanText(opposite_boolean) + " / " + GetIntegerText(opposite_integer) + " / " + GetRealText(opposite_real) + " / " + opposite_string + " / " + opposite_translation_translation.Text + " / " + inverse_translation_translation.Text + "\n");
            result_translation.AddText(GetBooleanText(false) + " / " + GetBooleanText(true) + "\n");
            result_translation.AddText(GetIntegerText(-12, 4) + " / " + GetIntegerText(12, 4) + "\n");
            result_translation.AddText(GetIntegerText(-12) + " / " + GetRealText(-12.0, 0) + " / " + GetRealText(-12.0) + " / " + GetRealText(-12.0, 3) + " \n");
            result_translation.AddText(GetRealText(-12.3, 3, 3, '_') + " / " + GetRealText(-12.345) + " / " + GetRealText(-12.3456789, 0, 3, DotCharacter) + "\n");
            result_translation.AddText(GetRealText(-12.000123456, 0, 3) + " / " + GetRealText(-12.000123456, 1, 3) + " / " + GetRealText(-12.000123456, 3, 3) + " / " + GetRealText(-12.000123456) + " \n");
            result_translation.AddText(GetLowerCase("jack SPARROW") + " / " + GetUpperCase("john MCLANE") + "\n");
            result_translation.AddText(GetSentenceCase("jason bourne") + " / " + GetTitleCase("james kirk") + "\n");
            result_translation.AddText(Dump(MakeTranslation("cm")));
            result_translation.AddText(Dump(MakeTranslation("cm", "0")));
            result_translation.AddText(Dump(MakeTranslation("cm", "1")));
            result_translation.AddText(Dump(MakeTranslation("cm", "2")));
            result_translation.AddText(Dump(MakeTranslation("cm", "-12.345")));
            result_translation.AddText(Dump(MakeTranslation("cm", "-12.345", GENRE.Male)));
            result_translation.AddText(Dump(MakeTranslation(12)));
            result_translation.AddText(Dump(MakeTranslation(12, GENRE.Female)));
            result_translation.AddText(Dump(new TRANSLATION("", "3")));
            result_translation.AddText(Dump(new TRANSLATION("perros", "4")));
            result_translation.AddText(Dump(new TRANSLATION("fiestas", "5", GENRE.Female)));
            result_translation.AddText(Dump(new TRANSLATION("", "6.5")));
            result_translation.AddText(Dump(new TRANSLATION("metros", "7.5")));
            result_translation.AddText(Dump(new TRANSLATION("vueltas", "8.5", GENRE.Female)));
            result_translation.AddText(GetText("English") + " / " + GetText("French") + " / " + GetDate("18", "2", "2018") + "\n");
            result_translation.AddText(GetText("Poem") + "\n");

            if (HasText("Haiku"))
            {
                result_translation.AddText(GetText("Haiku") + "\n");
            }

            return(result_translation.Text);
        }
Пример #17
0
        // ~~

        public virtual string Test(
            )
        {
            TRANSLATION
                no_helmets_translation = new TRANSLATION(),
                one_helmet_translation = new TRANSLATION(),
                kings_translation      = new TRANSLATION(),
                queens_translation     = new TRANSLATION(),
                princes_translation    = new TRANSLATION(),
                result_translation     = new TRANSLATION();

            no_helmets_translation = Helmets(0);
            one_helmet_translation = Helmets(1);
            result_translation.AddText(TheItemsHaveBeenFound(no_helmets_translation));
            result_translation.AddText(TheItemsHaveBeenFound(one_helmet_translation));
            result_translation.AddText(TheItemsHaveBeenFound(Helmets(2)));
            result_translation.AddText(TheItemsHaveBeenFound(NoSwords()));
            result_translation.AddText(TheItemsHaveBeenFound(OneSword()));
            result_translation.AddText(TheItemsHaveBeenFound(Swords(new TRANSLATION("", "2"))));
            result_translation.AddText(TestFunctions());
            result_translation.AddText(TestConditions(-25));
            result_translation.AddText(TestConditions(-15));
            result_translation.AddText(TestConditions(-5));
            result_translation.AddText(TestConditions(0));
            result_translation.AddText(TestConditions(5));
            result_translation.AddText(TestConditions(15));
            result_translation.AddText(TestConditions(25));
            kings_translation = Kings(new TRANSLATION("", "1"));
            queens_translation.SetText("reinas");
            queens_translation.SetQuantity("2");
            queens_translation.SetGenre(GENRE.Female);
            princes_translation = new TRANSLATION("príncipes", "3", GENRE.Male);
            result_translation.AddText(kings_translation.Text + " " + queens_translation.Text + " " + princes_translation.Text + "\n");

            return(result_translation.Text);
        }