Merge pull request #8193 from Microsoft/noErrorOnFailedResourceLookup

Fix #8130: Do not fail if the resources for the specified locale does not exisit
This commit is contained in:
Mohamed Hegazy
2016-04-19 17:51:51 -07:00

View File

@@ -44,11 +44,9 @@ namespace ts {
const territory = matchResult[3];
// First try the entire locale, then fall back to just language if that's all we have.
if (!trySetLanguageAndTerritory(language, territory, errors) &&
!trySetLanguageAndTerritory(language, undefined, errors)) {
errors.push(createCompilerDiagnostic(Diagnostics.Unsupported_locale_0, locale));
return false;
// Either ways do not fail, and fallback to the English diagnostic strings.
if (!trySetLanguageAndTerritory(language, territory, errors)) {
trySetLanguageAndTerritory(language, undefined, errors);
}
return true;