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

import galician translations #50

Closed
wants to merge 1 commit into from
Closed

import galician translations #50

wants to merge 1 commit into from

Conversation

JarbasAl
Copy link
Member

@JarbasAl JarbasAl commented Dec 2, 2024

Summary by CodeRabbit

  • New Features

    • Added localized error messages and various dialog entries in Galician, enhancing user interaction.
    • Introduced vocabulary entries for popular culture references and robotics terminology.
    • Implemented game rules for "Rock, Paper, Scissors, Lizard, Spock" in Galician.
  • Documentation

    • New JSON files created for dialogs and vocabulary in Galician, providing structured translations for improved localization.

Copy link

coderabbitai bot commented Dec 2, 2024

Walkthrough

This pull request introduces various changes to the Galician localization files, enhancing dialog and vocabulary entries across multiple contexts. New phrases and rules related to error messages, game mechanics, and ethical guidelines for robots have been added. Additionally, two new JSON files for dialogs and vocabulary have been created, consolidating translations and terms used within the application, while a script has been modified for improved file path handling during translation synchronization.

Changes

File Path Change Summary
locale/gl-es/dialog/bad_file.dialog Added message: "non se puido abrir o ficheiro de son"
locale/gl-es/dialog/languages.dialog Added phrase: "domino seis millóns de formas de comunicación"
locale/gl-es/dialog/pod.dialog Added text: "Síntocho, Dave. Non podo facelo, infelizmente."
locale/gl-es/dialog/rock_paper_scissors_lizard_spock.dialog Added game rules for "Rock, Paper, Scissors, Lizard, Spock" in Galician.
locale/gl-es/dialog/rule0.dialog Added line: "Os robots non poden ferir a humanidade nin, por inacción, permitir que a humanidade sufra danos."
locale/gl-es/dialog/rule1.dialog Added line: "Os robots non poden ferir os seres humanos nin, por inacción, permitir que os seres humanos sufran danos."
locale/gl-es/dialog/rule2.dialog Added line: "Os robots deben obedecer as ordes que lles dan os seres humanos, agás se esas ordes entraren en conflito coa Primeira Lei."
locale/gl-es/dialog/rule3.dialog Added ethical guidelines for robots in Galician.
locale/gl-es/dialog/stardate.dialog Added phrases for displaying stardate: "A data estelar actual é { stardate }", etc.
locale/gl-es/vocab/adult_mode_keyword.voc Added entry: faime dano
locale/gl-es/vocab/arnold_keyword.voc Added entries: "arnold di", "schwarzenegger di", "terminator di"
locale/gl-es/vocab/bender_keyword.voc Added entry: bender di
locale/gl-es/vocab/bill_and_ted_keyword.voc Added entries: "sementais", "sementais salvaxes", "semental", "semental salvaxe"
locale/gl-es/vocab/conan_keyword.voc Added entry: "que é o mellor da vida"
locale/gl-es/vocab/duke_nukem_keyword.voc Added entries: "duke newcom di", "duke newcomb di", "duke newham di", "duke newum di", "duke nukem di"
locale/gl-es/vocab/glados_keyword.voc Added entries: "gladdos di", "gladis di", "glados di", "gladys di"
locale/gl-es/vocab/grandma_mode_keyword.voc Added entry: "demasiado novo para morrer"
locale/gl-es/vocab/hal_keyword.voc Added entries related to "HAL 9000" and variations of "berra"
locale/gl-es/vocab/languages_you_speak_keyword.voc Added entries: "idiomas falas", "idiomas sabes falar"
locale/gl-es/vocab/law_keyword.voc Added entries: lei, leis
locale/gl-es/vocab/malibu_stacey_keyword.voc Added entries for variations of "Malibu Stacey"
locale/gl-es/vocab/pod_bay_doors_keyword.voc Added entries: "abrir as portas do compartimento da cápsula", "abrir portas do compartimento da cápsula"
locale/gl-es/vocab/portal_keyword.voc Added entries related to "canción" and "cantar" in context of GLaDOS and portal
locale/gl-es/vocab/robotics_keyword.voc Added terms: "robótica", "robótico"
locale/gl-es/vocab/rock_paper_scissors_lizard_spock_keyword.voc Added entry: "pedra papel tesoira lagarto spock"
locale/gl-es/vocab/stardate_keyword.voc Added entries for stardate-related terms
scripts/sync_translations.py Modified file path handling for output files and ensured directory existence before writing.
translations/gl-es/dialogs.json Introduced new JSON file with dialog entries in Galician covering various themes.
translations/gl-es/vocabs.json Introduced new JSON file with vocabulary entries and phrases in Galician.

Poem

