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

💬 Add missing i18n string #969

Merged
merged 1 commit into from Dec 31, 2023
Merged

Conversation

avm99963
Copy link
Contributor

@avm99963 avm99963 commented Dec 24, 2023

Description

Converts a hardcoded string of the time zone picker ("Ignore time zone") to a translatable string:

image

Checklist

Please check off all the following items with an "x" in the boxes before requesting a review.

  • I have performed a self-review of my code
  • My code follows the code style of this project
  • I have commented my code, particularly in hard-to-understand areas

Summary by CodeRabbit

  • Enhancements
    • Localized the "Ignore time zone" label in the TimeZonePicker for better international support.

Copy link

vercel bot commented Dec 24, 2023

@avm99963 is attempting to deploy a commit to the rallly Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

coderabbitai bot commented Dec 24, 2023

Walkthrough

The update to the TimeZonePicker component involves integrating internationalization support. By incorporating the useTranslation hook, the component is now capable of presenting the "Ignore time zone" label in multiple languages, enhancing accessibility and user experience for a global audience.

Changes

File Path Change Summary
.../time-zone-picker.tsx Added useTranslation hook for localizing the "Ignore time zone" label.

🐇🌐

Code hops through time, no bound,
Across the globe, it's found.
Now speaks in tongues so clear,
For each user, it draws near. 🌏💬

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • You can directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
  • You can tag CodeRabbit on specific lines of code or entire files in the PR by tagging @coderabbitai in a comment. Examples:
    • @coderabbitai generate unit tests for this file
    • @coderabbitai modularize this function
  • You can tag @coderabbitai in a PR comment and ask questions about the PR and the codebase. Use quoted replies to pass the context for follow-up questions. Examples:
    • @coderabbitai gather interesting statistics about this repository and render them in a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai generate unit tests for the src/utils.ts file.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between d36c363 and 9086d6d.
Files ignored due to filter (1)
  • apps/web/public/locales/en/app.json
Files selected for processing (1)
  • apps/web/src/components/time-zone-picker/time-zone-picker.tsx (3 hunks)
Additional comments: 3
apps/web/src/components/time-zone-picker/time-zone-picker.tsx (3)
  • 11-11: The addition of the useTranslation hook from "next-i18next" is appropriate for enabling i18n capabilities within the component.

  • 152-154: The use of the t function with the key "timeZonePicker__ignore" and a default value of "Ignore time zone" is correct. This allows for the label to be internationalized. Ensure that the translation key is added to the respective i18n resource files.

Verification successful

The shell script has successfully found the translation key "timeZonePicker__ignore" within a .json file, which indicates that the key has been added to at least one i18n resource file. This aligns with the requirement for the t function to work correctly, as it needs the translation keys to be present in the resource files to provide the necessary translations.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that the translation key exists in all i18n resource files.
fd '.*\.json$' --exec rg '"timeZonePicker__ignore":'

Length of output: 102

* 159-159: The dependency array for `useMemo` has been correctly updated to include the `t` function, ensuring that `timeZoneOptions` is recalculated when the language changes.

Copy link

vercel bot commented Dec 31, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 31, 2023 4:37am
landing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 31, 2023 4:37am

@lukevella
Copy link
Owner

LGTM. Thanks!

@lukevella lukevella merged commit 125ced4 into lukevella:main Dec 31, 2023
5 checks passed
@avm99963 avm99963 deleted the fix-i18n-timezone branch January 2, 2024 10:25
@avm99963
Copy link
Contributor Author

avm99963 commented Jan 2, 2024

You're welcome :) Happy new year and sending the best wishes for you and Rallly!

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.

None yet

2 participants