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

[RU]Added translation of error #2233

Merged
merged 2 commits into from
Jun 15, 2024
Merged

[RU]Added translation of error #2233

merged 2 commits into from
Jun 15, 2024

Conversation

mitrokun
Copy link
Contributor

@mitrokun mitrokun commented Jun 14, 2024

All variants of available errors have been translated.

{{ floor }} для наименования этажей в соответствующих вариантах упустил сознательно, чтоб не получать кривые конструкции в ответе.

Summary by CodeRabbit

  • New Features
    • Enhanced error messages for various scenarios in the Russian localization.
    • Added new error messages for timer-related issues, entity access permissions, and duplicate entities.
    • Improved translations for existing error messages to provide more clarity and detail.

Copy link

coderabbitai bot commented Jun 14, 2024

Walkthrough

Walkthrough

The update focuses on refining and expanding error messages in the Russian localization for various scenarios, such as unrecognized intents, entity access issues, floor, zone, domain, and device class errors, and timer-related issues. This enhancement improves clarity and comprehensiveness in user notifications, aiding better user understanding and application troubleshooting.

Changes

File Change Summary
sentences/ru/_common.yaml Updates to error messages: improved translations, new messages for unrecognized intents, entity access, duplicates, and timers.

No sequence diagrams are required for these changes as they are mainly focused on localization updates.


Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between 2a7a9ae and cde6eeb.

Files selected for processing (1)
  • sentences/ru/_common.yaml (1 hunks)
Additional context used
yamllint
sentences/ru/_common.yaml

[error] 157-157: line too long (91 > 80 characters) (line-length)


[error] 158-158: line too long (88 > 80 characters) (line-length)


[error] 160-160: line too long (83 > 80 characters) (line-length)


[error] 163-163: line too long (95 > 80 characters) (line-length)


[error] 164-164: line too long (92 > 80 characters) (line-length)


[error] 168-168: line too long (101 > 80 characters) (line-length)


[error] 169-169: line too long (98 > 80 characters) (line-length)


[error] 228-228: line too long (98 > 80 characters) (line-length)


[error] 230-230: line too long (93 > 80 characters) (line-length)


[error] 244-244: line too long (98 > 80 characters) (line-length)


[error] 248-248: line too long (101 > 80 characters) (line-length)


[error] 271-271: line too long (91 > 80 characters) (line-length)


[error] 276-276: line too long (104 > 80 characters) (line-length)


[error] 292-292: line too long (84 > 80 characters) (line-length)


[error] 311-311: line too long (104 > 80 characters) (line-length)


[error] 325-325: line too long (90 > 80 characters) (line-length)


[error] 327-327: line too long (112 > 80 characters) (line-length)


[error] 332-332: line too long (99 > 80 characters) (line-length)


[error] 339-339: line too long (96 > 80 characters) (line-length)


[error] 346-346: line too long (94 > 80 characters) (line-length)


[error] 353-353: line too long (94 > 80 characters) (line-length)


[error] 360-360: line too long (86 > 80 characters) (line-length)


[error] 395-395: line too long (82 > 80 characters) (line-length)


[error] 397-397: line too long (90 > 80 characters) (line-length)


[error] 409-409: line too long (104 > 80 characters) (line-length)


[error] 416-416: line too long (104 > 80 characters) (line-length)


[error] 423-423: line too long (94 > 80 characters) (line-length)


[error] 430-430: line too long (81 > 80 characters) (line-length)


[error] 483-483: line too long (222 > 80 characters) (line-length)


[error] 487-487: line too long (189 > 80 characters) (line-length)


[error] 491-491: line too long (104 > 80 characters) (line-length)


[error] 492-492: line too long (138 > 80 characters) (line-length)


[error] 493-493: line too long (92 > 80 characters) (line-length)


[error] 496-496: line too long (113 > 80 characters) (line-length)


[error] 497-497: line too long (153 > 80 characters) (line-length)

Additional comments not posted (10)
sentences/ru/_common.yaml (10)

5-6: Ensure consistency in capitalization and punctuation for error messages.


9-10: The addition of error messages for missing floors is a good enhancement for localization.


40-67: The extension of domain-specific error messages to include areas is well-implemented. This helps in providing more detailed error feedback to users.


68-95: Including floor-specific domain errors is a valuable addition for environments with multiple floors.


97-113: The translation for device classes enhances the user experience by providing clearer context in error messages.


114-130: Extending device class errors to include area-specific messages is a good practice, aiding in precise troubleshooting.


131-147: The addition of floor-specific device class errors is thoughtful, catering to complex setups.


