Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: standardize i18n string references #1119

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/components/EmptyState.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
><BtnRouteInternal
class="w-full"
:cta="false"
label="_global.return_home"
:label="i18nMap._global.return_home"
linkTo="/home"
fontSize="lg"
ariaLabel="_global.return_home_aria_label"
:ariaLabel="i18nMap._global.return_home_aria_label"
/></PageCommunityFooter>
</div>
<div v-else class="flex flex-col space-y-6 py-6">
Expand Down
6 changes: 3 additions & 3 deletions frontend/components/btn/BtnShareIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ const { t } = useI18n();
const contentCopied = ref(false);

const getCurrentI18n: { [key: string]: string } = {
signal: "components.btn_share_icon.opening_signal",
matrix: "components.btn_share_icon.opening_matrix",
instagram: "components.btn_share_icon.opening_instagram",
signal: i18nMap.components.btn_share_icon.opening_signal,
matrix: i18nMap.components.btn_share_icon.opening_matrix,
instagram: i18nMap.components.btn_share_icon.opening_instagram,
};

const copyToClipboardThenOpenUrl = async (
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/card/CardDonate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
class="flex"
:cta="true"
linkTo="/"
label="components.card_donate.donate"
:label="i18nMap.components.card_donate.donate"
fontSize="sm"
:rightIcon="IconMap.EXTERNAL_LINK"
iconSize="1.25em"
ariaLabel="components.card_donate.go_to_donation_page_aria_label"
:ariaLabel="i18nMap.components.card_donate.go_to_donation_page_aria_label"
/>
</div>
</template>
Expand Down
7 changes: 5 additions & 2 deletions frontend/components/card/CardOrgApplicationVote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
:leftIcon="IconMap.ARROW_UP"
iconSize="1.25em"
:disabled="isVotingDisabled"
ariaLabel="components._global.upvote_application_aria_label"
:ariaLabel="i18nMap.components._global.upvote_application_aria_label"
/>
<BtnAction
@click="$emit('down-vote')"
Expand All @@ -46,7 +46,10 @@
:leftIcon="IconMap.ARROW_DOWN"
iconSize="1.25em"
:disabled="isVotingDisabled"
ariaLabel="components.card_org_application_vote.downvote_application_aria_label"
:ariaLabel="
i18nMap.components.card_org_application_vote
.downvote_application_aria_label
"
/>
</div>
</div>
Expand Down
14 changes: 11 additions & 3 deletions frontend/components/card/discussion/CardDiscussion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
fontSize="sm"
:leftIcon="IconMap.ARROW_UP"
iconSize="1.25em"
ariaLabel="components.card.discussion._global.upvote_discussion_aria_label"
:ariaLabel="
i18nMap.components.card.discussion._global.upvote_discussion_aria_label
"
/>
<div class="flex-col space-y-3 md:grow md:space-y-4 md:pl-4 lg:pl-6">
<div class="flex flex-col justify-between md:flex-row">
Expand Down Expand Up @@ -40,15 +42,21 @@
fontSize="sm"
:leftIcon="IconMap.ARROW_UP"
iconSize="1.25em"
ariaLabel="components.card.discussion._global.upvote_discussion_aria_label"
:ariaLabel="
i18nMap.components.card.discussion._global
.upvote_discussion_aria_label
"
/>
<BtnAction
class="mt-1 flex"
:cta="true"
:label="discussion.category"
fontSize="sm"
iconSize="1.25em"
ariaLabel="components.card_discussion.filter_discussion_category_aria_label"
:ariaLabel="
i18nMap.components.card_discussion
.filter_discussion_category_aria_label
"
/>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion frontend/components/card/discussion/CardDiscussionEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
:leftIcon="IconMap.ARROW_UP"
iconSize="1.25em"
:counter="discussionEntry.votes"
ariaLabel="components.card.discussion._global.upvote_discussion_aria_label"
:ariaLabel="
i18nMap.components.card.discussion._global.upvote_discussion_aria_label
"
/>
</div>
</template>
Expand Down
12 changes: 9 additions & 3 deletions frontend/components/card/discussion/CardDiscussionInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
:cta="true"
:label="$t(i18nMap.components.card_discussion_input.write)"
fontSize="sm"
ariaLabel="components.card_discussion_input.write_aria_label"
:ariaLabel="
i18nMap.components.card_discussion_input.write_aria_label
"
/>
</div>
<div class="w-min md:w-min">
Expand All @@ -19,7 +21,9 @@
:cta="false"
:label="$t(i18nMap.components.card_discussion_input.preview)"
fontSize="sm"
ariaLabel="components.card_discussion_input.preview_aria_label"
:ariaLabel="
i18nMap.components.card_discussion_input.preview_aria_label
"
/>
</div>
</div>
Expand Down Expand Up @@ -136,7 +140,9 @@
:cta="true"
:label="$t(i18nMap.components.card_discussion_input.comment)"
fontSize="sm"
ariaLabel="components.card_discussion_input.comment_aria_label"
:ariaLabel="
i18nMap.components.card_discussion_input.comment_aria_label
"
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
class="w-full"
:cta="true"
linkTo="/"
label="_global.offer_to_help"
:label="i18nMap._global.offer_to_help"
fontSize="sm"
:rightIcon="IconMap.ARROW_RIGHT"
iconSize="1.45em"
ariaLabel="_global.offer_to_help_aria_label"
:ariaLabel="i18nMap._global.offer_to_help_aria_label"
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
v-if="group.getInvolvedUrl"
:cta="true"
:linkTo="group.getInvolvedUrl"
label="_global.join_group"
:label="i18nMap._global.join_group"
fontSize="sm"
:rightIcon="IconMap.ARROW_RIGHT"
iconSize="1.45em"
ariaLabel="_global.join_group_aria_label"
:ariaLabel="i18nMap._global.join_group_aria_label"
/>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions frontend/components/card/search-result/CardSearchResult.vue
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
<MetaTagVideo
v-else-if="onlineLocation"
:link="onlineLocation"
label="components.card_search_result.view_video"
:label="i18nMap.components.card_search_result.view_video"
/>
<MetaTagDate v-if="event && event.id != ''" :date="date" />
</div>
Expand All @@ -177,7 +177,7 @@
<MetaTagVideo
v-if="onlineLocation"
:link="onlineLocation"
label="components.card_search_result.view_video"
:label="i18nMap.components.card_search_result.view_video"
/>
<MetaTagDate v-if="event && event.id != ''" :date="date" />
</div>
Expand All @@ -193,15 +193,15 @@
/>
<!-- <MetaTagMembers
:members="members"
label="components.card_search_result.members"
:label="i18nMap.components.card_search_result.members"
/>
<MetaTagSupporters
:supporters="supporters"
label="components.card_search_result.supporters_lower"
:label="i18nMap.components.card_search_result.supporters_lower"
/>
<MetaTagStars
:stars="stars"
label="components.card_search_result.label"
:label="i18nMap.components.card_search_result.label"
/> -->
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/combobox/ComboboxTopics.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ import { GLOBAL_TOPICS } from "~/types/topics";

const i18n = useI18n();

const topics = [{ id: 1, name: "components.combobox_topics.all_topics" }];
const topics = [{ id: 1, name: i18nMap.components.combobox_topics.all_topics }];

let nextId = topics.length + 1;
for (const t of GLOBAL_TOPICS) {
Expand Down
10 changes: 5 additions & 5 deletions frontend/components/dropdown/DropdownCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:menuButtonIcon="IconMap.CIRCLE_PLUS"
:menuButtonLabel="$t(i18nMap.components.dropdown_create.create)"
:isMenuButtonUppercase="false"
menuButtonAriaLabel="components.dropdown_create.create_aria_label"
:menuButtonAriaLabel="i18nMap.components.dropdown_create.create_aria_label"
>
<DropdownItemsLayout :location="location" :options="createOptions" />
</DropdownBase>
Expand All @@ -24,28 +24,28 @@ defineProps<{
const createOptions: MenuSelector[] = [
{
id: 1,
label: "_global.new_event",
label: i18nMap._global.new_event,
routeUrl: "/events/create",
iconUrl: `${IconMap.EVENT}`,
selected: false,
},
{
id: 2,
label: "components.dropdown_create.new_organization",
label: i18nMap.components.dropdown_create.new_organization,
routeUrl: "/organizations/create",
iconUrl: "IconOrganization",
selected: false,
},
{
id: 3,
label: "_global.new_group",
label: i18nMap._global.new_group,
routeUrl: "/groups/create",
iconUrl: "IconGroup",
selected: false,
},
{
id: 4,
label: "_global.new_resource",
label: i18nMap._global.new_resource,
routeUrl: "/resources/create",
iconUrl: "IconResource",
selected: false,
Expand Down
8 changes: 4 additions & 4 deletions frontend/components/dropdown/DropdownInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:menuButtonIcon="IconMap.CIRCLE_INFO"
:menuButtonLabel="$t(i18nMap.components.dropdown_info.info)"
:isMenuButtonUppercase="false"
menuButtonAriaLabel="components.dropdown_info.info_aria_label"
:menuButtonAriaLabel="i18nMap.components.dropdown_info.info_aria_label"
>
<DropdownItemsLayout :location="location" :options="infoOptions" />
</DropdownBase>
Expand All @@ -24,21 +24,21 @@ defineProps<{
const infoOptions: MenuSelector[] = [
{
id: 1,
label: "components.dropdown_info.help",
label: i18nMap.components.dropdown_info.help,
routeUrl: "/help",
iconUrl: `${IconMap.CIRCLE_QUESTION}`,
selected: false,
},
{
id: 2,
label: "components._global.documentation",
label: i18nMap.components._global.documentation,
routeUrl: "/docs",
iconUrl: `${IconMap.DOCS}`,
selected: false,
},
{
id: 3,
label: "components.dropdown_info.legal",
label: i18nMap.components.dropdown_info.legal,
routeUrl: "/legal",
iconUrl: `${IconMap.LEGAL}`,
selected: false,
Expand Down
5 changes: 4 additions & 1 deletion frontend/components/dropdown/DropdownLanguage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
:menuButtonIcon="IconMap.GLOBE"
:menuButtonLabel="$i18n.locale"
:isMenuButtonUppercase="true"
menuButtonAriaLabel="components.dropdown_language.open_dropdown_aria_label"
:menuButtonAriaLabel="
i18nMap.components.dropdown_language.open_dropdown_aria_label
"
>
<ul class="px-2 py-2">
<NuxtLink
Expand All @@ -30,6 +32,7 @@
<script setup lang="ts">
import { MenuItem } from "@headlessui/vue";
import type { LocaleObject } from "@nuxtjs/i18n";
import { i18nMap } from "~/types/i18n-map";
import { IconMap } from "~/types/icon-map";
import type { DropdownLocation } from "~/types/location";

Expand Down
12 changes: 6 additions & 6 deletions frontend/components/dropdown/DropdownTheme.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@ const labelsOpt = [
{
optColorMode: "system",
iconName: `${IconMap.COLOR_MODE_SYSTEM}`,
label: "components.dropdown_theme.system",
ariaLabel: "components.dropdown_theme.system_aria_label",
label: i18nMap.components.dropdown_theme.system,
ariaLabel: i18nMap.components.dropdown_theme.system_aria_label,
},
{
optColorMode: "light",
iconName: `${IconMap.COLOR_MODE_LIGHT}`,
label: "components.dropdown_theme.light",
ariaLabel: "components.dropdown_theme.light_aria_label",
label: i18nMap.components.dropdown_theme.light,
ariaLabel: i18nMap.components.dropdown_theme.light_aria_label,
},
{
optColorMode: "dark",
iconName: `${IconMap.COLOR_MODE_DARK}`,
label: "components.dropdown_theme.dark",
ariaLabel: "components.dropdown_theme.dark_aria_label",
label: i18nMap.components.dropdown_theme.dark,
ariaLabel: i18nMap.components.dropdown_theme.dark_aria_label,
},
];

Expand Down
Loading
Loading