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

[Feat] Translated workspace selection component and added i18n support for multiple languages #8443

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

adkif
Copy link
Contributor

@adkif adkif commented Oct 16, 2024

PR

Please note: we will close your PR without comment if you do not check the boxes above and provide ALL requested information.


image

Summary by CodeRabbit

  • New Features

    • Enhanced localization support with dynamic text for multiple languages, including greetings and prompts for workspace selection.
    • New translation keys added for various languages to improve user experience.
  • Bug Fixes

    • Improved clarity and consistency of messages across different languages.

Copy link

coderabbitai bot commented Oct 16, 2024

Walkthrough

The changes in this pull request focus on enhancing localization support within the workspace selection component of the application. The static text strings in the workspace-selection.component.html file have been replaced with translation keys to facilitate dynamic language support. Additionally, multiple localization JSON files for various languages have been updated to include new key-value pairs reflecting the updated terminology and user prompts.

Changes

File Path Change Summary
packages/desktop-ui-lib/src/lib/login/shared/ui/workspace-selection/... Updated static text to use translation keys for localization in the workspace selection component.
packages/ui-core/i18n/assets/i18n/ar.json Added new keys for Arabic localization including greetings and prompts for workspace selection.
packages/ui-core/i18n/assets/i18n/bg.json Added new keys for Bulgarian localization including greetings and prompts for workspace selection.
packages/ui-core/i18n/assets/i18n/de.json Added new keys for German localization including greetings and prompts for workspace selection.
packages/ui-core/i18n/assets/i18n/en.json Added new keys for English localization including greetings and prompts for workspace selection.
packages/ui-core/i18n/assets/i18n/es.json Added new keys for Spanish localization including greetings and prompts for workspace selection.
packages/ui-core/i18n/assets/i18n/fr.json Added new keys for French localization including greetings and prompts for workspace selection.
packages/ui-core/i18n/assets/i18n/he.json Added new keys for Hebrew localization including greetings and prompts for workspace selection.
packages/ui-core/i18n/assets/i18n/it.json Added new keys for Italian localization including greetings and prompts for workspace selection.
packages/ui-core/i18n/assets/i18n/nl.json Added new keys for Dutch localization including greetings and prompts for workspace selection.
packages/ui-core/i18n/assets/i18n/pl.json Added new keys for Polish localization including greetings and prompts for workspace selection.
packages/ui-core/i18n/assets/i18n/pt.json Added new keys for Portuguese localization including greetings and prompts for workspace selection.
packages/ui-core/i18n/assets/i18n/ru.json Added new keys for Russian localization including greetings and prompts for workspace selection.
packages/ui-core/i18n/assets/i18n/zh.json Added new keys for Chinese localization including greetings and prompts for workspace selection.

Possibly related PRs

  • [Feat] Auto redirect to workspace selection #8412: The changes in this PR involve modifications to the NgxLoginComponent and NgxLoginWorkspaceComponent, which are related to the login process and workspace selection. The localization updates in the main PR enhance the user interface for these components, making them relevant to the changes in user prompts and messages.

Suggested reviewers

  • evereq
  • rahul-rocket

Poem

🐇 In the land of code where translations play,
New words have sprung up, brightening the day.
With keys for each language, our greetings now sing,
"Welcome back, dear user!"—oh, what joy they bring!
So hop along, friends, let’s open the door,
To a world of workspaces, and so much more! 🌍✨


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

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (10)
packages/desktop-ui-lib/src/lib/login/shared/ui/workspace-selection/workspace-selection.component.html (1)

9-9: Approved with a minor suggestion: Consider pluralizing 'WORKSPACE' in the translation key

The informational text has been successfully internationalized. However, for improved clarity and consistency, consider updating the translation key to use the plural form:

-{{ 'WORKSPACES.SELECTION.EMAIL_MULTIPLE_WORKSPACE' | translate }}
+{{ 'WORKSPACES.SELECTION.EMAIL_MULTIPLE_WORKSPACES' | translate }}

This change would better reflect the content of the message, which refers to multiple workspaces.

packages/ui-core/i18n/assets/i18n/zh.json (1)

