Skip to content

Commit

Permalink
fix(EditPostForm): resolve untranslated string (#3072)
Browse files Browse the repository at this point in the history
  • Loading branch information
wescopeland authored Jan 18, 2025
1 parent 7cc28ea commit 1d068aa
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lang/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -631,5 +631,6 @@
"See your full recommendation feed": "See your full recommendation feed",
"Beaten by same players": "Beaten by same players",
"Mastered by same players": "Mastered by same players",
"<1>{{achievementTitle}}</1> from <2>{{gameTitle}}</2>": "<1>{{achievementTitle}}</1> from <2>{{gameTitle}}</2>"
"<1>{{achievementTitle}}</1> from <2>{{gameTitle}}</2>": "<1>{{achievementTitle}}</1> from <2>{{gameTitle}}</2>",
"Don't ask for links to copyrighted ROMs. Don't share links to copyrighted ROMs.": "Don't ask for links to copyrighted ROMs. Don't share links to copyrighted ROMs."
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useImperativeHandle } from 'react';
import { useIsomorphicLayoutEffect } from 'react-use';

import { cn } from '@/common/utils/cn';
import type { TranslatedString } from '@/types/i18next';

interface UseBaseAutosizeTextAreaProps {
textAreaRef: React.MutableRefObject<HTMLTextAreaElement | null>;
Expand Down Expand Up @@ -61,7 +62,8 @@ export type BaseAutosizeTextAreaRef = {
type BaseAutosizeTextAreaProps = {
maxHeight?: number;
minHeight?: number;
} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;
placeholder?: TranslatedString;
} & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'placeholder'>;

export const BaseAutosizeTextarea = React.forwardRef<
BaseAutosizeTextAreaRef,
Expand Down
5 changes: 4 additions & 1 deletion resources/js/common/components/+vendor/BaseInput.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import * as React from 'react';

import { cn } from '@/common/utils/cn';
import type { TranslatedString } from '@/types/i18next';

export type BaseInputProps = React.InputHTMLAttributes<HTMLInputElement>;
export type BaseInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'placeholder'> & {
placeholder?: TranslatedString;
};

const BaseInput = React.forwardRef<HTMLInputElement, BaseInputProps>(
({ className, type, ...props }, ref) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ export const EditPostForm: FC<EditPostFormProps> = ({ onPreview }) => {
<BaseFormControl>
<BaseAutosizeTextarea
className="p-3"
placeholder="Don't ask for links to copyrighted ROMs. Don't share links to copyrighted ROMs."
placeholder={t(
"Don't ask for links to copyrighted ROMs. Don't share links to copyrighted ROMs.",
)}
maxLength={60_000}
minHeight={308}
{...field}
Expand Down

0 comments on commit 1d068aa

Please sign in to comment.