172-174: The additions for timer-related errors are important for features that involve timing. Ensure that all timer functionalities are covered.

Verification successful

The search results show multiple timer-related functionalities in the Russian YAML files, including timer durations, start times, and commands. The new error messages in sentences/ru/_common.yaml cover specific error cases like "timer not found," "multiple timers matched," and "no timer support."

Based on the results, it appears that the error messages cover essential error scenarios for timer functionalities.

  • timer_not_found: Covers cases where a specified timer cannot be found.
  • multiple_timers_matched: Addresses situations where multiple timers match a query, causing ambiguity.
  • no_timer_support: Handles cases where the device does not support timers.

These error messages seem to encompass the critical failure points one might encounter when dealing with timers.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Ensure all timer functionalities are covered by the new error messages.

# Search for timer features in the codebase.
rg --type yaml "timer:"

Length of output: 812



Script:

#!/bin/bash
# Description: Ensure all timer functionalities are covered by the new error messages in Russian files.

# Search for timer-related functionalities in the Russian YAML files.
rg --type yaml "timer" sentences/ru/

Length of output: 2870


166-169: The handling of duplicate entity names is well addressed. Ensure that this logic is robust against various naming conventions.

Verification successful

The search results indicate that the handling of duplicate entity names is consistent across multiple language-specific YAML files. The terms "duplicate_entities," "duplicate_entities_in_area," and "duplicate_entities_in_floor" are used uniformly to address scenarios where multiple devices or entities share the same name. This suggests that the logic for handling duplicate entity names is well-implemented and robust against various naming conventions.

  • The review comment's concern about ensuring the logic is robust against various naming conventions appears to be addressed by the consistent use of these terms across different languages.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check for robustness of duplicate entity name handling.

# Search for entity definitions to ensure naming conventions are properly handled.
rg --type yaml "entity:"

Length of output: 5114



Script:

#!/bin/bash
# Description: Check for robustness of duplicate entity name handling by searching for related terms.

# Search for terms related to "duplicate_entities" in YAML files.
rg --type yaml "duplicate_entities"

Length of output: 5789

Tools
yamllint

[error] 168-168: line too long (101 > 80 characters) (line-length)


[error] 169-169: line too long (98 > 80 characters) (line-length)


152-154: The error message for unsupported features is crucial. Verify that all possible features are covered by this message.


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

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.
  • 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: 1

Comment on lines 156 to 169
no_entity_exposed: "Доступ к объекту {{ entity }} не предоставлен"
no_entity_in_area_exposed: "Доступа к объекту {{ entity }} в {{ area }} не предоставлен"
no_entity_in_floor_exposed: "Доступа к объекту {{ entity }} на этаже не предоставлен"
no_domain_exposed: "Доступ к {{ domain }} не предоставлен"
no_domain_in_area_exposed: "Доступ к {{ domain }} в {{ area }} не предоставлен"
no_domain_in_floor_exposed: "Доступ к {{ domain }} на этаже не предоставлен"
no_device_class_exposed: "Доступ к {{ device_class }} не предоставлен"
no_device_class_in_area_exposed: "Доступ к {{ device_class }} в {{ area }} не предоставлен"
no_device_class_in_floor_exposed: "Доступ к {{ device_class }} на этаже не предоставлен"

# Used when multiple (exposed) devices have the same name
duplicate_entities: "Дублирование названий. Несколько объектов {{ entity }}"
duplicate_entities_in_area: "Дублирование названий. Несколько объектов {{ entity }} в {{ area }}"
duplicate_entities_in_floor: "Дублирование названий. Несколько объектов {{ entity }} на этаже"
Copy link

Choose a reason for hiding this comment

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

The lines detailing errors for exposed entities and duplicates (lines 156-169) are crucial for security and clarity, ensuring users are aware of access limitations and naming conflicts. However, these lines exceed the recommended line length for YAML files. Consider breaking these messages into multiple lines to adhere to best practices and improve readability.

- no_entity_exposed: "Доступ к объекту {{ entity }} не предоставлен"
+ no_entity_exposed: >
+   "Доступ к объекту {{ entity }} не предоставлен"

- no_entity_in_area_exposed: "Доступа к объекту {{ entity }} в {{ area }} не предоставлен"
+ no_entity_in_area_exposed: >
+   "Доступа к объекту {{ entity }} в {{ area }} не предоставлен"

