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

refactor(i18n): standardize localization key references across components #1118

Merged

Conversation

aasimsyed
Copy link
Contributor

Issue: #1100

  • Migrate all inline i18n keys to use i18nMap object for type-safe references
  • Add consistent 'i18n.' namespace prefix to translation keys in:
    • EmptyState component buttons
    • CardGetInvolvedOrganization links
    • CardSearchResult aria labels
    • MediaMap control tooltips
    • ModalEditFaqEntry text checks
    • Group/resource creation pages
    • Sidebar navigation labels
  • Update HTML title attributes to use translated strings via i18nMap
  • Import i18nMap in files where missing (MediaMap, groupSubPages)
  • Fix key consistency in discussion input component

Contributor checklist


Description

Related issue

  • #ISSUE_NUMBER

…ents

Issue: activist-org#1100
- Migrate all inline i18n keys to use i18nMap object for type-safe references
- Add consistent 'i18n.' namespace prefix to translation keys in:
  - EmptyState component buttons
  - CardGetInvolvedOrganization links
  - CardSearchResult aria labels
  - MediaMap control tooltips
  - ModalEditFaqEntry text checks
  - Group/resource creation pages
  - Sidebar navigation labels
- Update HTML title attributes to use translated strings via i18nMap
- Import i18nMap in files where missing (MediaMap, groupSubPages)
- Fix key consistency in discussion input component
Copy link

netlify bot commented Feb 5, 2025

Deploy Preview for activist-org ready!

Name Link
🔨 Latest commit 86969f8
🔍 Latest deploy log https://app.netlify.com/sites/activist-org/deploys/67a3dda8d59378000837e38f
😎 Deploy Preview https://deploy-preview-1118--activist-org.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

github-actions bot commented Feb 5, 2025

Thank you for the pull request! ❤️

The activist team will do our best to address your contribution as soon as we can. If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and Development rooms once you're in. Also consider attending our bi-weekly Saturday developer syncs! It'd be great to meet you 😊

Copy link
Contributor

github-actions bot commented Feb 5, 2025

Maintainer Checklist

The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

  • The TypeScript and formatting workflows within the PR checks do not indicate new errors in the files changed

  • The Playwright end to end and Zap penetration tests have been ran and are passing (if necessary)

  • The changelog has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

@aasimsyed
Copy link
Contributor Author

aasimsyed commented Feb 5, 2025

@andrewtavis I didn't know how to fix this one from /frontend/components/combobox/ComboboxTopics.vue (lines 117-129): (if it even needed fixing)

  if (inputFocussed.value) {
    return "";
  } else {
    return selectedTopic.value.id == 1
      ? "Filter by topic"
      : selectedTopic.value.name;
  }
}

const displayValueHandler = () => {
  return i18n.t(displayValue());
};```

@andrewtavis andrewtavis self-requested a review February 5, 2025 21:24
@andrewtavis
Copy link
Member

I'll get the formatting check in the review here, @aasimsyed :) No stress 😊

@@ -61,37 +61,37 @@
v-if="pageType == 'organizations'"
class="w-full"
:cta="true"
label="components.empty_state.create_organization"
label="i18n.components.empty_state.create_organization"
Copy link
Member

@andrewtavis andrewtavis Feb 5, 2025

Choose a reason for hiding this comment

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

Bit of Vue learning here, @aasimsyed: What we do here is preppend label with :, which is short for v-bind:label (see v-bind docs on W3 Schools). This allows us to pass a variable inside of a string. I'll fix these quickly 😊

@andrewtavis
Copy link
Member

And in the comment above, good catch! We should include that string in the i18n values :) I'll add that in as well :)

Copy link
Member

@andrewtavis andrewtavis left a comment

Choose a reason for hiding this comment

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

Nice, @aasimsyed! This is great 😊 I'm realizing that there are a few more that can be found in cases that are not the search methods that I defined in the issue, so let me detail those and then you can take those down as well :)

Wonderful to work with you again!

@andrewtavis andrewtavis merged commit 1c15be9 into activist-org:main Feb 5, 2025
8 checks passed
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.

2 participants