Skip to content

Commit

Permalink
Localize some labels that were missing in the tasks view (#1607)
Browse files Browse the repository at this point in the history
Translation to English and Spanish included
  • Loading branch information
GuilleHoardings committed Feb 16, 2023
1 parent 8f58d3a commit 9884920
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 10 deletions.
1 change: 1 addition & 0 deletions website/public/locales/en/common.json
Expand Up @@ -3,6 +3,7 @@
"account_settings": "Account",
"admin_dashboard": "Admin Dashboard",
"back_to_dashboard": "Go back to the dashboard",
"cancel": "Cancel",
"connect": "Connect",
"conversational": "Conversational AI for everyone.",
"copied": "Copied",
Expand Down
12 changes: 8 additions & 4 deletions website/public/locales/en/tasks.json
Expand Up @@ -3,7 +3,8 @@
"available_task_count": "{{count}} tasks available",
"default": {
"unchanged_title": "No changes",
"unchanged_message": "Are you sure you would like to continue?"
"unchanged_message": "Are you sure you would like to continue?",
"continue_anyway": "Continue anyway"
},
"no_more_tasks": "Looks like no tasks were found.",
"random": {
Expand Down Expand Up @@ -35,21 +36,24 @@
"desc": "Help Open Assistant improve its responses to conversations with other users.",
"overview": "Given the following User replies, sort them from best to worst, best being first, worst being last.",
"unchanged_title": "Order Unchanged",
"unchanged_message": "You have not changed the order of the prompts. Are you sure you would like to continue?"
"unchanged_message": "You have not changed the order of the prompts. Are you sure you would like to continue?",
"continue_anyway": "Continue anyway"
},
"rank_assistant_replies": {
"label": "Rank Assistant Replies",
"desc": "Score prompts given by Open Assistant based on their accuracy and readability.",
"overview": "Given the following Assistant replies, sort them from best to worst, best being first, worst being last.",
"unchanged_title": "Order Unchanged",
"unchanged_message": "You have not changed the order of the prompts. Are you sure you would like to continue?"
"unchanged_message": "You have not changed the order of the prompts. Are you sure you would like to continue?",
"continue_anyway": "Continue anyway"
},
"rank_initial_prompts": {
"label": "Rank Initial Prompts",
"desc": "Score prompts given by Open Assistant based on their accuracy and readability.",
"overview": "Given the following initial prompts, sort them from best to worst, best being first, worst being last.",
"unchanged_title": "Order Unchanged",
"unchanged_message": "You have not changed the order of the prompts. Are you sure you would like to continue?"
"unchanged_message": "You have not changed the order of the prompts. Are you sure you would like to continue?",
"continue_anyway": "Continue anyway"
},
"label_initial_prompt": {
"label": "Label Initial Prompt",
Expand Down
1 change: 1 addition & 0 deletions website/public/locales/es/common.json
Expand Up @@ -3,6 +3,7 @@
"account_settings": "Cuenta",
"back_to_dashboard": "Volver al panel principal",
"admin_dashboard": "Panel de administración",
"cancel": "Cancelar",
"connect": "Conectar",
"conversational": "IA conversacional para todos.",
"copied": "Copiado",
Expand Down
12 changes: 8 additions & 4 deletions website/public/locales/es/tasks.json
Expand Up @@ -25,7 +25,8 @@
},
"default": {
"unchanged_title": "Sin cambios",
"unchanged_message": "¿Estás seguro de que quieres continuar?"
"unchanged_message": "¿Estás seguro de que quieres continuar?",
"continue_anyway": "Continuar de todas formas"
},
"label_assistant_reply": {
"label": "Etiquetar respuesta del asistente",
Expand All @@ -52,21 +53,24 @@
"desc": "Puntúa respuestas dadas por Open Assistant basándote en su precisión y legibilidad.",
"overview": "Dadas las siguientes respuestas del asistente, ordénalas de mejor a peor, con la primera siendo la mejor y la última, la peor.",
"unchanged_title": "Orden sin cambiar",
"unchanged_message": "No has cambiado el orden de las respuestas. ¿Seguro que quieres continuar?"
"unchanged_message": "No has cambiado el orden de las respuestas. ¿Seguro que quieres continuar?",
"continue_anyway": "Continuar de todas formas"
},
"rank_initial_prompts": {
"label": "Ordenar instrucciones iniciales",
"desc": "Puntúa instrucciones a Open Assistant basándote en su precisión y legibilidad.",
"overview": "Dadas las siguientes instrucciones iniciales, ordénalas de mejor a peor, siendo la primera la mejor y la última la peor.",
"unchanged_title": "Orden sin cambiar",
"unchanged_message": "No has cambiado el orden de las entradas. ¿Seguro que quieres continuar?"
"unchanged_message": "No has cambiado el orden de las entradas. ¿Seguro que quieres continuar?",
"continue_anyway": "Continuar de todas formas"
},
"rank_user_replies": {
"label": "Ordenar respuestas de usuarios",
"desc": "Ayuda a Open Assistant a mejorar sus respuestas a conversaciones con otros usuarios.",
"overview": "Dadas las siguientes respuestas de usuarios, ordénalas de mejor a peor, con la primera siendo la mejor y la última, la peor.",
"unchanged_title": "Orden sin cambiar",
"unchanged_message": "No has cambiado el orden de las respuestas. ¿Seguro que quieres continuar?"
"unchanged_message": "No has cambiado el orden de las respuestas. ¿Seguro que quieres continuar?",
"continue_anyway": "Continuar de todas formas"
},
"reply_as_assistant": {
"label": "Contestar como asistente",
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/Tasks/Task/Task.tsx
Expand Up @@ -186,7 +186,7 @@ export const Task = () => {
show={taskStatus.mode === "DEFAULT_WARN"}
title={t(getTypeSafei18nKey(`${taskInfo.id}.unchanged_title`)) || t("default.unchanged_title")}
message={t(getTypeSafei18nKey(`${taskInfo.id}.unchanged_message`)) || t("default.unchanged_message")}
continueButtonText={"Continue anyway"}
continueButtonText={t(getTypeSafei18nKey(`${taskInfo.id}.continue_anyway`)) || t("default.continue_anyway")}
onClose={() => taskEvent({ action: "RETURN_EDIT" })}
onContinueAnyway={() => {
taskEvent({ action: "ACCEPT_DEFAULT" });
Expand Down
5 changes: 4 additions & 1 deletion website/src/components/Tasks/UnchangedWarning.tsx
Expand Up @@ -9,6 +9,7 @@ import {
ModalHeader,
ModalOverlay,
} from "@chakra-ui/react";
import { useTranslation } from "next-i18next";

interface UnchangedWarningProps {
show: boolean;
Expand All @@ -20,6 +21,8 @@ interface UnchangedWarningProps {
}

export const UnchangedWarning = (props: UnchangedWarningProps) => {
const { t } = useTranslation();

return (
<>
<Modal isOpen={props.show} onClose={props.onClose} isCentered>
Expand All @@ -31,7 +34,7 @@ export const UnchangedWarning = (props: UnchangedWarningProps) => {
<ModalFooter>
<Flex justify="center" ml="auto" gap={2}>
<Button variant={"ghost"} onClick={props.onClose}>
Cancel
{t("cancel")}
</Button>
<Button onClick={props.onContinueAnyway}>{props.continueButtonText}</Button>
</Flex>
Expand Down

0 comments on commit 9884920

Please sign in to comment.