-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add translation for Brazilian Portuguese (pt-BR) #182
Conversation
Added a new translation file for Brazilian Portuguese (pt-BR). This includes translations for OAuth error messages, button labels, and other related text. It improves localization support for users in Brazil.
WalkthroughA new language file for Brazilian Portuguese (pt-BR) has been added to the Shield OAuth project. This file, Changes
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command 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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
🧹 Outside diff range and nitpick comments (1)
src/Language/pt-BR/ShieldOAuthLang.php (1)
1-44
: Consider adding translation test coverage.The translations look good overall. Consider implementing automated tests to verify:
- All required translation keys are present
- Placeholder consistency across languages
- No missing translations compared to the default language
Would you like me to help create a test suite for validating translations?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/Language/pt-BR/ShieldOAuthLang.php
(1 hunks)
🔇 Additional comments (4)
src/Language/pt-BR/ShieldOAuthLang.php (4)
1-13
: LGTM! File header follows PHP best practices.
The file includes proper strict type declaration and copyright information.
26-28
: LGTM! UI strings are clear and consistent.
The translations for UI elements are concise and follow proper formatting conventions.
14-15
: Verify consistency with other language files.
The structure looks good, but let's ensure it matches other language files in the project.
✅ Verification successful
Structure matches other language files perfectly
The verification shows that all language files (en
, fa
, fr
, id
) follow the exact same structure:
- Same file header with copyright notice
- Same comment "ShieldOAuthLang language file"
- Same array return structure with identical keys organization
- Consistent indentation and formatting
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if the structure matches other language files
# Expected: Similar array structure in other language files
# Find and show structure of other language files
fd ShieldOAuthLang.php src/Language --exclude pt-BR | xargs head -n 20
Length of output: 2552
16-23
: Verify placeholder consistency across translations.
The translations look natural while maintaining technical accuracy. The use of placeholders (e.g., "{0}") in messages like account_not_found
and access_denied
is correct.
✅ Verification successful
Placeholder usage is consistent across all language files
The verification shows that the placeholder pattern {0}
is consistently used across all language files (en, fr, fa, id, pt-BR) for both account_not_found
and access_denied
messages. The placeholders maintain the same format and position in each translation, ensuring proper string interpolation will work as expected.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check placeholder consistency across language files
# Expected: Same placeholder pattern ({0}) in other language files
# Search for placeholder usage in language files
rg -U "(\{0\})" src/Language/
Length of output: 1289
// Errors List For all OAuth | ||
'Github' => [ | ||
'github' => 'GitHub', | ||
'not_allow' => 'Agora você não pode entrar ou se registrar com o GitHub!', | ||
], | ||
'Google' => [ | ||
'google' => 'Google', | ||
'not_allow' => 'Agora você não pode entrar ou se registrar com o Google!', | ||
], | ||
// 'Yahoo' => [ | ||
// 'yahoo' => 'Yahoo', | ||
// 'not_allow' => 'Agora você não pode entrar ou se registrar com o Yahoo!', | ||
// ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Remove commented Yahoo OAuth sections
The Yahoo OAuth provider is consistently commented out across all language files and the configuration file, indicating it's not an active or planned feature. The commented sections should be removed to maintain clean code:
- Yahoo configuration is commented out in
src/Config/ShieldOAuthConfig.php
- Yahoo translations are commented out in all language files:
src/Language/en/ShieldOAuthLang.php
src/Language/fa/ShieldOAuthLang.php
src/Language/fr/ShieldOAuthLang.php
src/Language/id/ShieldOAuthLang.php
src/Language/pt-BR/ShieldOAuthLang.php
🔗 Analysis chain
Query about commented Yahoo section.
The translations for GitHub and Google are well-implemented. However, there's a commented-out Yahoo section that might need clarification:
- Is Yahoo support planned for the future?
- Should this commented section be removed if Yahoo support isn't imminent?
Let's check the content of these files to understand the Yahoo implementation status better.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check Yahoo implementation status across the project
# Expected: Find if Yahoo OAuth is implemented or planned
# Search for Yahoo-related implementations
rg -l "Yahoo" --type php
Length of output: 240
Script:
#!/bin/bash
# Check the content of ShieldOAuthConfig.php for Yahoo configuration
echo "=== ShieldOAuthConfig.php ==="
rg -A 5 -B 5 "Yahoo" src/Config/ShieldOAuthConfig.php
# Check if Yahoo is commented out in other language files
echo -e "\n=== Language files Yahoo sections ==="
for file in src/Language/*/ShieldOAuthLang.php; do
echo -e "\n--- $file ---"
rg -A 3 -B 1 "Yahoo" "$file"
done
Length of output: 2397
Added a new translation file for Brazilian Portuguese (pt-BR). This includes translations for OAuth error messages, button labels, and other related text. It improves localization support for users in Brazil.
Added a new translation file for Brazilian Portuguese (pt-BR). This includes translations for OAuth error messages, button labels, and other related text. It improves localization support for users in Brazil.
Summary by CodeRabbit