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 umlaute in translate.lang.js #2883

Merged
merged 2 commits into from
Oct 28, 2024
Merged

Fix umlaute in translate.lang.js #2883

merged 2 commits into from
Oct 28, 2024

Conversation

boppbo
Copy link
Contributor

@boppbo boppbo commented Oct 28, 2024

Description

Related Issue

None

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Alternate Designs

Change the charset of the complete file

Possible Drawbacks

None

Verification Process

None

Release Notes

Not applicable

Contributing checklist

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING and LICENSE document.
  • I fully agree to distribute my changes under Apache 2.0 license.

Summary by CodeRabbit

  • New Features
    • Introduced Tailscale VPN management within the web UI, allowing users to activate and configure the VPN.
    • Added German translations for Tailscale VPN functionality, including activation and authentication instructions.
  • Bug Fixes
    • Minor adjustments to existing translation entries for proper display of text.

Copy link

coderabbitai bot commented Oct 28, 2024

Walkthrough

The changes introduce new translations for the Tailscale VPN feature in the German language file of the RaspberryMatic WebUI. New entries provide labels and help text related to the VPN functionality and authentication process. Additionally, modifications were made to the configuration management code to incorporate the VPN status, including updates to several method signatures and the addition of new variables for handling VPN settings. Minor adjustments were also made to existing strings for proper display.

Changes

File Path Change Summary
buildroot-external/patches/occu/0136-WebUI-Add-Tailscale-VPN/.../translate.lang.js Added new translations for Tailscale VPN functionality, including labels and help text. Minor adjustments made to existing string encoding.
buildroot-external/patches/occu/0136-WebUI-Add-Tailscale-VPN.patch Introduced functionality for managing Tailscale VPN, including updates to configuration management methods and the addition of new variables.

Poem

In the realm of code, a rabbit hops,
Adding translations, never stops!
Tailscale's magic, in German it sings,
With VPN whispers, oh, what joy it brings!
Hopping through strings, with care and delight,
A seamless WebUI, shining so bright! 🐇✨


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.

@jens-maus jens-maus added 🏷️ WebUI This refs the WebUI component 🌱 minor This is a issue/ticket which can be easily fixed labels Oct 28, 2024
@jens-maus jens-maus added this to the next release milestone Oct 28, 2024
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 (4)
buildroot-external/patches/occu/0136-WebUI-Add-Tailscale-VPN.patch (4)

Line range hint 335-377: Consider disabling the 'Authentifizierung' button when VPN is inactive to prevent unintended clicks.

Currently, when VPN is inactive ($vpn != "1"), the 'Authentifizierung' button is styled with style="color:grey", but it remains clickable, which could confuse users. To improve user experience, you can disable the button or remove the onClick handler when VPN is inactive.

Apply this diff to remove the onClick handler when VPN is inactive:

                   if {$vpn == "1"} {
                     division {class="CLASS21117"} {onClick="window.open('/tailscale/', '_blank').focus();"} {
                       puts "\${dialogSettingsNetworkVPNLblAuth}"
                     }
                   } else {
-                    division {class="CLASS21117"} {style="color:grey"} {
+                    division {class="CLASS21117"} {style="color:grey"} {
                       puts "\${dialogSettingsNetworkVPNLblAuth}"
                     }
+                    # Removed onClick handler to disable the button
                   }

Alternatively, you can add pointer-events: none; to the style to make the button unclickable:

                     division {class="CLASS21117"} {style="color:grey; pointer-events: none;"} {
                       puts "\${dialogSettingsNetworkVPNLblAuth}"
                     }

Line range hint 723-734: Add error handling for VPN service start/stop commands.

The exec commands used to start and stop the Tailscale VPN service do not include error handling. If these commands fail, the user may not be informed, and the VPN status may not reflect the actual state.

Consider wrapping the exec commands in catch blocks to handle potential errors and provide feedback to the user.

Example:

# set vpn status
set cur_vpn [file exists "/etc/config/tailscaleEnabled"]
if { $vpn != $cur_vpn } {
  if { $vpn == 1 } {
    exec touch /etc/config/tailscaleEnabled
    if { [catch {exec /etc/init.d/S46tailscaled restart >/dev/null 2>/dev/null} err] } {
      # Handle error, e.g., log or notify user
    }
  } else {
    if { [catch {exec /etc/init.d/S46tailscaled stop >/dev/null 2>/dev/null} err] } {
      # Handle error
    }
    exec rm -f /etc/config/tailscaleEnabled
  }
}

Line range hint 695-698: Correct spelling of 'Authentication' in English translations.

The translation key "dialogSettingsNetworkVPNLblAuth" is set to "Authentification". The correct spelling in English is "Authentication".

Apply this diff to fix the spelling:

     "dialogSettingsNetworkVPNLblActivate" : "Tailscale VPN functionality",
-    "dialogSettingsNetworkVPNLblAuth" : "Authentification",
+    "dialogSettingsNetworkVPNLblAuth" : "Authentication",
     "dialogSettingsNetworkVPNHelpP1" : "The " + HMIdentifier.en.CCUFullNameText + " comes with internal VPN functionality...",

Line range hint 695-698: Improve wording and fix typos in English VPN help texts.

The help texts for the VPN functionality contain minor typos and awkward phrasing. Consider revising for clarity and correctness.

Suggested changes for "dialogSettingsNetworkVPNHelpP1" and "dialogSettingsNetworkVPNHelpP2":

  • Capitalize "WireGuard".
  • Change "security proof" to "security audited".
  • Correct "over centralized server" to "over centralized servers".
  • Improve sentence structure for clarity.

Apply this diff:

     "dialogSettingsNetworkVPNHelpP1" : "The " + HMIdentifier.en.CCUFullNameText + " comes with internal VPN functionality which allows it to be accessible from the Internet (e.g., via smartphone) using a secure VPN solution fully under your control. For this functionality, the secure <a href='https://tailscale.com/'>Tailscale</a> VPN solution is used, providing a zero-configuration method to easily integrate your devices into a WireGuard-based, decentralized, and cost-free user VPN. It is fully based on open-source software, security audited, and initiates point-to-point connections between your devices, ensuring that no user traffic is routed over centralized servers.",
     "dialogSettingsNetworkVPNHelpP2" : "To make your device available, you need to enable the Tailscale VPN functionality and use the 'Authentication' button to access the local authentication page. From there, you can log in with your existing Tailscale credentials and add this central unit to your private Tailscale VPN network, allowing all devices within that network to access it directly.",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c3b9f81 and dcee87b.

📒 Files selected for processing (1)
  • buildroot-external/patches/occu/0136-WebUI-Add-Tailscale-VPN.patch (2 hunks)
🔇 Additional comments (2)
buildroot-external/patches/occu/0136-WebUI-Add-Tailscale-VPN.patch (2)

Line range hint 205-209: Initialization of vpn variable and update of read_config function call.

The code correctly initializes the vpn variable and updates the read_config call to include it.


140-140: Ensure consistent percent-encoding of umlauts in translate.lang.js.

The change replaces "benötigt Neustart" with "ben%F6tigt Neustart", percent-encoding the 'ö' character. To ensure consistency and prevent display issues, verify that all umlauts in the file are percent-encoded similarly.

Run the following script to find instances of umlauts that are not percent-encoded:

@jens-maus jens-maus merged commit d5df55a into jens-maus:master Oct 28, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ WebUI This refs the WebUI component 🌱 minor This is a issue/ticket which can be easily fixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants