Skip to content

Commit

Permalink
refactor(JProgressCircular): make accessibility text translatable
Browse files Browse the repository at this point in the history
Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
  • Loading branch information
ferferga committed Jan 28, 2025
1 parent dd02404 commit 3631230
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions frontend/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
"liked": "Liked",
"liveTv": "Live TV & DVR",
"liveTvSettingsDescription": "Manage TV tuners, guide data providers and DVR settings",
"loading": "Loading...",
"localFontsPermissionWarning": "Access to the local fonts permission is required to select a font.",
"login": "Login",
"loginAs": "Login as {name}",
Expand Down Expand Up @@ -259,6 +260,7 @@
"parentalRatings": "Parental Ratings",
"password": "Password",
"people": "People",
"percentCompleted": "{value}% completed ",
"person": "Person",
"photos": "Photos",
"play": "Play",
Expand Down
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/ui-toolkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@skirtle/vue-vnode-utils": "0.2.0",
"@vueuse/core": "12.5.0",
"comlink": "4.4.2",
"vue": "3.5.13"
"vue": "3.5.13",
"vue-i18n": "9.14.2"
}
}
6 changes: 4 additions & 2 deletions packages/ui-toolkit/src/components/JProgressCircular.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
aria-valuemin="0"
aria-valuemax="100"
:aria-valuenow="indeterminate ? undefined : normalizedValue"
:aria-valuetext="indeterminate ? 'Cargando...' : `${normalizedValue}% completado`"
:aria-valuetext="indeterminate ? t('loading') : t('percentCompleted', { value: normalizedValue })"
v-bind="getBaseProps($attrs, false)">
<circle
class="j-progress-circular--underlay uno-stroke-current uno-z-1"
Expand All @@ -32,7 +32,7 @@
class="uno-fill-current j-progress-circular--text"
dominant-baseline="middle"
text-anchor="middle">
<template v-if="$slots.default">
<template v-if="$slots.default?.({}).length">
<slot />
</template>
<template v-else>
Expand All @@ -59,6 +59,7 @@ const CIRCUMFERENCE = 2 * Math.PI * MAGIC_RADIUS_CONSTANT;
</script>

<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { computed } from 'vue';
import { clamp, toPx } from '#/util/helpers';
import { getBaseProps } from '#/util/props';
Expand All @@ -74,6 +75,7 @@ const { indeterminate, innerProgress, value = 0 } = defineProps<{
const normalizedValue = computed(() => clamp(value, 0, 100));
const strokeDashoffset = computed(() => toPx(CIRCUMFERENCE * (1 - normalizedValue.value / 100)));
const { t } = useI18n();
</script>

<style scoped>
Expand Down

0 comments on commit 3631230

Please sign in to comment.