scrabble-solver
Version:
Scrabble Solver 2 - Free, open-source, cross-platform, multi-language analysis tool for Scrabble, Scrabble Duel, Super Scrabble, Letter League, Crossplay, Literaki, and Kelimelik. Quickly find the top-scoring words using the given board and tiles.
21 lines (15 loc) • 352 B
text/typescript
import { useEffect } from 'react';
import { noop } from '@/lib';
export const useLanguage = (language: string) => {
useEffect(() => {
const html = document.body.parentElement;
if (!html) {
return noop;
}
const old = html.lang;
html.lang = language;
return () => {
html.lang = old;
};
}, [language]);
};