mirror of
https://github.com/movie-web/movie-web.git
synced 2024-11-13 12:35:04 +01:00
Merge branch 'dev' of https://github.com/ashudevcodes/movie-web into dev
This commit is contained in:
commit
897d856ba5
@ -14,7 +14,10 @@ export function useRandomTranslation() {
|
|||||||
const defaultTitle = t(`${key}.default`) ?? "";
|
const defaultTitle = t(`${key}.default`) ?? "";
|
||||||
if (!shouldJoke) return defaultTitle;
|
if (!shouldJoke) return defaultTitle;
|
||||||
|
|
||||||
const keys = t(`${key}.extra`, { returnObjects: true });
|
const keys = t(`${key}.extra`, {
|
||||||
|
returnObjects: true,
|
||||||
|
defaultValue: defaultTitle,
|
||||||
|
});
|
||||||
if (Array.isArray(keys)) {
|
if (Array.isArray(keys)) {
|
||||||
if (keys.length === 0) return defaultTitle;
|
if (keys.length === 0) return defaultTitle;
|
||||||
return keys[Math.floor(seed * keys.length)];
|
return keys[Math.floor(seed * keys.length)];
|
||||||
|
Loading…
Reference in New Issue
Block a user