Adding more i18n keys for untranslated text

This commit is contained in:
AshAnand34 2025-07-18 16:57:19 -07:00
commit 0ce4be47df
2 changed files with 76 additions and 29 deletions

View file

@ -287,6 +287,38 @@
"title": "PrivateBin", "title": "PrivateBin",
"description": "A secure paste service for sharing text content with encryption and expiration options.", "description": "A secure paste service for sharing text content with encryption and expiration options.",
"shortDescription": "Share text securely with encryption and expiration", "shortDescription": "Share text securely with encryption and expiration",
"longDescription": "PrivateBin is a secure paste service that allows you to share text content with others. Your content is encrypted and can be configured with expiration times and burn-after-reading options. Perfect for sharing sensitive information, code snippets, or any text content that needs to be shared temporarily and securely." "longDescription": "PrivateBin is a secure paste service that allows you to share text content with others. Your content is encrypted and can be configured with expiration times and burn-after-reading options. Perfect for sharing sensitive information, code snippets, or any text content that needs to be shared temporarily and securely.",
"createPaste": "Create Paste",
"retrievePaste": "Retrieve Paste",
"createPasteTitle": "Create a new paste",
"createPasteDescription": "Enter your text below and configure the settings. Your content will be encrypted and stored securely.",
"retrievePasteTitle": "Retrieve a paste",
"retrievePasteDescription": "Enter the paste ID and password to retrieve the content.",
"pasteContent": "Paste Content",
"pasteContentPlaceholder": "Enter your text here...",
"pasteSettings": "Paste Settings",
"expiration": "Expiration",
"passwordOptional": "Password (optional)",
"burnAfterReading": "Burn after reading",
"pasteId": "Paste ID",
"password": "Password",
"creating": "Creating...",
"retrieving": "Retrieving...",
"createPasteButton": "Create Paste",
"retrievePasteButton": "Retrieve Paste",
"pasteCreatedSuccess": "Paste created successfully!",
"pasteIdLabel": "Paste ID:",
"shareIdMessage": "Share this ID with others to retrieve the content.",
"retrievedContent": "Retrieved content:",
"errorEnterBoth": "Please enter both paste ID and password",
"errorFailedCreate": "Failed to create paste:",
"errorFailedRetrieve": "Failed to retrieve paste:",
"expirationOptions": {
"1hour": "1 Hour",
"1day": "1 Day",
"1week": "1 Week",
"1month": "1 Month",
"never": "Never"
}
} }
} }

View file

