Skip to content

Commit eb96e3b

Browse files
committed
2 parents b27caed + 256d6cf commit eb96e3b

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed

src/Footer.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ export const Footer = memo(
332332
)}
333333
target="_blank"
334334
href={`https://${domain}`}
335+
title={`${domain} - ${t("open new window")}`}
335336
>
336337
{domain}
337338
</a>
@@ -502,12 +503,17 @@ const { useTranslation, addFooterTranslations } = createComponentI18nApi({
502503
"license mention": (p: { licenseUrl: string }) => (
503504
<>
504505
Sauf mention contraire, tous les contenus de ce site sont sous{" "}
505-
<a href={p.licenseUrl} target="_blank">
506+
<a
507+
href={p.licenseUrl}
508+
target="_blank"
509+
title="licence etalab-2.0 - ouvre une nouvelle fenêtre"
510+
>
506511
licence etalab-2.0
507512
</a>
508513
</>
509514
),
510-
"our partners": "Nos partenaires"
515+
"our partners": "Nos partenaires",
516+
"open new window": "ouvre une nouvelle fenêtre"
511517
/* spell-checker: enable */
512518
}
513519
});
@@ -524,11 +530,16 @@ addFooterTranslations({
524530
"license mention": p => (
525531
<>
526532
Unless stated otherwise, all content of this website is under the{" "}
527-
<a href={p.licenseUrl} target="_blank">
533+
<a
534+
href={p.licenseUrl}
535+
target="_blank"
536+
title="etalab-2.0 license - open a new window"
537+
>
528538
etalab-2.0 license
529539
</a>
530540
</>
531-
)
541+
),
542+
"open new window": "open new window"
532543
}
533544
});
534545

src/Upload.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export type UploadProps = {
1414
hint?: string;
1515
/** @default false */
1616
multiple?: boolean;
17+
label?: ReactNode;
1718
/** @default "default" */
1819
state?: "success" | "error" | "default";
1920
/** The message won't be displayed if state is "default" */
@@ -31,6 +32,7 @@ export const Upload = memo(
3132
disabled = false,
3233
hint = t("hint"),
3334
multiple = false,
35+
label = multiple ? t("add files") : t("add file"),
3436
state = "default",
3537
stateRelatedMessage,
3638
nativeInputProps = {},
@@ -71,7 +73,7 @@ export const Upload = memo(
7173
ref={ref}
7274
>
7375
<label className={fr.cx("fr-label")} aria-disabled={disabled} htmlFor={inputId}>
74-
{t("add_files")}
76+
{label}
7577
<span className={fr.cx("fr-hint-text")}>{hint}</span>
7678
</label>
7779
<input
@@ -116,7 +118,8 @@ const { useTranslation, addUploadTranslations } = createComponentI18nApi({
116118
"componentName": symToStr({ Upload }),
117119
"frMessages": {
118120
/* spell-checker: disable */
119-
"add_files": "Ajouter des fichiers",
121+
"add file": "Ajouter un fichier",
122+
"add files": "Ajouter des fichiers",
120123
"hint": "Taille maximale : 500 Mo. Formats supportés : jpg, png, pdf. Plusieurs fichiers possibles."
121124
/* spell-checker: enable */
122125
}
@@ -125,7 +128,8 @@ const { useTranslation, addUploadTranslations } = createComponentI18nApi({
125128
addUploadTranslations({
126129
lang: "en",
127130
messages: {
128-
"add_files": "Add files",
131+
"add file": "Add file",
132+
"add files": "Add files",
129133
"hint": "Maximum size : 500 Mo. Supported formats : jpg, png, pdf. Many files possible."
130134
}
131135
});

stories/Upload.stories.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ const { meta, getStory } = getStoryFactory({
1414
"disabled": {
1515
"control": { "type": "boolean" }
1616
},
17+
"label": {
18+
"description": "By default : Ajouter un fichier / des fichiers",
19+
"control": { "type": "text" }
20+
},
1721
"state": {
1822
"options": (() => {
1923
const options = ["default", "success", "error"] as const;
@@ -44,6 +48,7 @@ const { meta, getStory } = getStoryFactory({
4448
export default meta;
4549

4650
export const Default = getStory({
51+
"label": undefined,
4752
"hint": "Texte de description",
4853
"state": "default",
4954
"stateRelatedMessage": "Text de validation / d'explication de l'erreur",
@@ -73,3 +78,7 @@ export const WithHint = getStory({
7378
export const Multiple = getStory({
7479
"multiple": true
7580
});
81+
82+
export const WithCustomLabel = getStory({
83+
"label": "Téléversez votre image de profil"
84+
});

0 commit comments

Comments
 (0)