Skip to content

Show Arabic content if English is missing#105

Merged
tarekio merged 4 commits intomainfrom
unifield-improve
Jun 16, 2025
Merged

Show Arabic content if English is missing#105
tarekio merged 4 commits intomainfrom
unifield-improve

Conversation

@tarekio
Copy link
Contributor

@tarekio tarekio commented Jun 11, 2025

Jira Issue

  1. [Add links to jira issues]

Description

[Brief description of changes]

Checklist

  • Tests added/updated
  • Documentation updated (if needed)
  • New strings prepared for translations

API Changes (if applicable)

  • Permissions checked
  • Endpoint tests added

Additional Notes

[Any other relevant information]

@tarekio tarekio requested a review from level09 June 13, 2025 19:26
Copy link
Collaborator

@level09 level09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good, it improves the initial state of the language switch, but the component still allows the user to toggle to a blank field if one language is missing.

my seggestion :
Update the template so that:

  • If both english and arabic exist, the toggle works as now.
  • If only one exists, always show the available one, regardless of the switch, and hide the toggle button.

This ensures the user never sees a blank field and the UI always has something.

<v-list v-if="english || arabic" ...>
  <!-- Both exist: allow switching -->
  <template v-if="english && arabic">
    <v-list-item :title="caption" v-if="sw" density="compact">
      <v-sheet class="text-body-2">{{ english }}</v-sheet>
      <template #append>
        <v-btn variant="text" size="x-small" icon="mdi-web" @click="sw = !sw"></v-btn>
      </template>
    </v-list-item>
    <v-list-item :title="caption" v-else density="compact">
      <v-sheet class="text-body-2">{{ arabic }}</v-sheet>
      <template #append>
        <v-btn variant="text" size="x-small" icon="mdi-web" @click="sw = !sw"></v-btn>
      </template>
    </v-list-item>
  </template>
  <!-- Only one exists: show it, no toggle -->
  <template v-else>
    <v-list-item :title="caption" density="compact">
      <v-sheet class="text-body-2">{{ english || arabic }}</v-sheet>
    </v-list-item>
  </template>
</v-list>

@apodacaduron
Copy link
Contributor

@level09 made an update based on your feedback

Copy link
Collaborator

@level09 level09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect

@tarekio tarekio merged commit 4e15760 into main Jun 16, 2025
7 checks passed
@tarekio tarekio deleted the unifield-improve branch June 16, 2025 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants