Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: capitalization typing #603

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion public/locales/en/importSaveTab.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"ButtonText": "Import $t(common:Relic, {\"count\": 123, \"capitalizeLength\": 0})"
},
"CharactersImport": {
"Label": "Import $t(common:Relic, {\"count\": 123, \"capitalizeLength\": 0}) only. Updates the optimizer with the new dataset of $t(common:Relic, {\"count\": 123, \"capitalizeLength\": 0}) and doesn't overwrite builds.",
"Label": "Import $t(common:Relic, {\"count\": 123, \"capitalizeLength\": 0}) and $t(common:Character, {\"count\": 123, \"capitalizeLength\": 0}). Replaces the optimizer builds with ingame builds.",
"ButtonText": "Import $t(common:Relic, {\"count\": 123, \"capitalizeLength\": 0}) & $t(common:Character, {\"count\": 123, \"capitalizeLength\": 0})",
"WarningTitle": "Overwrite optimizer builds",
"WarningDescription": "Are you sure you want to overwrite your optimizer builds with ingame builds?"
Expand Down
4 changes: 2 additions & 2 deletions src/components/importerTab/ClearDataSubmenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export function ClearDataSubmenu() {
description={t('ClearData.WarningDescription')/* Are you sure you want to clear all relics and characters */}
onConfirm={clearDataClicked}
placement='bottom'
okText={t('common:Yes')/* yes */}
cancelText={t('common:Cancel')/* cancel */}
okText={t('common:Yes', { capitalizeLength: 1 })/* Yes */}
cancelText={t('common:Cancel', { capitalizeLength: 1 })/* Cancel */}
>
<Button type='primary' icon={<DeleteOutlined/>} loading={loading} style={{ width: importerTabButtonWidth }}>
{t('ClearData.ButtonText')/* Clear data */}
Expand Down
3 changes: 2 additions & 1 deletion src/components/importerTab/ImportTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const saveFile = async (blob, suggestedName) => {

function SaveDataSubmenu() {
const { t } = useTranslation('importSaveTab', { keyPrefix: 'SaveData' })

async function saveClicked() {
try {
const stateString = SaveState.save()
Expand All @@ -84,7 +85,7 @@ function SaveDataSubmenu() {
return (
<Flex vertical gap={5}>
<Text>
{t('label')/* Save your optimizer data to a file. */}
{t('Label')/* Save your optimizer data to a file. */}
</Text>
<Button type='primary' onClick={saveClicked} icon={<DownloadOutlined/>} style={{ width: buttonWidth }}>
{t('ButtonText')/* Save data */}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void i18next

i18next.services.formatter?.add('capitalize', (value: string | undefined, lng, options: { interpolationkey?: string; capitalizeLength: number }) => {
const string = value ?? options.interpolationkey ?? ''
let length = options.capitalizeLength || 0
let length = options.capitalizeLength ?? 1
if (length < 0) {
length = string.length
}
Expand Down
Loading