Line range hint 1-4650: Overall, the Chinese translations are comprehensive and well-structured.

The zh.json file provides a thorough set of translations for what appears to be a complex application. The use of nested objects to organize related translations is a good practice, making the file more manageable and easier to navigate. The consistent use of placeholders (e.g., {{ name }}) for dynamic content is also commendable.

However, there are a few areas where the translations could be improved or clarified:

  1. Some translations might benefit from additional context. For example, in the "TIMESHEET" section, the translation for "TILL_NOW" (到现在为止) might be clearer as "截至目前" depending on the context.

  2. In some cases, technical terms are translated literally, which might not be the most natural in Chinese. For example, "DASHBOARD" is translated as "仪表盘", but "控制面板" might be more commonly used in software contexts.

  3. Consider adding comments for complex or context-dependent translations to help future maintainers understand the intended meaning and usage.

To improve maintainability and clarity, consider:

  1. Adding comments for complex translations or those highly dependent on context.
  2. Reviewing technical terms to ensure they use the most natural and commonly accepted Chinese translations in software contexts.
  3. Having a native Chinese speaker with technical background review the translations for naturalness and accuracy.
packages/ui-core/i18n/assets/i18n/ar.json (1)

4641-4648: New workspace-related translations added successfully.

The new translations for the workspace functionality have been added correctly. The Arabic translations seem appropriate and consistent with the existing style. However, there are a couple of minor suggestions:

  1. Consider adding a period (.) at the end of the "FIND_WORKSPACE" translation for consistency with other similar entries.
  2. In the "EMAIL_MULTIPLE_WORKSPACE" translation, consider using Arabic punctuation marks for a more localized feel.

Here's a suggested improvement for the "FIND_WORKSPACE" translation:

-		"FIND_WORKSPACE": "ابحث عن مساحتك الخاصة",
+		"FIND_WORKSPACE": "ابحث عن مساحتك الخاصة.",

And for the "EMAIL_MULTIPLE_WORKSPACE" translation:

-		"EMAIL_MULTIPLE_WORKSPACE": "البريد الإلكتروني مرتبط بعدة مساحات عمل، يرجى اختيار واحدة للمتابعة",
+		"EMAIL_MULTIPLE_WORKSPACE": "البريد الإلكتروني مرتبط بعدة مساحات عمل، يرجى اختيار واحدة للمتابعة.",
packages/ui-core/i18n/assets/i18n/bg.json (1)

Line range hint 1-4662: Overall, the Bulgarian translations are well-structured and appropriate.

The file contains comprehensive translations for various parts of the application, including the newly added workspace-related strings. The translations appear to be contextually appropriate and well-formatted.

Minor suggestion for consistency:
Consider adding a period at the end of the "FIND_WORKSPACE" translation to match the style of similar phrases in the file:

-"FIND_WORKSPACE": "Намерете вашето работно пространство"
+"FIND_WORKSPACE": "Намерете вашето работно пространство."

This change would make it consistent with other similar translations in the file that end with a period.

packages/ui-core/i18n/assets/i18n/nl.json (1)

Line range hint 4655-4657: Server-related translations and placeholder

The file includes translations for server-related items and a placeholder for a coming soon page:

"SERVER_API": "API Server",
"SERVER_API_LOG": "API Server Log",
"COMING_SOON": "This page is coming soon!"

Note that the "COMING_SOON" message is in English, while the rest of the file is in Dutch.

Consider translating the "COMING_SOON" message to Dutch for consistency:

-"COMING_SOON": "This page is coming soon!"
+"COMING_SOON": "Deze pagina komt binnenkort!"
packages/ui-core/i18n/assets/i18n/it.json (1)

Line range hint 1-4651: Overall file structure is maintained, with minor suggestions for improvement.

The Italian translation file maintains its structure and consistency throughout. However, there are a few suggestions for improvement:

  1. Consider adding comments to separate major sections of the translation file for better readability and maintenance.
  2. Ensure that all translation keys follow a consistent naming convention (e.g., all uppercase with underscores).
  3. Double-check that all translated strings are properly escaped, especially those containing special characters or apostrophes.

