예제 #1
0
        protected override ResourceSet InternalGetResourceSet(CultureInfo culture, bool createIfNotExists, bool tryParents)
        {
            DatabaseResourceSet rs = null;

            if (culture == null || culture.Equals(CultureInfo.InvariantCulture))
            {
                return(null);
            }

            if (ResourceSets.Contains(culture.Name))
            {
                rs = ResourceSets[culture.Name] as DatabaseResourceSet;
            }
            else
            {
                lock (ResourceSets)
                {
                    if (ResourceSets.Contains(culture.Name))
                    {
                        rs = ResourceSets[culture.Name] as DatabaseResourceSet;
                    }
                    else
                    {
                        rs = new DatabaseResourceSet(dsn, culture, sp);
                        ResourceSets.Add(culture.Name, rs);
                    }
                }
            }

            return(rs);
        }
예제 #2
0
        public override String GetString(String msgid, CultureInfo culture)
        {
            DatabaseResourceSet rs = InternalGetResourceSet(culture, true, true) as DatabaseResourceSet;

            {
                String translation = rs.GetString(msgid);
                if (translation != null)
                {
                    return(translation);
                }
            }

            return(msgid);
        }