1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include <stddef.h> 6 7 #include <string> 8 9 #include "base/stl_util.h" 10 #include "build/build_config.h" 11 12 #if defined(OS_CHROMEOS) 13 #include "base/strings/string_util.h" 14 #endif 15 16 namespace l10n_util { 17 IsLocaleSupportedByOS(const std::string & locale)18bool IsLocaleSupportedByOS(const std::string& locale) { 19 #if defined(OS_CHROMEOS) 20 // We don't have translations yet for am, and sw. 21 // TODO(jungshik): Once the above issues are resolved, change this back 22 // to return true. 23 static const char kUnsupportedLocales[][3] = {"am", "sw"}; 24 for (size_t i = 0; i < base::size(kUnsupportedLocales); ++i) { 25 if (base::LowerCaseEqualsASCII(locale, kUnsupportedLocales[i])) 26 return false; 27 } 28 return true; 29 #else 30 // Return true blindly for now. 31 return true; 32 #endif 33 } 34 35 } // namespace l10n_util 36