These minor improvements could enhance the maintainability of the translation file in the long run.

packages/ui-core/i18n/assets/i18n/pt.json (1)

Line range hint 4657-4657: English text found in Portuguese translation file.

The "COMING_SOON" translation is currently in English:

"COMING_SOON": "This page is coming soon!"

This should be translated to Portuguese to maintain consistency and avoid confusion for users.

Suggested correction:

"COMING_SOON": "Esta página estará disponível em breve!"

Please update this translation to ensure all content is in Portuguese.

packages/ui-core/i18n/assets/i18n/es.json (1)

Line range hint 4659-4659: Untranslated "COMING_SOON" message.

The "COMING_SOON" message at the end of the file has been left in English:

"COMING_SOON": "This page is coming soon!"

This should be translated to Spanish to maintain consistency with the rest of the file.

Suggested translation:

"COMING_SOON": "¡Esta página estará disponible pronto!"

Please update this line with the Spanish translation to ensure all content is properly localized.

packages/ui-core/i18n/assets/i18n/fr.json (1)

Line range hint 4659-4661: Translate "COMING_SOON" message to French

The translations for "SERVER_API" and "SERVER_API_LOG" are appropriate. However, the "COMING_SOON" message is still in English, which is inconsistent with the rest of the French translations in this file.

Consider translating the "COMING_SOON" message to French. A suggested translation would be:

-	"COMING_SOON": "This page is coming soon!"
+	"COMING_SOON": "Cette page sera bientôt disponible !"
packages/ui-core/i18n/assets/i18n/de.json (1)

4639-4646: New workspace selection translations look good!

The new translations for the workspace selection process have been added successfully. They provide a friendly and informative user experience in German.

For consistency, consider changing "Wähle Arbeitsbereich für" to "Arbeitsbereich auswählen für" to match the more formal tone used in other parts of the translation.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f4049cd and 9384fc3.

📒 Files selected for processing (14)
  • packages/desktop-ui-lib/src/lib/login/shared/ui/workspace-selection/workspace-selection.component.html (2 hunks)
  • packages/ui-core/i18n/assets/i18n/ar.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/bg.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/de.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/en.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/es.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/fr.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/he.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/it.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/nl.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/pl.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/pt.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/ru.json (1 hunks)
  • packages/ui-core/i18n/assets/i18n/zh.json (1 hunks)
🧰 Additional context used
🔇 Additional comments (28)
packages/desktop-ui-lib/src/lib/login/shared/ui/workspace-selection/workspace-selection.component.html (4)

5-7: LGTM: Welcome message successfully internationalized

The welcome message has been properly internationalized using appropriate translation keys. The structure maintains the original layout while allowing for multi-language support.


14-15: LGTM: Workspace selection prompt successfully internationalized

The workspace selection prompt has been properly internationalized while maintaining the dynamic insertion of the user's email address. This change effectively supports multi-language functionality while preserving personalization.


43-43: LGTM: 'Open' button text successfully internationalized

The 'Open' button text has been properly internationalized using an appropriate translation key. This change supports multi-language functionality while maintaining the existing button structure and styling.


Line range hint 1-54: Overall: Excellent implementation of i18n support for the workspace selection component

The changes in this file successfully implement internationalization support for the workspace selection component. All static text has been replaced with appropriate translation keys, following a consistent naming convention. The structure and functionality of the component have been preserved, ensuring that the changes only affect the text content for multi-language support.

These modifications align well with the PR objectives and will greatly enhance the application's ability to support multiple languages. Great job on maintaining consistency throughout the file and ensuring that the changes do not impact the existing functionality.

packages/ui-core/i18n/assets/i18n/ar.json (1)

Line range hint 1-4648: Overall, the Arabic translations are well-maintained and consistent.

The file packages/ui-core/i18n/assets/i18n/ar.json has been updated with new translations for the workspace functionality. These additions are generally well-integrated and consistent with the existing translations. Apart from the minor suggestions provided earlier, the file maintains good quality and consistency in its Arabic translations.