In the land of Galician lore,
New words and phrases, oh what a score!
From robots to games, we add with glee,
A world of dialogue, as rich as can be.
With every new line, our voices unite,
Celebrating changes, oh what a delight! 🐰✨


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

🧹 Outside diff range and nitpick comments (3)
translations/gl-es/dialogs.json (2)

19-21: Maintain consistent capitalization in error messages.

The error message should start with a capital letter to maintain consistency with other dialog entries.

-        "non se puido abrir o ficheiro de son"
+        "Non se puido abrir o ficheiro de son"

22-24: Consider using a template variable for the number.

The number "seis millóns" could be made configurable using a template variable for better maintainability.

-        "domino seis millóns de formas de comunicación"
+        "domino { number_of_languages } formas de comunicación"
translations/gl-es/vocabs.json (1)

89-96: Standardize case in HAL 9000 variations

The HAL entries mix uppercase "HAL" with lowercase "todos" and other variations. Consider standardizing the case for consistency.

Consider standardizing to:

 "/vocab/hal_keyword.voc": [
     "HAL 9000 di",
     "HAL di",
-    "todos 9000 din",
-    "todos din",
-    "como 9000 di",
-    "como nove mil di",
-    "berra 9000 di",
-    "berra nove mil di"
+    "TODOS 9000 din",
+    "TODOS din",
+    "COMO 9000 di",
+    "COMO nove mil di",
+    "BERRA 9000 di",
+    "BERRA nove mil di"
 ]
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between d387e3c and 9997b90.

📒 Files selected for processing (29)
  • locale/gl-es/dialog/bad_file.dialog (1 hunks)
  • locale/gl-es/dialog/languages.dialog (1 hunks)
  • locale/gl-es/dialog/pod.dialog (1 hunks)
  • locale/gl-es/dialog/rock_paper_scissors_lizard_spock.dialog (1 hunks)
  • locale/gl-es/dialog/rule0.dialog (1 hunks)
  • locale/gl-es/dialog/rule1.dialog (1 hunks)
  • locale/gl-es/dialog/rule2.dialog (1 hunks)
  • locale/gl-es/dialog/rule3.dialog (1 hunks)
  • locale/gl-es/dialog/stardate.dialog (1 hunks)
  • locale/gl-es/vocab/adult_mode_keyword.voc (1 hunks)
  • locale/gl-es/vocab/arnold_keyword.voc (1 hunks)
  • locale/gl-es/vocab/bender_keyword.voc (1 hunks)
  • locale/gl-es/vocab/bill_and_ted_keyword.voc (1 hunks)
  • locale/gl-es/vocab/conan_keyword.voc (1 hunks)
  • locale/gl-es/vocab/duke_nukem_keyword.voc (1 hunks)
  • locale/gl-es/vocab/glados_keyword.voc (1 hunks)
  • locale/gl-es/vocab/grandma_mode_keyword.voc (1 hunks)
  • locale/gl-es/vocab/hal_keyword.voc (1 hunks)
  • locale/gl-es/vocab/languages_you_speak_keyword.voc (1 hunks)
  • locale/gl-es/vocab/law_keyword.voc (1 hunks)
  • locale/gl-es/vocab/malibu_stacey_keyword.voc (1 hunks)
  • locale/gl-es/vocab/pod_bay_doors_keyword.voc (1 hunks)
  • locale/gl-es/vocab/portal_keyword.voc (1 hunks)
  • locale/gl-es/vocab/robotics_keyword.voc (1 hunks)
  • locale/gl-es/vocab/rock_paper_scissors_lizard_spock_keyword.voc (1 hunks)
  • locale/gl-es/vocab/stardate_keyword.voc (1 hunks)
  • scripts/sync_translations.py (4 hunks)
  • translations/gl-es/dialogs.json (1 hunks)
  • translations/gl-es/vocabs.json (1 hunks)
✅ Files skipped from review due to trivial changes (18)
  • locale/gl-es/vocab/bender_keyword.voc
  • locale/gl-es/dialog/languages.dialog
  • locale/gl-es/vocab/adult_mode_keyword.voc
  • locale/gl-es/dialog/rule0.dialog
  • locale/gl-es/dialog/bad_file.dialog
  • locale/gl-es/vocab/law_keyword.voc
  • locale/gl-es/vocab/conan_keyword.voc
  • locale/gl-es/vocab/grandma_mode_keyword.voc
  • locale/gl-es/vocab/malibu_stacey_keyword.voc
  • locale/gl-es/vocab/bill_and_ted_keyword.voc
  • locale/gl-es/vocab/rock_paper_scissors_lizard_spock_keyword.voc
  • locale/gl-es/dialog/rule1.dialog
  • locale/gl-es/dialog/pod.dialog
  • locale/gl-es/dialog/rule2.dialog
  • locale/gl-es/vocab/arnold_keyword.voc
  • locale/gl-es/dialog/stardate.dialog
  • locale/gl-es/vocab/glados_keyword.voc
  • locale/gl-es/vocab/portal_keyword.voc
