예제 #1
0
        public PhraseDictionary()
        {
            var availableCommandsPhrases = new LocalisedTexts();

            availableCommandsPhrases.AddText("Available commands", null);
            _phrases.Add(Texts.PhraseKeys.AvailableCommands, availableCommandsPhrases);

            var noVariablesSetPhrases = new LocalisedTexts();

            noVariablesSetPhrases.AddText("No variables set.", null);
            _phrases.Add(Texts.PhraseKeys.NoVariablesSet, noVariablesSetPhrases);

            var requiredPhrases = new LocalisedTexts();

            requiredPhrases.AddText("Required", null);
            _phrases.Add(Texts.PhraseKeys.Required, requiredPhrases);

            var usagePhrases = new LocalisedTexts();

            usagePhrases.AddText("usage", null);
            _phrases.Add(Texts.PhraseKeys.Usage, usagePhrases);

            var variableNotSetPhrases = new LocalisedTexts();

            variableNotSetPhrases.AddText("Variable '{0}' is not set.", null);
            _phrases.Add(Texts.PhraseKeys.VariableNotSet, variableNotSetPhrases);
        }
예제 #2
0
        private ITextResolver ExtractDescriptions(MemberInfo member)
        {
            var descriptions          = new LocalisedTexts();
            var descriptionAttributes = ExtractDescriptionAttributes(member);

            foreach (var descriptionAttribute in descriptionAttributes)
            {
                descriptions.AddText(descriptionAttribute.Text, descriptionAttribute.CultureName);
            }

            return(descriptions);
        }