packages/ui-core/i18n/assets/i18n/he.json (1)

4633-4640: New workspace selection translations added successfully.

The new translations for the workspace selection process have been correctly added to the Hebrew localization file. These additions will improve the user experience for Hebrew-speaking users when selecting and managing workspaces.

packages/ui-core/i18n/assets/i18n/en.json (3)

Line range hint 1-4791: New workspace management translations added successfully.

The changes in this section introduce new translations for workspace-related functionality. The additions include:

  • Translations for signing in to workspaces
  • Creating new workspaces
  • Finding existing workspaces
  • Success and failure messages for workspace sign-in

These new translations are well-structured and consistent with the existing content. They will improve the user experience for workspace management features.


4792-4799: Workspace selection translations added successfully.

This section introduces new translations specifically for the workspace selection process:

  • Welcome back message
  • Friendly greeting ("You look nice today!")
  • Instructions for selecting a workspace when an email is associated with multiple workspaces
  • Label for the workspace selection action

These additions enhance the user experience during the workspace selection process and maintain a consistent, friendly tone.


Line range hint 4800-4816: Existing translations remain unchanged and consistent.

This final section of the file contains translations for various miscellaneous items, including:

  • Image-related messages
  • Server API labels
  • A "coming soon" message

These translations remain unchanged and do not conflict with the new workspace-related additions. The consistency of this section has been maintained.

packages/ui-core/i18n/assets/i18n/bg.json (1)

4653-4660: New workspace-related translations added successfully.

The following new keys have been added to the "WORKSPACES" section:

  • "FIND_WORKSPACE": "Намерете вашето работно пространство"
  • "SELECTION" subsection with various keys

These additions enhance the localization for the workspace selection component. The translations appear to be well-formed and contextually appropriate.

packages/ui-core/i18n/assets/i18n/ru.json (3)

4640-4641: New translation added for workspace search

The translation for "Find your workspaces" has been added in Russian. This is consistent with the application's internationalization efforts.


4641-4647: New translations added for workspace selection

Several new translations have been added under the "SELECTION" key, providing Russian translations for various messages related to workspace selection. These additions enhance the user experience for Russian-speaking users.


Line range hint 1-4647: LGTM! Translations successfully added

The new Russian translations for workspace-related functionality have been successfully added to the file. The changes are consistent with the existing structure and style of the translations. These additions will improve the user experience for Russian-speaking users when interacting with workspace features.

packages/ui-core/i18n/assets/i18n/nl.json (3)

4643-4644: New workspace-related translations added

The following new translations have been added for finding workspaces:

"FIND_WORKSPACE": "Vind je werkruimtes",

This addition is consistent with the existing structure and provides a Dutch translation for the "Find Workspace" functionality.


4645-4650: New selections-related translations added

New translations have been added under the "SELECTION" subsection:

"SELECTION": {
  "WELCOME_BACK": "Welkom terug!",
  "YOU_LOOK_NICE_TODAY": "Je ziet er vandaag goed uit!",
  "EMAIL_MULTIPLE_WORKSPACE": "De e-mail is gekoppeld aan meerdere werkruimtes, selecteer er een om verder te gaan",
  "SELECT_WORKSPACE_FOR": "Selecteer werkruimte voor",
  "OPEN": "Openen"
}

These additions provide Dutch translations for various messages related to workspace selection. The translations appear to be accurate and consistent with the existing style.


Line range hint 4651-4654: Existing translations for image-related messages

The following translations for image-related messages are present:

"NO_IMAGE": {
  "ADD_DROP": "Afbeelding toevoegen of verwijderen",
  "AVAILABLE": "Afbeelding niet beschikbaar"
}

These translations are consistent with the rest of the file and provide Dutch equivalents for image-related messages.

packages/ui-core/i18n/assets/i18n/pl.json (1)

4643-4650: New workspace selection translations added successfully!

The new translations for the workspace selection feature have been added correctly. These additions include:

  • A "Find your workspaces" message
  • A "Welcome back!" greeting
  • A compliment "You look nice today!"
  • Messages related to email association with multiple workspaces
  • Instructions for selecting a workspace
  • An "Open" action label