🔇 Additional comments (11)
locale/gl-es/vocab/robotics_keyword.voc (1)

1-2: LGTM! Well-formatted vocabulary entries

The robotics terms are correctly spelled in Galician with proper accents and follow the one-term-per-line format convention.

locale/gl-es/vocab/languages_you_speak_keyword.voc (1)

1-2: LGTM! Good phrase variations

The vocabulary entries provide useful variations for asking about languages in Galician. The phrases are grammatically correct and follow the standard format.

locale/gl-es/vocab/duke_nukem_keyword.voc (1)

1-5: Review necessity of multiple phonetic variations

While having phonetic variations can help with voice recognition, some variations like "newcom", "newcomb", and "newham" seem too distant from the original "Nukem" and might lead to false positives. Consider:

  1. Keeping only the most common mispronunciations
  2. Verifying if all these variations are actually used by Galician speakers

Additionally, verify if the "di" suffix is the correct Galician verb form for this context.

Consider reducing to the most common variations:

-duke newcom di
-duke newcomb di
-duke newham di
-duke newum di
+duke newkem di
 duke nukem di
✅ Verification successful

Let me check the content of these other vocabulary files to understand the pattern better.


Multiple variations are consistent with other wake word files

Looking at other vocabulary files in the Galician (gl-es) locale, the pattern of including multiple phonetic variations with the "di" suffix is consistent across all wake word files:

  • GLaDOS has variations: gladdos/gladis/glados/gladys
  • HAL has multiple forms including phonetic spellings
  • The "di" suffix is consistently used across all wake word files

The variations in duke_nukem_keyword.voc follow the same pattern as other wake word files in the Galician locale, suggesting this is an intentional design choice for better voice recognition. The multiple spellings, while seemingly distant from the original, align with the project's approach to handling wake words in Galician.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if similar patterns exist in other vocabulary files
echo "Checking for similar patterns in other vocabulary files..."
rg -l "di$" locale/gl-es/vocab/

Length of output: 351


Script:

#!/bin/bash
# Check contents of all files ending with "di"
echo "Contents of vocabulary files with 'di' suffix:"
for file in $(rg -l "di$" locale/gl-es/vocab/); do
  echo -e "\n=== $file ==="
  cat "$file"
done

Length of output: 1415

locale/gl-es/vocab/pod_bay_doors_keyword.voc (1)

1-2: LGTM! Valid variations for voice recognition.

Both phrases are correctly formatted and represent natural variations in Galician, which is good for improving voice command recognition.

locale/gl-es/vocab/hal_keyword.voc (2)

7-8: Clarify the purpose of "todos" (all) entries.

The entries with "todos" (all) seem disconnected from the HAL context. Please verify if these are intentional or if they belong in a different vocabulary file.

Would you like me to help restructure these entries or suggest alternative phrasings?


3-4: Verify the context of "berra" (shout) entries.

The use of "berra" (shout) with HAL 9000 seems unusual. Consider if these entries align with the intended interaction style.

locale/gl-es/dialog/rock_paper_scissors_lizard_spock.dialog (1)

1-1: LGTM! Translation is accurate and complete.

The Galician translation correctly captures all game rules and relationships between elements (rock, paper, scissors, lizard, Spock).

locale/gl-es/dialog/rule3.dialog (1)

1-1: LGTM! Translation accurately preserves Asimov's Three Laws.

The Galician translation maintains the hierarchical relationship between the laws and uses consistent terminology. The capitalization of "Primeira" and "Segunda" when referring to the laws is appropriately maintained.

translations/gl-es/dialogs.json (2)

5-9: LGTM! Proper template variable usage.

The stardate dialog entries correctly use the template variable { stardate } and provide good variety in phrasing.


1-31: Verify dialog file synchronization.

Since some content exists both in individual .dialog files and this JSON file, we should ensure they stay synchronized.

✅ Verification successful

Let me generate additional shell scripts to check the remaining dialog files for completeness:


All dialog files are properly synchronized

Based on the verification results, all dialog files in locale/gl-es/dialog/ are perfectly synchronized with their corresponding entries in translations/gl-es/dialogs.json. The content matches exactly for all files including:

  • rock_paper_scissors_lizard_spock.dialog
  • stardate.dialog (all 3 variations)
  • pod.dialog
  • rule0.dialog, rule1.dialog, rule2.dialog, rule3.dialog
  • bad_file.dialog
  • languages.dialog
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if dialog content matches between individual files and JSON

# Function to normalize text (remove spaces and newlines)
normalize() {
    echo "$1" | tr -d '\n' | tr -d ' '
}

