-
Notifications
You must be signed in to change notification settings - Fork 14
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
Added Finnish Localization for UI #753
Conversation
WalkthroughA new JavaScript file has been added to provide Finnish localization for the file uploader module. This file includes an object that maps user interface element identifiers to their Finnish translations, covering prompts, error messages, and user actions. It also incorporates pluralization rules and accessibility labels to enhance user experience. The file concludes without a newline. Changes
Possibly related issues
Poem
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: 3
🧹 Outside diff range and nitpick comments (1)
locales/file-uploader/fi.js (1)
1-119
: Consider adding JSDoc comments for documentation.While the translations are clear, adding JSDoc comments would help document the purpose of this locale file and any special considerations for Finnish translations.
Add documentation at the start of the file:
+/** + * Finnish (fi) localization for the file uploader. + * Includes translations for UI elements, error messages, and accessibility labels. + * Follows Finnish language pluralization rules. + */ export default {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- locales/file-uploader/fi.js (1 hunks)
🔇 Additional comments (5)
locales/file-uploader/fi.js (5)
1-3
: LGTM: Basic configuration is properly set up.The locale configuration is correctly defined with 'fi' as the identifier.
39-42
: Review interpolation syntax in header messages.The interpolation syntax using
{{count}}
and{{plural:file(count)}}
appears correct. However, let's verify this matches the expected format across other language files.#!/bin/bash # Check header message patterns across language files rg -g 'locales/file-uploader/*.js' "'header-uploading'|'header-failed'|'header-succeed'|'header-total'" -A 1
111-113
: Review accessibility message interpolation.The accessibility messages for filters, crop, and tuning use consistent interpolation with
{{name}}
. Let's verify this matches the implementation in other languages.#!/bin/bash # Check accessibility message patterns rg -g 'locales/file-uploader/*.js' "'a11y-cloud-editor-apply-" -A 1
35-38
: Verify pluralization rules implementation.The pluralization rules for 'file' and 'error' look correct in Finnish. Let's verify the implementation matches other languages.
✅ Verification successful
Pluralization rules for Finnish match common patterns across languages
The Finnish pluralization rules for 'file' and 'error' follow the correct pattern seen across other languages that have singular/plural forms. The implementation:
file__one: 'tiedosto'
(singular) andfile__other: 'tiedostot'
(plural)error__one: 'virhe'
(singular) anderror__other: 'virheitä'
(plural)matches the structure used in other languages like English, German, French, etc., where
__one
and__other
suffixes are consistently used to distinguish between singular and plural forms.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check pluralization patterns across language files rg -g 'locales/file-uploader/*.js' "file__one|file__other|error__one|error__other" -A 1Length of output: 11666
Script:
#!/bin/bash # Let's try a different approach to check pluralization patterns rg -g 'locales/file-uploader/*.js' "file__one|file__other|error__one|error__other" --no-filenameLength of output: 3412
4-8
: Verify pluralization consistency for file-related actions.The translations correctly handle singular/plural forms for file upload and selection actions. However, let's verify the consistency with other language files.
✅ Verification successful
Pluralization is consistently implemented across all language files
The verification shows that all language files properly handle singular/plural forms for file upload and selection actions. Each language maintains the distinction between single file operations ('upload-file', 'choose-file') and multiple file operations ('upload-files', 'choose-files'), following their respective language conventions.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check pluralization patterns across other language files rg -g 'locales/file-uploader/*.js' "'upload-file'|'upload-files'|'choose-file'|'choose-files'" -A 1Length of output: 11666
Script:
#!/bin/bash # Let's try the correct pattern to search for file-related translations rg -g 'locales/file-uploader/*.js' "'upload-file'|'upload-files'|'choose-file'|'choose-files'|'drop-files'" --no-filenameLength of output: 4941
@thahertech good job. Thanks again for adding a new locale for File Uploader. Please add id locale to the file, for successful tests. |
@egordidenko thanks for the reply! I have added it now. |
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: 0
🧹 Outside diff range and nitpick comments (1)
test-locales.js (1)
6-6
: Consider improving array readability.The array contains 15 language codes in a single line. For better maintainability and readability, consider formatting the array with one language code per line.
-const SOCIAL_SOURCE_LANGS = ['de', 'en', 'es', 'fr', 'fi', 'he', 'it', 'nl', 'pl', 'pt', 'ru', 'tr', 'uk', 'zh-TW', 'zh']; +const SOCIAL_SOURCE_LANGS = [ + 'de', + 'en', + 'es', + 'fr', + 'fi', + 'he', + 'it', + 'nl', + 'pl', + 'pt', + 'ru', + 'tr', + 'uk', + 'zh-TW', + 'zh' +];
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
test-locales.js
(1 hunks)
🔇 Additional comments (1)
test-locales.js (1)
6-6
: Verify Finnish locale file existence.
Since we're adding 'fi' to the supported languages, let's verify that the corresponding Finnish locale file exists and contains all required translations.
✅ Verification successful
Finnish locale file is properly implemented and complete
The Finnish locale file exists at locales/file-uploader/fi.js
and contains a comprehensive set of translations for all UI elements, including:
- Basic actions (upload, cancel, done)
- File handling messages
- Camera and image editing features
- Error messages and validation texts
- Accessibility labels
- Plural forms support
The implementation is consistent with other locale files in the same directory and contains all required translations.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify Finnish locale file existence and structure
# Check if Finnish locale file exists
echo "Checking for Finnish locale file..."
fd -t f "fi.js" locales
# Verify the structure of Finnish translations
echo "Checking Finnish locale structure..."
rg -A 5 "export default {" locales | grep -A 5 "fi\.js"
Length of output: 369
Script:
#!/bin/bash
# Let's verify the Finnish locale file content more accurately
echo "Checking Finnish locale file content..."
cat locales/file-uploader/fi.js
# Let's also check what other locale files exist in the same directory
echo -e "\nListing all locale files in file-uploader directory..."
ls -la locales/file-uploader/
# Check if Finnish locale exists in other locale directories
echo -e "\nSearching for other Finnish locale files..."
fd "fi.js" .
Length of output: 7069
@thahertech good. Thanks again 👍 |
Description
#752
This pull request introduces Finnish localization to the project. By adding Finnish to the locales, users can interact with the application in Finnish, providing a more accessible and native experience for Finnish-speaking users. ;)
Checklist
Summary by CodeRabbit
Summary by CodeRabbit