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

Translations update from Hosted Weblate #811

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

weblate
Copy link
Contributor

@weblate weblate commented Aug 9, 2024

Translations update from Hosted Weblate for Spook/Inverse helper.

Current translation status:

Weblate translation status

Copy link

coderabbitai bot commented Aug 9, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The update introduces structured JSON configurations in multiple translation files for the spook_inverse integration. New files for Afrikaans, Finnish, Estonian, Korean, Chinese (Simplified and Traditional), and changes in Norwegian enhance localization by providing detailed settings for binary sensors and switches. Each file now includes comprehensive sections for config, options, and user descriptions, improving accessibility and usability for various language speakers.

Changes

Files Change Summary
custom_components/spook/integrations/spook_inverse/... Added new translation files af.json, fi.json, et.json, ko.json, zh_Hans.json, and zh_Hant.json, each containing structured JSON configurations for binary_sensor and switch, including properties like entity_id, hide_source, and name, along with user descriptions and menu options.
custom_components/spook/integrations/spook_inverse/... Updated nb_NO.json to rename keys related to entity ID and source hiding options for Norwegian translations.
custom_components/spook/integrations/spook_inverse/... Updated pt.json to append a ghost emoji (👻) to various titles in the configuration and options sections.
custom_components/spook/integrations/spook_inverse/... Created a new empty file mt.json for Maltese translations.

Poem

🐰 In the digital glade where sensors play,
New options bloom like flowers in the day.
With a hop and a skip, they dance in delight,
Reversing their roles, making everything right.
So let’s cheer for the change, let joy take its flight! 🌸✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bc865da and e02539b.

📒 Files selected for processing (1)
  • custom_components/spook/integrations/spook_inverse/translations/mt.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • custom_components/spook/integrations/spook_inverse/translations/mt.json

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d9bac56 and 5687c40.

Files selected for processing (1)
  • custom_components/spook/integrations/spook_inverse/translations/et.json (1 hunks)
Additional comments not posted (2)
custom_components/spook/integrations/spook_inverse/translations/et.json (2)

2-29: The config section is well-structured and complete.

The JSON structure for configuring binary sensors and switches is logically organized, with clear and descriptive keys. The localization appears accurate.


30-39: The options section is consistent and well-organized.

The structure mirrors the config section, providing additional configurability for binary sensors. The localization and organization are clear and accurate.

@weblate weblate force-pushed the weblate-spook-inverse-helper branch from 5687c40 to 46fa6b3 Compare August 12, 2024 10:57
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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5687c40 and 46fa6b3.