# Check rock_paper_scissors_lizard_spock dialog
json_content=$(jq -r '."\/dialog\/rock_paper_scissors_lizard_spock.dialog"[0]' translations/gl-es/dialogs.json)
file_content=$(cat locale/gl-es/dialog/rock_paper_scissors_lizard_spock.dialog)
if [ "$(normalize "$json_content")" != "$(normalize "$file_content")" ]; then
    echo "Mismatch in rock_paper_scissors_lizard_spock.dialog"
fi

# Check rule3 dialog
json_content=$(jq -r '."\/dialog\/rule3.dialog"[0]' translations/gl-es/dialogs.json)
file_content=$(cat locale/gl-es/dialog/rule3.dialog)
if [ "$(normalize "$json_content")" != "$(normalize "$file_content")" ]; then
    echo "Mismatch in rule3.dialog"
fi

Length of output: 5347


Script:

#!/bin/bash
# Check remaining dialog files for synchronization

# Check stardate dialog
json_content=$(jq -r '."\/dialog\/stardate.dialog"[]' translations/gl-es/dialogs.json | sort)
file_content=$(cat locale/gl-es/dialog/stardate.dialog | sort)
if [ "$(echo "$json_content" | md5sum)" != "$(echo "$file_content" | md5sum)" ]; then
    echo "Mismatch in stardate.dialog"
fi

# Check pod dialog
json_content=$(jq -r '."\/dialog\/pod.dialog"[0]' translations/gl-es/dialogs.json)
file_content=$(cat locale/gl-es/dialog/pod.dialog)
if [ "$(echo "$json_content" | md5sum)" != "$(echo "$file_content" | md5sum)" ]; then
    echo "Mismatch in pod.dialog"
fi

# Check rule1, rule2, rule0 dialogs
for rule in rule1 rule2 rule0; do
    json_content=$(jq -r ".\"/dialog/${rule}.dialog\"[0]" translations/gl-es/dialogs.json)
    file_content=$(cat "locale/gl-es/dialog/${rule}.dialog")
    if [ "$(echo "$json_content" | md5sum)" != "$(echo "$file_content" | md5sum)" ]; then
        echo "Mismatch in ${rule}.dialog"
    fi
done

# Check bad_file and languages dialogs
for dialog in bad_file languages; do
    json_content=$(jq -r ".\"/dialog/${dialog}.dialog\"[0]" translations/gl-es/dialogs.json)
    file_content=$(cat "locale/gl-es/dialog/${dialog}.dialog")
    if [ "$(echo "$json_content" | md5sum)" != "$(echo "$file_content" | md5sum)" ]; then
        echo "Mismatch in ${dialog}.dialog"
    fi
done

Length of output: 4341

translations/gl-es/vocabs.json (1)

52-54: Review sensitive content translation

The translation for "adult_mode_keyword" ("faime dano" - "hurt me") might need review for appropriateness in the context of the application.

Let's check the context of this vocabulary usage:

✅ Verification successful

Translation is appropriate within context

The translation "faime dano" for "adult_mode_keyword" is actually appropriate given the full context. This is part of a gaming/entertainment skill that references the classic DOOM difficulty levels ("hurt me plenty" is a medium difficulty setting). The phrase is used to toggle a mode that enables more aggressive or challenging responses, with a counterpart "grandma_mode" for a gentler experience. The implementation shows it's used for playful dialogue responses like "Do you feel lucky, punk?" - a classic movie quote.

  • The English and German versions both use "hurt me plenty"
  • The Galician translation "faime dano" maintains the same meaning
  • The context shows this is used appropriately as part of a gaming reference
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for references to adult_mode to understand its context
rg -l "adult_mode" --type txt --type json

Length of output: 134


Script:

#!/bin/bash
# Let's check the content of these vocabulary files to understand the context
cat translations/en-us/vocabs.json translations/de-de/vocabs.json translations/gl-es/vocabs.json | grep -A 1 "adult_mode_keyword"

Length of output: 323


Script:

#!/bin/bash
# Let's search for more context about where and how this keyword is used
rg "adult_mode" -A 5 -B 5

Length of output: 5262

Comment on lines +7 to +8
estrela comer
oito de inicio
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 translations "estrela comer" and "oito de inicio".

These entries appear to be machine translation errors:

  • "estrela comer" (star eat) is not a valid stardate reference
  • "oito de inicio" (eight of start) is not a valid stardate reference

These should be removed as they could cause confusion in voice recognition.

 día inicial
-estrela comer
-oito de inicio
📝 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
estrela comer
oito de inicio
día inicial

@JarbasAl
Copy link
Member Author

JarbasAl commented Dec 2, 2024

included in #51

@JarbasAl JarbasAl closed this Dec 2, 2024
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