- no_entity_in_floor_exposed: "Доступа к объекту {{ entity }} на этаже не предоставлен"
+ no_entity_in_floor_exposed: >
+   "Доступа к объекту {{ entity }} на этаже не предоставлен"
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
no_entity_exposed: "Доступ к объекту {{ entity }} не предоставлен"
no_entity_in_area_exposed: "Доступа к объекту {{ entity }} в {{ area }} не предоставлен"
no_entity_in_floor_exposed: "Доступа к объекту {{ entity }} на этаже не предоставлен"
no_domain_exposed: "Доступ к {{ domain }} не предоставлен"
no_domain_in_area_exposed: "Доступ к {{ domain }} в {{ area }} не предоставлен"
no_domain_in_floor_exposed: "Доступ к {{ domain }} на этаже не предоставлен"
no_device_class_exposed: "Доступ к {{ device_class }} не предоставлен"
no_device_class_in_area_exposed: "Доступ к {{ device_class }} в {{ area }} не предоставлен"
no_device_class_in_floor_exposed: "Доступ к {{ device_class }} на этаже не предоставлен"
# Used when multiple (exposed) devices have the same name
duplicate_entities: "Дублирование названий. Несколько объектов {{ entity }}"
duplicate_entities_in_area: "Дублирование названий. Несколько объектов {{ entity }} в {{ area }}"
duplicate_entities_in_floor: "Дублирование названий. Несколько объектов {{ entity }} на этаже"
no_entity_exposed: >
"Доступ к объекту {{ entity }} не предоставлен"
no_entity_in_area_exposed: >
"Доступа к объекту {{ entity }} в {{ area }} не предоставлен"
no_entity_in_floor_exposed: >
"Доступа к объекту {{ entity }} на этаже не предоставлен"
no_domain_exposed: "Доступ к {{ domain }} не предоставлен"
no_domain_in_area_exposed: "Доступ к {{ domain }} в {{ area }} не предоставлен"
no_domain_in_floor_exposed: "Доступ к {{ domain }} на этаже не предоставлен"
no_device_class_exposed: "Доступ к {{ device_class }} не предоставлен"
no_device_class_in_area_exposed: "Доступ к {{ device_class }} в {{ area }} не предоставлен"
no_device_class_in_floor_exposed: "Доступ к {{ device_class }} на этаже не предоставлен"
# Used when multiple (exposed) devices have the same name
duplicate_entities: "Дублирование названий. Несколько объектов {{ entity }}"
duplicate_entities_in_area: "Дублирование названий. Несколько объектов {{ entity }} в {{ area }}"
duplicate_entities_in_floor: "Дублирование названий. Несколько объектов {{ entity }} на этаже"
Tools
yamllint

[error] 157-157: line too long (92 > 80 characters) (line-length)


[error] 158-158: line too long (89 > 80 characters) (line-length)


[error] 160-160: line too long (83 > 80 characters) (line-length)


[error] 163-163: line too long (95 > 80 characters) (line-length)


[error] 164-164: line too long (92 > 80 characters) (line-length)


[error] 168-168: line too long (101 > 80 characters) (line-length)


[error] 169-169: line too long (98 > 80 characters) (line-length)

Comment on lines 157 to 158
no_entity_in_area_exposed: "Доступа к объекту {{ entity }} в {{ area }} не предоставлен"
no_entity_in_floor_exposed: "Доступа к объекту {{ entity }} на этаже не предоставлен"
Copy link
Member

Choose a reason for hiding this comment

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

Как будто бы здесь должно быть "Доступа не предоставлено", либо "Доступ не предоставлен"


# Errors for timers
timer_not_found: "Таймер не найден"
multiple_timers_matched: "Коллизия установленных таймеров"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
multiple_timers_matched: "Коллизия установленных таймеров"
multiple_timers_matched: "Конфликт установленных таймеров"

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: 3

Comment on lines +11 to +39
no_domain: |
{% set translations = {
"button": "кнопка",
"camera": "камера",
"input_button": "кнопка",
"alarm_control_panel": "охрана",
"automation": "автоматизация",
"fan": "вентилятор",
"climate": "термостат",
"humidifier": "увлажнитель",
"input_boolean": "переключатель",
"siren": "сирена",
"water_heater": "бойлер",
"light": "лампа",
"switch": "переключатель",
"script": "скрипт",
"remote": "ИК пульт",
"lock": "замок",
"vacuum": "пылесос",
"scene": "сцена",
"media_player": "плеер",
"lawn_mower": "газонокосилка",
"valve": "кран"
} %}
{% if domain in translations -%}
Нет объектов типа {{ translations[domain] }}
{%- else -%}
Нет объектов запрашиваемого типа
{%- endif %}
Copy link

