// such as ".ResX", or a completely different format for naming files.
protected virtual String GetResourceFileName(CultureInfo culture)
{
- StringBuilder sb = new StringBuilder(255);
- sb.Append(BaseNameField);
- // If this is the neutral culture, don't append culture name.
- if (!culture.HasInvariantCultureName)
+ // If this is the neutral culture, don't include the culture name.
+ if (culture.HasInvariantCultureName)
{
- CultureInfo.VerifyCultureName(culture.Name, true);
- sb.Append('.');
- sb.Append(culture.Name);
+ return BaseNameField + ResFileExtension;
+ }
+ else
+ {
+ CultureInfo.VerifyCultureName(culture.Name, throwException: true);
+ return BaseNameField + "." + culture.Name + ResFileExtension;
}
- sb.Append(ResFileExtension);
- return sb.ToString();
}
// WARNING: This function must be kept in sync with ResourceFallbackManager.GetEnumerator()