The translations appear to be grammatically correct and contextually appropriate. Good job on expanding the Polish language support for the workspace selection feature.

packages/ui-core/i18n/assets/i18n/it.json (2)

4643-4650: New workspace selection translations added successfully.

The new translations for workspace selection have been added correctly to the Italian language file. These additions include welcome messages, instructions for selecting a workspace, and related UI text. This enhancement will improve the user experience for Italian-speaking users when dealing with multiple workspaces.


Line range hint 1-4651: Changes implemented successfully with no major issues.

The addition of workspace selection translations to the Italian language file has been completed successfully. The new content is well-integrated into the existing structure, and no major issues were identified during the review. The file maintains its overall integrity and consistency.

The implemented changes will positively impact the user experience for Italian-speaking users, particularly when dealing with multiple workspaces. With the minor suggestions for improvement mentioned earlier, this update effectively enhances the localization support for the application.

packages/ui-core/i18n/assets/i18n/pt.json (3)

4643-4650: New workspace selection translations added successfully.

The following translations have been added to the "WORKSPACES.SELECTION" section:

  • Welcome back message
  • Compliment for the user
  • Instructions for selecting a workspace when an email is associated with multiple workspaces
  • Prompt to select a workspace
  • "Open" button text

These additions enhance the user experience for Portuguese-speaking users when interacting with workspace selection features.


Line range hint 4651-4654: New "NO_IMAGE" section added successfully.

A new section "NO_IMAGE" has been added with two translations:

  1. "ADD_DROP": For adding or removing an image
  2. "AVAILABLE": For indicating that an image is not available

These translations will improve user understanding when dealing with image-related features in the Portuguese version of the application.


Line range hint 4655-4656: New API server-related translations added.

Two new translations have been added:

  1. "SERVER_API": "Servidor API"
  2. "SERVER_API_LOG": "Log do servidor API"

These translations will help Portuguese-speaking users better understand references to the API server and its log in the application.

packages/ui-core/i18n/assets/i18n/es.json (3)

4645-4652: New workspace-related translations added successfully.

The new translations for the "WORKSPACES" section have been added correctly. These additions include:

  • A translation for finding a workspace
  • A "SELECTION" subsection with welcome messages and workspace selection prompts

The new translations are consistent with the existing style and structure of the file, which is good for maintainability.


Line range hint 4653-4656: New "NO_IMAGE" section added successfully.

A new "NO_IMAGE" section has been added to the translation file, providing Spanish translations for image-related messages. This addition is well-formatted and consistent with the rest of the file. These translations will likely be used in features related to image handling, such as upload interfaces or placeholder messages for missing images.


Line range hint 4657-4658: Server API-related translations added.

Two new translations have been added for server API-related terms:

  • "SERVER_API": "Servidor API"
  • "SERVER_API_LOG": "Registro del servidor API"

These additions are simple and clear, providing Spanish translations for what appear to be server API features or logs.

packages/ui-core/i18n/assets/i18n/fr.json (3)

Line range hint 1-4643: Comprehensive and well-structured translations

The French translations provided in this segment are extensive and well-organized. The JSON structure is correct, and the translations cover a wide range of UI elements, messages, and features. The consistency in tone and style suggests a professional translation effort.


4644-4651: Consistent workspace-related translations added

The newly added translations for workspace-related messages are consistent with the existing content in terms of structure and style. These additions will improve the user experience for French-speaking users when interacting with workspace features.


Line range hint 4652-4658: Appropriate translations for image-related messages

The translations for "NO_IMAGE" related messages are appropriate and consistent with the overall style of the document. The JSON structure is correct, and the content is relevant.

Copy link

nx-cloud bot commented Oct 16, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 9384fc3. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


🟥 Failed Commands
nx build desktop --prod --base-href ./
nx build gauzy -c=production --prod --verbose
✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@rahul-rocket rahul-rocket merged commit 06042ce into develop Oct 16, 2024
16 of 20 checks passed
@rahul-rocket rahul-rocket deleted the fix/workspace-selection-translation branch October 16, 2024 10:26
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