@ -79,10 +79,12 @@ export default function PrivateBin({
try { try {
const pasteId = await createPaste(input, values); const pasteId = await createPaste(input, values);
setResult( setResult(
`Paste created successfully!\n\nPaste ID: ${pasteId}\n\nShare this ID with others to retrieve the content.` `${t('string:privatebin.pasteCreatedSuccess')}\n\n${t(
'string:privatebin.pasteIdLabel'
)} ${pasteId}\n\n${t('string:privatebin.shareIdMessage')}`
); );
} catch (err) { } catch (err) {
setError(`Failed to create paste: ${err}`); setError(`${t('string:privatebin.errorFailedCreate')} ${err}`);
} finally { } finally {
setLoading(false); setLoading(false);
} }
@ -90,7 +92,7 @@ export default function PrivateBin({
const handleRetrieve = async () => { const handleRetrieve = async () => {
if (!retrieveId.trim() || !retrievePassword.trim()) { if (!retrieveId.trim() || !retrievePassword.trim()) {
setError('Please enter both paste ID and password'); setError(t('string:privatebin.errorEnterBoth'));
return; return;
} }
@ -99,9 +101,9 @@ export default function PrivateBin({
try { try {
const content = await retrievePaste(retrieveId, retrievePassword); const content = await retrievePaste(retrieveId, retrievePassword);
setResult(`Retrieved content:\n\n${content}`); setResult(`${t('string:privatebin.retrievedContent')}\n\n${content}`);
} catch (err) { } catch (err) {
setError(`Failed to retrieve paste: ${err}`); setError(`${t('string:privatebin.errorFailedRetrieve')} ${err}`);
} finally { } finally {
setLoading(false); setLoading(false);
} }
@ -112,11 +114,11 @@ export default function PrivateBin({
updateField updateField
}) => [ }) => [
{ {
title: 'Paste Settings', title: t('string:privatebin.pasteSettings'),
component: ( component: (
<Box> <Box>
<FormControl fullWidth sx={{ mb: 2 }}> <FormControl fullWidth sx={{ mb: 2 }}>
<InputLabel>Expiration</InputLabel> <InputLabel>{t('string:privatebin.expiration')}</InputLabel>
<Select <Select
value={values.expiration} value={values.expiration}
onChange={(e) => onChange={(e) =>
@ -125,19 +127,29 @@ export default function PrivateBin({
e.target.value as InitialValuesType['expiration'] e.target.value as InitialValuesType['expiration']
) )
} }
label="Expiration" label={t('string:privatebin.expiration')}
> >
<MenuItem value="1hour">1 Hour</MenuItem> <MenuItem value="1hour">
<MenuItem value="1day">1 Day</MenuItem> {t('string:privatebin.expirationOptions.1hour')}
<MenuItem value="1week">1 Week</MenuItem> </MenuItem>
<MenuItem value="1month">1 Month</MenuItem> <MenuItem value="1day">
<MenuItem value="never">Never</MenuItem> {t('string:privatebin.expirationOptions.1day')}
</MenuItem>
<MenuItem value="1week">
{t('string:privatebin.expirationOptions.1week')}
</MenuItem>
<MenuItem value="1month">
{t('string:privatebin.expirationOptions.1month')}
</MenuItem>
<MenuItem value="never">
{t('string:privatebin.expirationOptions.never')}
</MenuItem>
</Select> </Select>
</FormControl> </FormControl>
<TextField <TextField
fullWidth fullWidth
label="Password (optional)" label={t('string:privatebin.passwordOptional')}
value={values.password} value={values.password}
onChange={(e) => updateField('password', e.target.value)} onChange={(e) => updateField('password', e.target.value)}
type="password" type="password"
@ -153,7 +165,7 @@ export default function PrivateBin({
} }
/> />
} }
label="Burn after reading" label={t('string:privatebin.burnAfterReading')}
/> />
</Box> </Box>
) )
@ -168,26 +180,25 @@ export default function PrivateBin({
onChange={handleTabChange} onChange={handleTabChange}
aria-label="privatebin tabs" aria-label="privatebin tabs"
> >
<Tab label="Create Paste" /> <Tab label={t('string:privatebin.createPaste')} />
<Tab label="Retrieve Paste" /> <Tab label={t('string:privatebin.retrievePaste')} />
</Tabs> </Tabs>
<TabPanel value={tabValue} index={0}> <TabPanel value={tabValue} index={0}>
<Box sx={{ mb: 3 }}> <Box sx={{ mb: 3 }}>
<Typography variant="h6" gutterBottom> <Typography variant="h6" gutterBottom>
Create a new paste {t('string:privatebin.createPasteTitle')}
</Typography> </Typography>
<Typography variant="body2" color="text.secondary" sx={{ mb: 2 }}> <Typography variant="body2" color="text.secondary" sx={{ mb: 2 }}>
Enter your text below and configure the settings. Your content {t('string:privatebin.createPasteDescription')}
will be encrypted and stored securely.
</Typography> </Typography>
</Box> </Box>
<ToolTextInput <ToolTextInput
value={input} value={input}
onChange={setInput} onChange={setInput}
title="Paste Content" title={t('string:privatebin.pasteContent')}
placeholder="Enter your text here..." placeholder={t('string:privatebin.pasteContentPlaceholder')}
/> />
<Box sx={{ mt: 3 }}> <Box sx={{ mt: 3 }}>
@ -197,7 +208,9 @@ export default function PrivateBin({
disabled={loading || !input.trim()} disabled={loading || !input.trim()}
fullWidth fullWidth
> >
{loading ? 'Creating...' : 'Create Paste'} {loading
? t('string:privatebin.creating')
: t('string:privatebin.createPasteButton')}
</Button> </Button>
</Box> </Box>
</TabPanel> </TabPanel>
@ -205,16 +218,16 @@ export default function PrivateBin({
<TabPanel value={tabValue} index={1}> <TabPanel value={tabValue} index={1}>
<Box sx={{ mb: 3 }}> <Box sx={{ mb: 3 }}>
<Typography variant="h6" gutterBottom> <Typography variant="h6" gutterBottom>
Retrieve a paste {t('string:privatebin.retrievePasteTitle')}
</Typography> </Typography>
<Typography variant="body2" color="text.secondary" sx={{ mb: 2 }}> <Typography variant="body2" color="text.secondary" sx={{ mb: 2 }}>
Enter the paste ID and password to retrieve the content. {t('string:privatebin.retrievePasteDescription')}
</Typography> </Typography>
</Box> </Box>
<TextField <TextField
fullWidth fullWidth
label="Paste ID" label={t('string:privatebin.pasteId')}
value={retrieveId} value={retrieveId}
onChange={(e) => setRetrieveId(e.target.value)} onChange={(e) => setRetrieveId(e.target.value)}
sx={{ mb: 2 }} sx={{ mb: 2 }}
@ -222,7 +235,7 @@ export default function PrivateBin({
<TextField <TextField
fullWidth fullWidth
label="Password" label={t('string:privatebin.password')}
value={retrievePassword} value={retrievePassword}
onChange={(e) => setRetrievePassword(e.target.value)} onChange={(e) => setRetrievePassword(e.target.value)}
type="password" type="password"
@ -235,7 +248,9 @@ export default function PrivateBin({
disabled={loading || !retrieveId.trim() || !retrievePassword.trim()} disabled={loading || !retrieveId.trim() || !retrievePassword.trim()}
fullWidth fullWidth
> >
{loading ? 'Retrieving...' : 'Retrieve Paste'} {loading
? t('string:privatebin.retrieving')
: t('string:privatebin.retrievePasteButton')}
</Button> </Button>
</TabPanel> </TabPanel>
</Paper> </Paper>