Files selected for processing (2)
  • custom_components/spook/integrations/spook_inverse/translations/et.json (1 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/ko.json (1 hunks)
Additional comments not posted (2)
custom_components/spook/integrations/spook_inverse/translations/ko.json (1)

1-11: Well-structured JSON configuration for Korean translations.

The new JSON structure for binary sensors is correctly localized and enhances the configuration options for Korean-speaking users. The structure is clear and well-organized.

custom_components/spook/integrations/spook_inverse/translations/et.json (1)

1-40: Comprehensive JSON configuration for Estonian translations.

The new JSON structure provides detailed configuration and options for binary sensors and switches, enhancing usability for Estonian-speaking users. The organization and localization are well-executed.

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 46fa6b3 and 716623b.

Files selected for processing (1)
  • custom_components/spook/integrations/spook_inverse/translations/ko.json (1 hunks)
Additional comments not posted (6)
custom_components/spook/integrations/spook_inverse/translations/ko.json (6)

4-11: Check the translation consistency for binary_sensor.

Ensure that the translation for "출처 구성요소" (source component) and "출처 구성요소 숨김" (hide source) is consistent across similar contexts.


12-19: Verify the translation and structure for switch.

The structure and translations for switch should match the intended functionality. Ensure consistency with binary_sensor.


20-27: Ensure correctness of user object translations.

The description and menu_options should accurately reflect the functionality for reversing states. Verify the appropriateness of the translations.


32-39: Ensure consistency in binary_sensor options.

The options for binary_sensor should maintain consistency with the config section. Verify translation accuracy.


40-47: Verify switch options structure and translations.

Ensure that the switch options are consistent with the config section and translations are accurate.


50-50: Verify the appropriateness of the title.

Ensure that the title "반전 👻" (Reversal 👻) is suitable for the context and consistent throughout the application.

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 716623b and 24def5d.

Files selected for processing (1)
  • custom_components/spook/integrations/spook_inverse/translations/fi.json (1 hunks)
Files skipped from review due to trivial changes (1)
  • custom_components/spook/integrations/spook_inverse/translations/fi.json

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 24def5d and 9eb246f.

Files selected for processing (1)
  • custom_components/spook/integrations/spook_inverse/translations/fi.json (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • custom_components/spook/integrations/spook_inverse/translations/fi.json

@weblate weblate force-pushed the weblate-spook-inverse-helper branch from 9eb246f to 9f762b9 Compare August 28, 2024 19:09
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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9eb246f and 9f762b9.

Files selected for processing (4)
  • custom_components/spook/integrations/spook_inverse/translations/ca.json (1 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/et.json (1 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/fi.json (1 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/ko.json (1 hunks)
Files skipped from review due to trivial changes (1)
  • custom_components/spook/integrations/spook_inverse/translations/fi.json
Additional comments not posted (8)
custom_components/spook/integrations/spook_inverse/translations/ca.json (2)

2-15: LGTM!

The config section is correctly structured and the data fields are appropriately named.

The code changes are approved.


16-29: LGTM!

The options section is correctly structured and the data fields are appropriately named.

The code changes are approved.

custom_components/spook/integrations/spook_inverse/translations/et.json (3)

2-29: LGTM!

The config section is correctly structured and the data fields are appropriately named.

The code changes are approved.


30-39: LGTM!

The options section is correctly structured and the data fields are appropriately named.

The code changes are approved.


20-27: LGTM!

The user section is correctly structured and the descriptions are clear.

The code changes are approved.

custom_components/spook/integrations/spook_inverse/translations/ko.json (3)

2-29: LGTM!

The config section is correctly structured and the data fields are appropriately named.

The code changes are approved.


30-49: LGTM!

The options section is correctly structured and the data fields are appropriately named.

The code changes are approved.


20-27: LGTM!

The user section is correctly structured and the descriptions are clear.

The code changes are approved.

@weblate weblate force-pushed the weblate-spook-inverse-helper branch 2 times, most recently from 9162d58 to f3762a2 Compare September 20, 2024 13:21
Copy link

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 (1)
custom_components/spook/integrations/spook_inverse/translations/zh_Hant.json (1)

20-28: LGTM: User section with clear explanations

The user section is well-translated and provides clear explanations for the integration's functionality. The description effectively communicates the purpose of the tool.

Consider adding a space between "二級" and "製" in line 22 to correct a potential typo:

-                    "binary_sensor": "翻轉二級製傳感器",
+                    "binary_sensor": "翻轉二級 製傳感器",

Alternatively, if "二級製" is intentional, please verify its correctness in the context of binary sensors.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0d63604 and 0312cc6.

Files selected for processing (2)
  • custom_components/spook/integrations/spook_inverse/translations/zh_Hans.json (1 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/zh_Hant.json (1 hunks)
Additional comments not posted (8)
custom_components/spook/integrations/spook_inverse/translations/zh_Hans.json (4)

2-19: LGTM: Consistent and appropriate translations for binary_sensor and switch configurations.

The translations for the binary_sensor and switch configurations are consistent and appear to be appropriate for their respective fields. The use of "翻转 👻" (Flip 👻) as the title is creative and aligns with the "Spook" theme of the integration.


20-27: LGTM: Informative user configuration with clear menu options.

The user configuration section provides a clear and informative description of the integration's functionality. The menu options correctly correspond to the available configurations (switch and binary sensor). The translations are appropriate and consistent with the rest of the file.


31-50: LGTM: Consistent translations in options section.

The options section correctly mirrors the structure and translations of the config section for both binary_sensor and switch. This consistency is beneficial for the user experience, as it maintains the same terminology and structure throughout the configuration process.


1-51: LGTM: Well-structured and consistent Simplified Chinese translations.

The translation file for the spook_inverse integration in Simplified Chinese is well-structured, consistent, and comprehensive. It covers all necessary elements for configuration, options, and user interface. The translations appear to be of good quality and maintain a consistent style throughout the file. The use of the ghost emoji (👻) adds a playful touch that aligns well with the "Spook" theme of the integration.

custom_components/spook/integrations/spook_inverse/translations/zh_Hant.json (4)

1-19: LGTM: Config section for binary_sensor and switch

The config section for both binary_sensor and switch components is well-structured and consistently translated. The use of the ghost emoji (👻) in the title "翻轉 👻" (Flip 👻) adds a nice touch that aligns with the "Spook" theme of the integration.


30-49: LGTM: Options section maintains consistency

The options section for both binary_sensor and switch components maintains consistency with the config section. This consistency in structure and translations is beneficial for user experience and understanding.


50-51: LGTM: Concise and consistent title

The title "翻轉 👻" (Flip 👻) is concise, consistent with other sections, and effectively conveys the purpose of the integration while maintaining the playful "Spook" theme.


1-51: Overall: Well-structured and consistent translations

The zh_Hant.json file provides clear and consistent translations for the spook_inverse integration. The structure is well-organized, following JSON best practices, and the translations effectively convey the functionality of the integration. The use of the ghost emoji (👻) adds a playful touch that aligns with the "Spook" theme.

There's only one minor suggestion regarding a potential typo in the binary_sensor menu option, which should be verified. Otherwise, this translation file is ready for implementation and will contribute to a positive user experience for Traditional Chinese users.

@weblate weblate force-pushed the weblate-spook-inverse-helper branch from 0312cc6 to 27c9c74 Compare November 12, 2024 04:00
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: 6

🧹 Outside diff range and nitpick comments (5)
custom_components/spook/integrations/spook_inverse/translations/et.json (1)

4-19: Consider maintaining consistent field ordering across similar components

The field ordering differs between the binary_sensor and switch configurations. While this doesn't affect functionality, consistent ordering improves maintainability.

Consider reordering the switch fields to match the binary_sensor order:

            "switch": {
                "data": {
-                    "hide_source": "Peida lähteolem",
-                    "name": "Nimi",
-                    "entity_id": "Lähteolem"
+                    "entity_id": "Lähteolem",
+                    "hide_source": "Peida lähteolem",
+                    "name": "Nimi"
                },
                "title": "Pööra ümber"
            },
custom_components/spook/integrations/spook_inverse/translations/zh_Hans.json (1)

2-29: Consider using translation references to reduce duplication

The translation structure for binary_sensor and switch is identical in both config and options sections. Consider using translation references to maintain consistency and reduce duplication.

Example approach:

{
    "common": {
        "entity_fields": {
            "entity_id": "源实体",
            "hide_source": "隐藏源实体",
            "name": "名称"
        }
    },
    "config": {
        "step": {
            "binary_sensor": {
                "data": "@:common.entity_fields",
                "title": "翻转 👻"
            }
            // ... rest of the config
        }
    }
}

Also applies to: 31-50

custom_components/spook/integrations/spook_inverse/translations/zh_Hant.json (1)

41-46: Maintain consistent property ordering

The order of properties in the switch section differs from the binary_sensor section. For consistency, consider maintaining the same order (data before title) across all sections.

             "switch": {
-                "title": "翻轉 👻",
                 "data": {
                     "entity_id": "源實體",
                     "hide_source": "隱藏源實體",
                     "name": "名稱"
-                }
+                },
+                "title": "翻轉 👻"
             }
custom_components/spook/integrations/spook_inverse/translations/ko.json (1)

6-8: Maintain consistent field order across components

The field order in the data objects differs between binary_sensor and switch. Consider maintaining the same order for better maintainability:

  "binary_sensor": {
    "data": {
-     "entity_id": "출처 구성요소",
-     "hide_source": "출처 구성요소 숨김",
-     "name": "이름"
+     "name": "이름",
+     "entity_id": "출처 구성요소",
+     "hide_source": "출처 구성요소 숨김"
    }
  }

Also applies to: 14-16

custom_components/spook/integrations/spook_inverse/translations/nb_NO.json (1)

Line range hint 1-50: Ensure consistent terminology throughout the file.

The compound word changes are not consistently applied across all sections:

  • Not updated in config.step.binary_sensor.data
  • Not updated in options.step.switch.data

Apply this diff to maintain consistency:

     "config": {
         "step": {
             "binary_sensor": {
                 "data": {
                     "name": "Navn",
-                    "entity_id": "Kilde entitet",
-                    "hide_source": "Gjem kilde entitet"
+                    "entity_id": "Kildeentitet",
+                    "hide_source": "Gjem kildeentitet"
                 },
             },
             "switch": {
                 "data": {
                     "entity_id": "Kildeentitet",
-                    "hide_source": "Gjem kilde entitet",
+                    "hide_source": "Gjem kildeentitet",
                     "name": "Navn"
                 },
             },
         }
     },
     "options": {
         "step": {
             "switch": {
                 "data": {
-                    "entity_id": "Kilde entitet",
-                    "hide_source": "Gjem kilde entitet",
+                    "entity_id": "Kildeentitet",
+                    "hide_source": "Gjem kildeentitet",
                     "name": "Navn"
                 },
             }
         }
     }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 0312cc6 and 27c9c74.

📒 Files selected for processing (9)
  • custom_components/spook/integrations/spook_inverse/translations/af.json (1 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/ca.json (1 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/et.json (1 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/fi.json (1 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/id.json (1 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/ko.json (1 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/nb_NO.json (2 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/zh_Hans.json (1 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/zh_Hant.json (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • custom_components/spook/integrations/spook_inverse/translations/af.json
  • custom_components/spook/integrations/spook_inverse/translations/fi.json
🔇 Additional comments (8)
custom_components/spook/integrations/spook_inverse/translations/ca.json (1)

1-30: LGTM! Well-structured translation file.

The JSON structure follows Home Assistant's translation schema correctly with proper nesting for configuration and options.

custom_components/spook/integrations/spook_inverse/translations/et.json (1)

20-27: LGTM! Clear and well-structured user configuration

The user configuration section provides clear Estonian translations with a comprehensive description and properly aligned menu options.

custom_components/spook/integrations/spook_inverse/translations/zh_Hans.json (1)

1-51: LGTM: Well-structured translation file

The JSON structure follows Home Assistant's translation file conventions with proper organization of config and options sections.

custom_components/spook/integrations/spook_inverse/translations/zh_Hant.json (1)

1-51: Verify translation consistency across language files

The translations appear complete and well-structured. Let's verify the consistency of keys and structure across all language files.

✅ Verification successful

Translation structure and emoji usage are consistent

The verification shows that:

  • The zh_Hant.json file has all the required translation keys matching the standard structure
  • The ghost emoji (👻) is consistently used across all active translation files
  • The translation structure follows Home Assistant's schema with all necessary configuration and options paths
  • All key hierarchies are properly maintained across translations
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for consistency across translation files
# Expected results: All files should have the same structure and keys

# Find all translation files
translation_files=$(fd . custom_components/spook/integrations/spook_inverse/translations/ -e json)

# Check if all files have the same keys structure
for file in $translation_files; do
  echo "=== Checking structure of $file ==="
  # Extract and sort keys hierarchically
  jq -r 'path(..|select(type=="string")) | join(".")' "$file" | sort
done

# Verify emoji consistency
echo "=== Checking emoji usage ==="
rg -l "👻" custom_components/spook/integrations/spook_inverse/translations/

Length of output: 40083

custom_components/spook/integrations/spook_inverse/translations/ko.json (2)

30-49: Options section structure looks good

The options section correctly mirrors the config section structure, maintaining consistency throughout the file.


1-51: Verify translation structure consistency across languages

The Korean translations appear correct and well-structured. Let's verify that this structure is consistent across other language files.

✅ Verification successful

Translation structure is consistent with other complete translations

The Korean translation file follows the same structure as other complete translation files in the repository:

  • Contains all required top-level keys: config, options, and title
  • Has the correct config.step structure with binary_sensor, switch, and user sections
  • Has the correct options.step structure with binary_sensor and switch sections

The structure matches the reference English translation and other fully translated files like German (de), French (fr), Spanish (es), etc. Some translation files are empty (bg, he, ja, etc.) but this doesn't affect the verification of the Korean translation's structure.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if all translation files follow the same structure
# Expected: All files should have the same JSON structure with different translations

# Find all translation files
translation_files=$(fd . custom_components/spook/integrations/spook_inverse/translations/ -e json)

# Extract and compare structure (removing actual translations, keeping only keys)
for file in $translation_files; do
  echo "=== Structure of $file ==="
  cat "$file" | jq 'walk(if type == "object" then with_entries(.key) else . end)' 
done

Length of output: 19986


Script:

#!/bin/bash
# Let's try a simpler approach to compare structure
# Get the structure of en.json as reference
echo "=== Reference structure (en.json) ==="
cat custom_components/spook/integrations/spook_inverse/translations/en.json | jq 'keys'
echo "=== Checking all files have same top-level keys ==="
for file in custom_components/spook/integrations/spook_inverse/translations/*.json; do
  echo "=== $(basename "$file") ==="
  cat "$file" | jq 'keys'
  # Check config structure
  echo "Config structure:"
  cat "$file" | jq '.config.step | keys'
  # Check options structure
  echo "Options structure:"
  cat "$file" | jq '.options.step | keys'
done

Length of output: 28949

custom_components/spook/integrations/spook_inverse/translations/nb_NO.json (1)

14-14: LGTM: Improved Norwegian grammar by removing spaces in compound words.

The changes from "Kilde entitet" to "Kildeentitet" and "Gjem kilde entitet" to "Gjem kildeentitet" align with proper Norwegian compound word formation.

Also applies to: 34-35

custom_components/spook/integrations/spook_inverse/translations/id.json (1)

30-49: LGTM! Well-structured translation additions

The new options section is well-structured and maintains consistency with the config section. The translations are professionally done and maintain the expected format for the integration.

"step": {
"binary_sensor": {
"data": {
"name": "Nom"
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Translation consistency needs attention in Catalan files

The verification reveals inconsistent translation patterns for "name" across Catalan files:

  • In custom_components/spook/integrations/spook_inverse/translations/ca.json, "name" is consistently translated as "Nom"
  • However, in custom_components/spook/translations/ca.json, "name" fields contain direct entity/feature names in Catalan without using the standard "Nom" translation

This inconsistency should be addressed to maintain a uniform translation approach across the codebase.

🔗 Analysis chain

Verify translation consistency across Catalan files

The translation "Nom" for "Name" is correct in Catalan. Let's verify its consistent usage across other Catalan translation files in the project.

Also applies to: 11-11, 20-20, 25-25

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check consistency of "Nom" translation across Catalan files
# Expected: All Catalan translation files should use "Nom" for name fields

# Find all Catalan translation files and check for "name" translations
fd -e json -x sh -c 'if grep -l "ca\.json$" <<< "{}" >/dev/null; then echo "=== {}:"; jq -r ".. | .name? // empty" "{}"; fi'

Length of output: 3734


Script:

#!/bin/bash
# Let's try a simpler approach to find and check Catalan translation files
# First find all ca.json files
fd "ca.json$" 

# Then let's examine their content specifically looking for name translations
fd "ca.json$" -x grep -H "\"name\":" {}

Length of output: 5854

Comment on lines +30 to +39
"options": {
"step": {
"binary_sensor": {
"data": {
"entity_id": "Lähteolem",
"hide_source": "Peida lähteolem"
}
}
}
}
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Missing 'switch' option in Estonian (et) translation file

The Estonian translation file is missing the 'switch' option in its options section, while most other complete translation files include both 'binary_sensor' and 'switch' options. This inconsistency should be addressed.

  • custom_components/spook/integrations/spook_inverse/translations/et.json: Add missing 'switch' option section to match other translation files
🔗 Analysis chain

Verify options section completeness across translations

The options section only includes binary_sensor configuration while the config section includes both binary_sensor and switch. Let's verify this is consistent across other language files.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if other language files have the same options structure
# Expected: All translation files should have consistent options structure

# Find all translation files in the same directory
find custom_components/spook/integrations/spook_inverse/translations -name "*.json" -exec sh -c '
    echo "Checking $1:"
    jq -r ".options.step | keys[]" "$1" 2>/dev/null || echo "No options.step found"
    echo "---"
' sh {} \;

Length of output: 4536

"description": "此工具帮您翻转一个实体的表现。例如,翻转二进制传感器和开关的开/关状态。",
"menu_options": {
"switch": "翻转开关",
"binary_sensor": "翻转二级制传感器"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix typo in Chinese translation

The term "二级制" should be "二进制" (binary) to maintain consistency with standard Chinese technical terminology.

-                    "binary_sensor": "翻转二级制传感器"
+                    "binary_sensor": "翻转二进制传感器"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"binary_sensor": "翻转二级制传感器"
"binary_sensor": "翻转二进制传感器"

Comment on lines +1 to +51
{
"config": {
"step": {
"binary_sensor": {
"data": {
"entity_id": "源实体",
"hide_source": "隐藏源实体",
"name": "名称"
},
"title": "翻转 👻"
},
"switch": {
"data": {
"entity_id": "源实体",
"hide_source": "隐藏源实体",
"name": "名称"
},
"title": "翻转 👻"
},
"user": {
"description": "此工具帮您翻转一个实体的表现。例如,翻转二进制传感器和开关的开/关状态。",
"menu_options": {
"switch": "翻转开关",
"binary_sensor": "翻转二级制传感器"
},
"title": "翻转 👻"
}
}
},
"title": "翻转 👻",
"options": {
"step": {
"binary_sensor": {
"data": {
"entity_id": "源实体",
"hide_source": "隐藏源实体",
"name": "名称"
},
"title": "翻转 👻"
},
"switch": {
"data": {
"entity_id": "源实体",
"hide_source": "隐藏源实体",
"name": "名称"
},
"title": "翻转 👻"
}
}
}
}
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Translation structure inconsistencies found across language files

Several inconsistencies in the translation file structures:

  • Empty translation files: sl.json, uk.json, ro.json, th.json, ja.json, lb.json, he.json, bg.json
  • Missing options section: ar.json
  • Missing switch section in options: et.json
  • Missing user section in config steps: ca.json

The zh_Hans.json file follows the complete structure as seen in en.json (reference), but other language files need to be updated for consistency.

🔗 Analysis chain

Verify translation structure consistency across languages

While this file's translations are internally consistent, we should verify that the structure matches other language files.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Compare structure of translation files to ensure consistency
# Expected: All translation files should have the same structure (keys)

# Get the structure of this file (removing actual translations, keeping only keys)
echo "Structure of zh_Hans.json:"
cat "custom_components/spook/integrations/spook_inverse/translations/zh_Hans.json" | jq 'walk(if type == "object" then with_entries(select(.value | type != "string")) else . end)'

# Compare with other translation files
echo -e "\nChecking other translation files:"
fd -e json . "custom_components/spook/integrations/spook_inverse/translations" --exec sh -c 'echo "=== {} ==="; cat {} | jq "walk(if type == \"object\" then with_entries(select(.value | type != \"string\")) else . end)"'

Length of output: 13786

},
"user": {
"menu_options": {
"binary_sensor": "翻轉二級製傳感器",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix incorrect translation for "binary sensor"

The current translation "二級製傳感器" appears to be incorrect. The standard Traditional Chinese translation for "binary sensor" should be "二進制傳感器".

-                    "binary_sensor": "翻轉二級製傳感器",
+                    "binary_sensor": "翻轉二進制傳感器",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"binary_sensor": "翻轉二級製傳感器",
"binary_sensor": "翻轉二進制傳感器",

Comment on lines +40 to +47
"switch": {
"data": {
"entity_id": "Entitas sumber",
"hide_source": "Sembunyikan entitas sumber",
"name": "Nama"
},
"title": "Kebalikannya 👻"
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix inconsistent translation of switch title

There's an inconsistency in the switch titles between the config and options sections:

  • Config section uses: "Inverse 👻"
  • Options section uses: "Kebalikannya 👻"

For consistency, both sections should use the same translation.

Apply this diff to fix the inconsistency:

             "switch": {
                 "data": {
                     "entity_id": "Entitas sumber",
                     "hide_source": "Sembunyikan entitas sumber",
                     "name": "Nama"
                 },
-                "title": "Kebalikannya 👻"
+                "title": "Inverse 👻"
             }

Committable suggestion skipped: line range outside the PR's diff.

@weblate weblate force-pushed the weblate-spook-inverse-helper branch from 27c9c74 to 483f518 Compare November 18, 2024 02:00
indkilech and others added 13 commits December 12, 2024 22:06
Currently translated at 66.6% (14 of 21 strings)

Translation: Spook/Inverse helper
Translate-URL: https://hosted.weblate.org/projects/spook/inverse-helper/et/
Currently translated at 4.7% (1 of 21 strings)

Translation: Spook/Inverse helper
Translate-URL: https://hosted.weblate.org/projects/spook/inverse-helper/ko/
Currently translated at 100.0% (21 of 21 strings)

Translation: Spook/Inverse helper
Translate-URL: https://hosted.weblate.org/projects/spook/inverse-helper/ko/
Currently translated at 100.0% (21 of 21 strings)

Translation: Spook/Inverse helper
Translate-URL: https://hosted.weblate.org/projects/spook/inverse-helper/fi/
Currently translated at 19.0% (4 of 21 strings)

Translation: Spook/Inverse helper
Translate-URL: https://hosted.weblate.org/projects/spook/inverse-helper/ca/
Currently translated at 100.0% (21 of 21 strings)

Translation: Spook/Inverse helper
Translate-URL: https://hosted.weblate.org/projects/spook/inverse-helper/id/
Currently translated at 100.0% (21 of 21 strings)

Translation: Spook/Inverse helper
Translate-URL: https://hosted.weblate.org/projects/spook/inverse-helper/af/
Currently translated at 19.0% (4 of 21 strings)

Translation: Spook/Inverse helper
Translate-URL: https://hosted.weblate.org/projects/spook/inverse-helper/zh_Hans/
Currently translated at 100.0% (21 of 21 strings)

Translation: Spook/Inverse helper
Translate-URL: https://hosted.weblate.org/projects/spook/inverse-helper/zh_Hans/
Currently translated at 100.0% (21 of 21 strings)

Translation: Spook/Inverse helper
Translate-URL: https://hosted.weblate.org/projects/spook/inverse-helper/zh_Hant/
Currently translated at 100.0% (21 of 21 strings)

Translation: Spook/Inverse helper
Translate-URL: https://hosted.weblate.org/projects/spook/inverse-helper/nb_NO/
CaCoZA and others added 2 commits December 12, 2024 22:06
Currently translated at 33.3% (7 of 21 strings)

Translation: Spook/Inverse helper
Translate-URL: https://hosted.weblate.org/projects/spook/inverse-helper/pt/
Currently translated at 100.0% (21 of 21 strings)

Translation: Spook/Inverse helper
Translate-URL: https://hosted.weblate.org/projects/spook/inverse-helper/fi/
@weblate weblate force-pushed the weblate-spook-inverse-helper branch from 483f518 to 9879dce Compare December 12, 2024 21:06
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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 483f518 and 9879dce.

📒 Files selected for processing (10)
  • custom_components/spook/integrations/spook_inverse/translations/af.json (1 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/ca.json (1 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/et.json (1 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/fi.json (1 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/id.json (1 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/ko.json (1 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/nb_NO.json (2 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/pt.json (2 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/zh_Hans.json (1 hunks)
  • custom_components/spook/integrations/spook_inverse/translations/zh_Hant.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (9)
  • custom_components/spook/integrations/spook_inverse/translations/af.json
  • custom_components/spook/integrations/spook_inverse/translations/ca.json
  • custom_components/spook/integrations/spook_inverse/translations/fi.json
  • custom_components/spook/integrations/spook_inverse/translations/pt.json
  • custom_components/spook/integrations/spook_inverse/translations/ko.json
  • custom_components/spook/integrations/spook_inverse/translations/zh_Hans.json
  • custom_components/spook/integrations/spook_inverse/translations/zh_Hant.json
  • custom_components/spook/integrations/spook_inverse/translations/nb_NO.json
  • custom_components/spook/integrations/spook_inverse/translations/id.json
🔇 Additional comments (2)
custom_components/spook/integrations/spook_inverse/translations/et.json (2)

2-29: LGTM! Config section is well-structured and complete

The configuration section includes proper Estonian translations for all necessary UI elements, with consistent naming patterns across binary_sensor and switch components.


30-39: ⚠️ Potential issue

Missing 'switch' option in Estonian translation file

The options section is missing the 'switch' configuration while it exists in the config section. This inconsistency should be addressed.

Add the missing switch options section:

    "options": {
        "step": {
            "binary_sensor": {
                "data": {
                    "entity_id": "Lähteolem",
                    "hide_source": "Peida lähteolem"
                }
            },
+           "switch": {
+               "data": {
+                   "entity_id": "Lähteolem",
+                   "hide_source": "Peida lähteolem"
+               }
+           }
        }
    }

Comment on lines +1 to +40
{
"config": {
"step": {
"binary_sensor": {
"data": {
"entity_id": "Lähteolem",
"hide_source": "Peida lähteolem",
"name": "Nimi"
},
"title": "Pööra ümber"
},
"switch": {
"data": {
"hide_source": "Peida lähteolem",
"name": "Nimi",
"entity_id": "Lähteolem"
},
"title": "Pööra ümber"
},
"user": {
"description": "See abimees võimaldab olemi käitumist ümber pöörata. Näiteks pöörake binaarandurite ja lülitite avatud/suletud või sisse/välja.",
"title": "Pööra ümber",
"menu_options": {
"binary_sensor": "Binaaranduri ümberpööramine",
"switch": "Lüliti ümberpööramine"
}
}
}
},
"options": {
"step": {
"binary_sensor": {
"data": {
"entity_id": "Lähteolem",
"hide_source": "Peida lähteolem"
}
}
}
}
}
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Estonian translation file is incomplete

The Estonian (et.json) translation file is missing several keys that are present in other language files:

  • Missing options.step.binary_sensor.data.name
  • Missing options.step.binary_sensor.title
  • Missing options.step.switch.data.entity_id
  • Missing options.step.switch.data.hide_source
  • Missing options.step.switch.data.name
  • Missing options.step.switch.title
  • Missing title
🔗 Analysis chain

Verify translation consistency across the file

Let's ensure that similar terms are translated consistently throughout the file.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for translation consistency across the file
# Expected: Similar terms should have consistent translations

# Extract and compare translations for similar fields
jq -r '
  def get_translations:
    [
      (.config.step.binary_sensor.data | to_entries[]),
      (.config.step.switch.data | to_entries[])
    ] | sort_by(.key) | group_by(.key) | .[] |
    select(length > 1) |
    (.[0].key) as $key |
    if (map(.value) | unique | length) > 1 then
      "Inconsistent translations found for \($key): \(map(.value | tostring) | join(" vs "))"
    else
      empty
    end;
  get_translations
' custom_components/spook/integrations/spook_inverse/translations/et.json

# Compare with other language files to verify completeness
for f in custom_components/spook/integrations/spook_inverse/translations/*.json; do
  echo "Checking completeness of $(basename $f):"
  jq -r 'path(..|select(type=="string")) | join(".")' "$f" | sort | uniq
  echo "---"
done

Length of output: 36318

Currently translated at 80.9% (17 of 21 strings)

Translation: Spook/Inverse helper
Translate-URL: https://hosted.weblate.org/projects/spook/inverse-helper/sv/
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 (1)
custom_components/spook/integrations/spook_inverse/translations/sv.json (1)

Line range hint 33-45: Fix inconsistent translations in options section

The translations in the options section still use the old, longer format while the config section uses the new, more concise format. This inconsistency should be fixed.

Apply this diff to maintain consistency:

             "binary_sensor": {
                 "data": {
-                    "entity_id": "Källa för entitet",
-                    "hide_source": "Dölj källa för entitet",
+                    "entity_id": "Källenhet",
+                    "hide_source": "Dölj källenhet",
                     "name": "Namn"
                 },
                 "title": "Invertera 👻"
             },
             "switch": {
                 "data": {
-                    "entity_id": "Källa för entitet",
-                    "hide_source": "Dölj källa för entitet",
+                    "entity_id": "Källenhet",
+                    "hide_source": "Dölj källenhet",
                     "name": "Namn"
                 },
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9879dce and bc865da.

📒 Files selected for processing (1)
  • custom_components/spook/integrations/spook_inverse/translations/sv.json (1 hunks)
🔇 Additional comments (2)
custom_components/spook/integrations/spook_inverse/translations/sv.json (2)

6-7: LGTM! Translation changes look accurate

The Swedish translations have been made more concise while maintaining their semantic meaning.


14-15: LGTM! Consistent translations across components

The translations maintain consistency with the binary_sensor section, which is good practice.

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.