Choose a reason for hiding this comment

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

Great use of templating to dynamically translate domain types. Ensure the translations are accurate and consistent across all instances.

Comment on lines +149 to +151
no_entity: "Отсутстует объект {{ entity }}"
no_entity_in_area: "Отсутстует объект {{ entity }} в {{ area }}"
no_entity_in_floor: "Отсутстует объект {{ entity }} на этаже"
Copy link

Choose a reason for hiding this comment

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

Ensure that the term "Отсутствует" is consistently used or consider using a more informal variant if it aligns with the rest of the interface language.

Comment on lines +156 to +164
no_entity_exposed: "Доступ к объекту {{ entity }} не предоставлен"
no_entity_in_area_exposed: "Доступ к объекту {{ entity }} в {{ area }} не предоставлен"
no_entity_in_floor_exposed: "Доступ к объекту {{ entity }} на этаже не предоставлен"
no_domain_exposed: "Доступ к {{ domain }} не предоставлен"
no_domain_in_area_exposed: "Доступ к {{ domain }} в {{ area }} не предоставлен"
no_domain_in_floor_exposed: "Доступ к {{ domain }} на этаже не предоставлен"
no_device_class_exposed: "Доступ к {{ device_class }} не предоставлен"
no_device_class_in_area_exposed: "Доступ к {{ device_class }} в {{ area }} не предоставлен"
no_device_class_in_floor_exposed: "Доступ к {{ device_class }} на этаже не предоставлен"
Copy link

Choose a reason for hiding this comment

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

Consider breaking long lines into multiple lines for better readability and adherence to YAML best practices.

- no_entity_exposed: "Доступ к объекту {{ entity }} не предоставлен"
+ no_entity_exposed: >
+   "Доступ к объекту {{ entity }} не предоставлен"

- no_entity_in_area_exposed: "Доступ к объекту {{ entity }} в {{ area }} не предоставлен"
+ no_entity_in_area_exposed: >
+   "Доступ к объекту {{ entity }} в {{ area }} не предоставлен"

- no_entity_in_floor_exposed: "Доступ к объекту {{ entity }} на этаже не предоставлен"
+ no_entity_in_floor_exposed: >
+   "Доступ к объекту {{ entity }} на этаже не предоставлен"
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
no_entity_exposed: "Доступ к объекту {{ entity }} не предоставлен"
no_entity_in_area_exposed: "Доступ к объекту {{ entity }} в {{ area }} не предоставлен"
no_entity_in_floor_exposed: "Доступ к объекту {{ entity }} на этаже не предоставлен"
no_domain_exposed: "Доступ к {{ domain }} не предоставлен"
no_domain_in_area_exposed: "Доступ к {{ domain }} в {{ area }} не предоставлен"
no_domain_in_floor_exposed: "Доступ к {{ domain }} на этаже не предоставлен"
no_device_class_exposed: "Доступ к {{ device_class }} не предоставлен"
no_device_class_in_area_exposed: "Доступ к {{ device_class }} в {{ area }} не предоставлен"
no_device_class_in_floor_exposed: "Доступ к {{ device_class }} на этаже не предоставлен"
no_entity_exposed: >
"Доступ к объекту {{ entity }} не предоставлен"
no_entity_in_area_exposed: >
"Доступ к объекту {{ entity }} в {{ area }} не предоставлен"
no_entity_in_floor_exposed: >
"Доступ к объекту {{ entity }} на этаже не предоставлен"
no_domain_exposed: "Доступ к {{ domain }} не предоставлен"
no_domain_in_area_exposed: "Доступ к {{ domain }} в {{ area }} не предоставлен"
no_domain_in_floor_exposed: "Доступ к {{ domain }} на этаже не предоставлен"
no_device_class_exposed: "Доступ к {{ device_class }} не предоставлен"
no_device_class_in_area_exposed: "Доступ к {{ device_class }} в {{ area }} не предоставлен"
no_device_class_in_floor_exposed: "Доступ к {{ device_class }} на этаже не предоставлен"
Tools
yamllint

[error] 157-157: line too long (91 > 80 characters) (line-length)


[error] 158-158: line too long (88 > 80 characters) (line-length)


[error] 160-160: line too long (83 > 80 characters) (line-length)


[error] 163-163: line too long (95 > 80 characters) (line-length)


[error] 164-164: line too long (92 > 80 characters) (line-length)

@HepoH3 HepoH3 merged commit 1257ada into home-assistant:main Jun 15, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants