Skip to content

Commit

Permalink
🚸 Support Spanish (#5416)
Browse files Browse the repository at this point in the history
Co-authored-by: Leire <[email protected]>
Co-authored-by: Natalia Elvira <[email protected]>
  • Loading branch information
3 people authored Sep 3, 2024
1 parent 788dec6 commit 454aae1
Show file tree
Hide file tree
Showing 23 changed files with 375 additions and 56 deletions.
2 changes: 1 addition & 1 deletion argilla-frontend/components/base/base-code/BaseCode.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<base-action-tooltip class="button" tooltip="Copied">
<base-action-tooltip class="button" :tooltip="$t('copied')">
<a href="#" @click.prevent="copy(code)">
<svgicon name="copy" width="16" height="16" />
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ export default {
},
},
mounted() {
this.$emit("onChanged", this.currentTab.id);

this.$emit("onLoaded");

this.$emit("onChanged", this.currentTab.id);
},
};
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{{ value }}
<BaseActionTooltip
class="table-info__copy"
tooltip="Copied"
:tooltip="$t('copied')"
tooltip-position="left"
>
<BaseButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
tooltip-position="left"
>
<BaseButton
title="Copy to clipboard"
:title="$t('button.tooltip.copyToClipboard')"
class="text_field_component__copy-button"
@click.prevent="$copyToClipboard(fieldText)"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<span class="text_field_component__title-content" v-text="title" />
<BaseActionTooltip
class="text_field_component__tooltip"
tooltip="Copied"
:tooltip="$t('copied')"
tooltip-position="left"
>
<BaseButton
title="Copy to clipboard"
:title="$t('button.tooltip.copyToClipboard')"
class="text_field_component__copy-button"
@click.prevent="$copyToClipboard(fieldText)"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class="textarea--markdown"
:markdown="question.suggestion?.value"
/>
<BaseActionTooltip tooltip="Copied" class="button-copy">
<BaseActionTooltip :tooltip="$t('copied')" class="button-copy">
<BaseButton @on-click="$copyToClipboard(question.suggestion?.value)">
<svgicon name="copy" width="16" height="16" />
</BaseButton>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,17 @@
:copy-button="showCopyButton"
@breadcrumb-action="$emit('breadcrumb-action', $event)"
/>
<template v-if="datasetId">
<NuxtLink
v-if="showSettingButton"
:to="{ name: 'dataset-id-settings', params: { id: this.datasetId } }"
>
<DatasetSettingsIconFeedbackTask v-if="datasetId" />
</NuxtLink>
<template v-if="datasetId && showSettingButton">
<div @click="goToSetting(datasetId)">
<DatasetSettingsIconFeedbackTask />
</div>
</template>
<user-avatar-tooltip />
</BaseTopbarBrand>
</template>

