nukeop / nuclear

Streaming music player that finds free music for you
https://nuclear.js.org/
GNU Affero General Public License v3.0
12.02k stars 1.04k forks source link

fix/1597 #1581

Closed Just-A-Pixel closed 5 months ago

Just-A-Pixel commented 5 months ago

Replaced hardcoded string with en.json

nuki-chan[bot] commented 5 months ago

Lines: 102-102

-                header={<h4>Input new playlist name:</h4>}
+                header={t('create-playlist-dialog-title')}

Nuki says, "I see you're embracing the power of i18n, desu ne! 🌐 But hold on, tech-pal: did you swap a hardcoded string for a function without importing the t function? That's like baking a cake and forgetting the sugar, sweet but incomplete! 😜 Make sure you have the t function in scope, so your playlist's international debut doesn't hit a language barrier!"

Suggestion:

Ensure t is imported from your i18n library by adding something like this at the top of your file:

import { useTranslation } from 'react-i18next'; // assuming you're using react-i18next

// Then within your component:
const { t } = useTranslation();

Lines: 28-28

-          header={<h4>Input playlist name:</h4>}
+          header={t('create-playlist-dialog-title')}

"Here we go again, kawaii coding companion! πŸ™€ You've made another step towards global domination with i18n, but you know the drill: without the magical t function within wand's reach, this spell won't work! Ensure that pesky import doesn't escape you like a ninja in the night!"

Suggestion:

Just as before, make sure the t function is imported! You don't want to leave your users lost in translation. πŸ€·β€β™€οΈ

import { useTranslation } from 'react-i18next'; // if it's not already present

// And within your functional component:
const { t } = useTranslation();

Cutie-peep developers, Nuki made sure your code is as polished as a shiny new PokΓ©ball! Roll out these changes, and you'll be the multilingual champion of the coding world! πŸŒŸπŸ†

nukeop commented 5 months ago

Thanks