mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
Merge pull request #8959 from jakemcdermott/fix-8884
Default to lang in catalog when browser preference unavailable Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
commit
2a353a809b
@ -30,7 +30,12 @@ const ProtectedRoute = ({ children, ...rest }) =>
|
||||
|
||||
function App() {
|
||||
const catalogs = { en, ja };
|
||||
const language = getLanguageWithoutRegionCode(navigator);
|
||||
let language = getLanguageWithoutRegionCode(navigator);
|
||||
if (!Object.keys(catalogs).includes(language)) {
|
||||
// If there isn't a string catalog available for the browser's
|
||||
// preferred language, default to one that has strings.
|
||||
language = 'en';
|
||||
}
|
||||
const match = useRouteMatch();
|
||||
const { hash, search, pathname } = useLocation();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user