<script>
import { useRole } from "~/v1/infrastructure/services";
import { useRoutes } from "~/v1/infrastructure/services";
export default {
name: "HeaderFeedbackTask",
Expand All @@ -41,7 +38,7 @@ export default {
},
},
setup() {
return useRole();
return useRoutes();
},
};
</script>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<FilterButton
button-name="Sort"
:button-name="$t('sorting.label')"
icon-name="sort"
:is-button-active="isButtonActive"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
>{{ progress.percentage.completed }}%</span
>
<span v-if="visibleProgressValues" class="team-progress__info">
{{ progress.completed }} of {{ progress.total }}
{{ progress.completed }} {{ $t("of") }} {{ progress.total }}
</span>
</template>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<li class="status-counter">
<span>
<span class="color-bullet" :style="{ backgroundColor: color }"></span>
<label class="status-counter__name" v-text="name" />
<label class="status-counter__name" v-text="statusLabel" />
</span>
<span class="status-counter__counter" v-text="value" />
</li>
Expand All @@ -24,6 +24,11 @@ export default {
required: true,
},
},
computed: {
statusLabel() {
return this.$t(`recordStatus.${this.name}`);
},
},
};
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
card-type="danger"
:title="`<strong>${dataset.name}</strong>`"
:text="$t('settings.deleteWarning')"
buttonText="Delete"
:buttonText="$t('button.delete')"
@card-action="toggleDeleteModal(true)"
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</div>
<base-action-tooltip :tooltip="$t('copied')">
<base-button
title="Copy to clipboard"
:title="$t('button.tooltip.copyToClipboard')"
class="secondary small"
@click.prevent="$copyToClipboard(datasetSettingsUrl)"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</div>
<base-action-tooltip :tooltip="$t('copied')">
<base-button
title="Copy to clipboard"
:title="$t('button.tooltip.copyToClipboard')"
class="secondary small"
@click.prevent="$copyToClipboard(datasetSettingsUrl)"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
</div>
<div class="settings__preview">
<QuestionsComponent
legend="UI preview"
:legend="$t('settings.uiPreview')"
class="settings__preview__content"
:questions="settings.questions"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,16 @@ export default {
data() {
return {
tabs: [
{ id: "0", name: "Write", component: "ContentEditableFeedbackTask" },
{ id: "1", name: "Preview", component: "RenderMarkdownBaseComponent" },
{
id: "0",
name: this.$t("write"),
component: "ContentEditableFeedbackTask",
},
{
id: "1",
name: this.$t("preview"),
component: "RenderMarkdownBaseComponent",
},
],
};
},
Expand Down
14 changes: 7 additions & 7 deletions argilla-frontend/components/features/datasets/DatasetsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,20 @@ export default {
{
name: "copy-name",
icon: "copy",
title: "Copy name to clipboard",
tooltip: "Copied",
title: this.$t("button.tooltip.copyNameToClipboard"),
tooltip: this.$t("copied"),
},
{
name: "copy-url",
icon: "link",
title: "Copy url to clipboard",
tooltip: "Copied",
title: this.$t("button.tooltip.copyLinkToClipboard"),
tooltip: this.$t("copied"),
},
{
name: "go-to-settings",
icon: "settings",
title: "Go to dataset settings",
tooltip: "Dataset settings",
title: this.$t("button.tooltip.goToDatasetSettings"),
tooltip: this.$t("button.tooltip.datasetSettings"),
},
],
},
Expand Down Expand Up @@ -177,7 +177,7 @@ export default {
onActionClicked(action, dataset) {
switch (action) {
case "go-to-settings":
this.goToSetting(dataset);
this.goToSetting(dataset.id);
break;
case "copy-url":
this.copyUrl(dataset);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<span class="user-token-value --body1" v-text="'**** **** **** ****'" />

<div class="user-token-button">
<base-action-tooltip tooltip="Copied">
<base-action-tooltip :tooltip="$t('copied')">
<BaseButton
title="Copy to clipboard"
:title="$t('button.tooltip.copyToClipboard')"
class="secondary small"
@click.prevent="$copyToClipboard(userToken)"
>
Expand Down
4 changes: 4 additions & 0 deletions argilla-frontend/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ const config: NuxtConfig = {
code: "de",
file: "de.js",
},
{
code: "es",
file: "es.js",
},
],
detectBrowserLanguage: false,
vueI18n: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ export const useDatasetSettingViewModel = () => {
});

const goToDataset = () => {
if (routes.previousRouteMatchWith(datasetId)) return routes.goBack();
if (routes.previousRouteMatchWith(`${datasetId}/annotation-mode`)) {
return routes.goBack();
}

routes.goToFeedbackTaskAnnotationPage(datasetId);
};
Expand Down Expand Up @@ -159,10 +161,7 @@ export const useDatasetSettingViewModel = () => {
);

const onTabChanged = async (tabId: Tab["id"]) => {
await routes.setQueryParams({
key: "tab",
value: tabId,
});
await routes.setQueryParamsVirtually({ key: "tab", value: tabId });
};

const onTabLoaded = () => {
Expand Down
12 changes: 11 additions & 1 deletion argilla-frontend/translation/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export default {
searchDatasets: "Durchsuche Datensätze",
expand: "Erweitern",
copied: "Kopiert",
copyClipboard: "In Zwischenablage kopieren",
copyLink: "Link kopieren",
copyRecord: "Eintrag kopieren",
refresh: "Refresh",
Expand Down Expand Up @@ -93,6 +92,13 @@ export default {
cancel: "Abbrechen",
continue: "Fortfahren",
delete: "Löschen",
tooltip: {
copyToClipboard: "In Zwischenablage kopieren",
copyNameToClipboard: "Datensatznamen in die Zwischenablage kopieren",
copyLinkToClipboard: "Datensatzlink in die Zwischenablage kopieren",
goToDatasetSettings: "Zu den Datensatzeinstellungen gehen",
datasetSettings: "Datensatzeinstellungen",
},
},
to_submit_complete_required:
"Zum Absenden beantworten \nSie benötigte Fragen",
Expand Down Expand Up @@ -135,6 +141,7 @@ export default {
draft: "Entwurf speichern",
},
sorting: {
label: "Sortieren",
addOtherField: "+ Ein weiteres Feld hinzufügen",
suggestion: {
score: "Vorschlagsbewertung",
Expand Down Expand Up @@ -184,6 +191,7 @@ export default {
"Helfe <strong>{user}</strong> um bessere Datensätze für KI zu erstellen",
},
},
of: "von",
status: "Status",
filters: "Filter",
filterBy: "Filter nach...",
Expand All @@ -204,6 +212,8 @@ export default {
update: "Aktualisieren",
youAreOnlineAgain: "Sie sind wieder online",
youAreOffline: "Sie sind offline",
write: "Schreiben",
preview: "Vorschau",
datasetTable: {
name: "Dataset",
workspace: "Arbeitsbereich",
Expand Down
12 changes: 11 additions & 1 deletion argilla-frontend/translation/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export default {
searchDatasets: "Search datasets",
expand: "Expand",
copied: "Copied",
copyClipboard: "Copy to clipboard",
copyLink: "Copy link",
copyRecord: "Copy record",
refresh: "Refresh",
Expand Down Expand Up @@ -101,6 +100,13 @@ export default {
cancel: "Cancel",
continue: "Continue",
delete: "Delete",
tooltip: {
copyToClipboard: "Copy to clipboard",
copyNameToClipboard: "Copy dataset name to clipboard",
copyLinkToClipboard: "Copy dataset link to clipboard",
goToDatasetSettings: "Go to dataset settings",
datasetSettings: "Dataset settings",
},
},
to_submit_complete_required: "To submit complete \nrequired responses",
some_records_failed_to_annotate: "Some records failed to annotate",
Expand Down Expand Up @@ -142,6 +148,7 @@ export default {
write: "Write",
},
sorting: {
label: "Sort",
addOtherField: "+ Add another field",
suggestion: {
score: "Suggestion score",
Expand Down Expand Up @@ -190,6 +197,7 @@ export default {
subtitle: "Join <strong>{user}</strong> to build better datasets for AI",
},
},
of: "of",
status: "Status",
filters: "Filters",
filterBy: "Filter by...",
Expand All @@ -211,6 +219,8 @@ export default {
update: "Update",
youAreOnlineAgain: "You are online again",
youAreOffline: "You are offline",
write: "Write",
preview: "Preview",
datasetTable: {
name: "Dataset",
workspace: "Workspace",
Expand Down
Loading

0 comments on commit 454aae1

Please sign in to comment.