PR Type
enhancement, documentation
_
Description
– Renamed the language code from pt-pt to pt for Portuguese (Portugal) across various configuration files.
– Added new translations for machine states, G-code commands, and resources in Portuguese (Portugal).
– Updated server settings to reflect the new language code and corrected a comment for the Ukrainian language.
_
Changes walkthrough 📝
| Relevant files | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Enhancement |
|
||||||||||
| Documentation |
|
_
> 💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information
评论 (6)
#2 – codiumai-pr-agent-free[bot] 于 2024-10-17
PR Reviewer Guide 🔍
#### (Review updated until commit https://github.com/cncjs/cncjs/commit/9920ff52c86eec48b901e36ac6b2ec18958dc296)
Here are some key observations to aid the review process:
| ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪ |
| 🧪 No relevant tests |
| 🔒 No security concerns identified |
| ⚡ Recommended focus areas for review
Language Code Change JSON Indentation Change Language List Modification |
#3 – cheton 于 2024-10-17
/improve
#4 – codiumai-pr-agent-free[bot] 于 2024-10-17
PR Code Suggestions ✨
Latest suggestions up to 9920ff5
| Category | Suggestion | Score |
| Enhancement |
Add more detailed comments to clarify language code distinctions_
Consider adding a comment to explain the difference between ‘pt’ and ‘pt-br’ [build.config.js [13-14]](https://github.com/cncjs/cncjs/pull/886/files#diff-ad214d6ab49228db3f19e72f9c741f7e6c63366a8f8000e1d83e2cb35f8d50c4R13-R14)
– [ ] Apply this suggestion Suggestion importance[1-10]: 7Why: |
7 |
Remove trailing whitespace to maintain consistency and prevent potential issues_
Remove the trailing space in the translation for “Spindle On, CW (M3)”. This ensures [src/app/i18n/de/gcode.json [35]](https://github.com/cncjs/cncjs/pull/886/files#diff-f610a4f3f34151709dd9097ca47d234ecfa345d43f344688ca05ee9ddd656da1R35-R35)
– [ ] Apply this suggestion Suggestion importance[1-10]: 7Why: |
7 | |
| Best practice |
Use a constant for configuration values to improve maintainability_
Consider using a constant or configuration variable for the [i18next-scanner.app.config.js [58]](https://github.com/cncjs/cncjs/pull/886/files#diff-fe6e0f9fde69f4220cfe10008bb7f2d898baa987fbe2d406c455ff34ddbf99efR58-R58)
– [ ] Apply this suggestion Suggestion importance[1-10]: 7Why: |
7 |
Maintain consistent JSON formatting for improved readability and maintainability_
Consider using a consistent format for the JSON object. The new code uses a more [src/app/i18n/de/gcode.json [1-41]](https://github.com/cncjs/cncjs/pull/886/files#diff-f610a4f3f34151709dd9097ca47d234ecfa345d43f344688ca05ee9ddd656da1R1-R41)
Suggestion importance[1-10]: 7Why: |
7 | |
| Maintainability |
Sort language codes alphabetically for improved organization_
Consider sorting the language codes alphabetically for better readability and easier [src/server/config/settings.base.js [126-133]](https://github.com/cncjs/cncjs/pull/886/files#diff-6dad1f27360ef711af55e29f0c87cfc81093abd0e22db10009e3c40c3af618adR126-R133)
– [ ] Apply this suggestion Suggestion importance[1-10]: 7Why: |
7 |
_
#### Previous suggestions
Suggestions up to commit 9920ff5
| Category | Suggestion | Score |
| Enhancement |
Add more detailed comments to clarify language code choices_
Consider adding a comment to explain the difference between ‘pt’ and ‘pt-br’ [build.config.js [13-14]](https://github.com/cncjs/cncjs/pull/886/files#diff-ad214d6ab49228db3f19e72f9c741f7e6c63366a8f8000e1d83e2cb35f8d50c4R13-R14)
Suggestion importance[1-10]: 7Why: |
7 |
Improve German translations for better clarity and idiomatic language use_
Consider using more idiomatic German translations for some of the machine states. [src/app/i18n/de/controller.json [9]](https://github.com/cncjs/cncjs/pull/886/files#diff-d953d170a5c657f42e68093e1d577983514f749431f0a586fd137a79a72732cbR9-R9)
Suggestion importance[1-10]: 7Why: |
7 | |
Add missing translations for Smoothie controller states to ensure completeness_
Consider adding translations for the missing states in the Smoothie section to [src/app/i18n/de/controller.json [33-41]](https://github.com/cncjs/cncjs/pull/886/files#diff-d953d170a5c657f42e68093e1d577983514f749431f0a586fd137a79a72732cbR33-R41)
Suggestion importance[1-10]: 7Why: |
7 | |
Remove trailing whitespace in translation string_
Remove the extra space at the end of the “Spindle On, CW (M3)” translation to [src/app/i18n/de/gcode.json [35]](https://github.com/cncjs/cncjs/pull/886/files#diff-f610a4f3f34151709dd9097ca47d234ecfa345d43f344688ca05ee9ddd656da1R35-R35)
Suggestion importance[1-10]: 7Why: |
7 | |
| Best practice |
Use a constant for configuration values to improve maintainability_
Consider using a constant for the [i18next-scanner.app.config.js [58]](https://github.com/cncjs/cncjs/pull/886/files#diff-fe6e0f9fde69f4220cfe10008bb7f2d898baa987fbe2d406c455ff34ddbf99efR58-R58)
Suggestion importance[1-10]: 7Why: |
7 |
| Maintainability |
Maintain consistent order of language codes across configuration files_
Ensure that the order of language codes is consistent across all configuration files [src/server/config/settings.base.js [126-133]](https://github.com/cncjs/cncjs/pull/886/files#diff-6dad1f27360ef711af55e29f0c87cfc81093abd0e22db10009e3c40c3af618adR126-R133)
Suggestion importance[1-10]: 7Why: |
7 |
| Consistency |
Ensure consistency in translation format for coordinate system entries_
Consider using a consistent format for the translation of “P1 (G54)” to “P6 (G59)”. [src/app/i18n/de/gcode.json [11-16]](https://github.com/cncjs/cncjs/pull/886/files#diff-f610a4f3f34151709dd9097ca47d234ecfa345d43f344688ca05ee9ddd656da1R11-R16)
Suggestion importance[1-10]: 7Why: |
7 |
✅ Suggestions up to commit 59dda69
| Category | Suggestion | Score |
| Enhancement |
✅ Clarify language code comments to accurately represent supported Portuguese variants_ Suggestion Impact:The commit updated the comments for the ‘pt’ and ‘pt-br’ language codes to clarify the Portuguese variants, aligning with the suggestion’s intent. code diff:
_
Consider updating the comment for the ‘pt’ language code to include both European [build.config.js [13-14]](https://github.com/cncjs/cncjs/pull/886/files#diff-ad214d6ab49228db3f19e72f9c741f7e6c63366a8f8000e1d83e2cb35f8d50c4R13-R14)
Suggestion importance[1-10]: 7Why: |
7 |
Use a more inclusive label for the Portuguese language option_
Consider using a more generic label for the ‘pt’ language code to include both [src/app/constants/i18n.js [11-12]](https://github.com/cncjs/cncjs/pull/886/files#diff-9286e66e8f57c2fa7079d1f78c4c15c55c54a5faf46ca568c3e735ff78a9bc8eR11-R12)
Suggestion importance[1-10]: 7Why: |
7 | |
✅ Improve German translations for machine states to be more idiomatic and consistent with industry terminology_ Suggestion Impact:The suggestion was implemented as the translations for “run” were changed to “Lauf” and “home” to “Referenzfahrt” in the commit. code diff:
_
Consider using more idiomatic German translations for some of the machine states. [src/app/i18n/de/controller.json [23-26]](https://github.com/cncjs/cncjs/pull/886/files#diff-d953d170a5c657f42e68093e1d577983514f749431f0a586fd137a79a72732cbR23-R26)
Suggestion importance[1-10]: 7Why: |
7 | |
Remove trailing whitespace in translation strings for consistency_
Remove the trailing space in the translation for “Spindle On, CW (M3)” to maintain [src/app/i18n/de/gcode.json [35]](https://github.com/cncjs/cncjs/pull/886/files#diff-f610a4f3f34151709dd9097ca47d234ecfa345d43f344688ca05ee9ddd656da1R35-R35)
Suggestion importance[1-10]: 7Why: |
7 |
✅ Suggestions up to commit 938a32b
| Category | Suggestion | Score |
| Enhancement |
✅ Correct spelling in translation file to improve accuracy_
Consider using “Suspensão” instead of “Suspenção” for the “sleep” state in the Grbl [src/app/i18n/pt/controller.json [27]](https://github.com/cncjs/cncjs/pull/886/files#diff-48f2e75fe9ab271bd8923c0652f6cab6bc08f82c9dafd133ab6ecb620ba74370R27-R27)
Suggestion importance[1-10]: 9Why: Correcting the spelling from “Suspenção” to “Suspensão” improves the accuracy of the translation, which is crucial for maintaining professionalism and clarity in the translation file. |
9 |
Maintain alphabetical order in the language list for better organization and readability_
Consider updating the order of language entries to maintain alphabetical sorting. [src/app/constants/i18n.js [10-12]](https://github.com/cncjs/cncjs/pull/886/files#diff-9286e66e8f57c2fa7079d1f78c4c15c55c54a5faf46ca568c3e735ff78a9bc8eR10-R12)
Suggestion importance[1-10]: 8Why: The suggestion to maintain alphabetical order in the language list improves organization and readability, making it easier for developers to locate specific entries. |
8 | |
✅ Translate missing entries in the G-code translation file to ensure completeness_
Consider translating the empty strings for “Active Tool Offset (G43.1)” and “No Tool [src/app/i18n/pt/gcode.json [29-30]](https://github.com/cncjs/cncjs/pull/886/files#diff-67ad25f5467161a53eaf26246ce2cb4ad2a8807d3b23746ebe60e1d844ec1b13R29-R30)
Suggestion importance[1-10]: 8Why: The suggestion addresses missing translations for “Active Tool Offset (G43.1)” and “No Tool Offset (G49)”, enhancing the completeness and consistency of the translation file. |
8 | |
✅ Translate missing M-code command to ensure completeness of the G-code translation file_
Translate “Optional Program Stop (M1)” to maintain consistency with other translated [src/app/i18n/pt/gcode.json [32]](https://github.com/cncjs/cncjs/pull/886/files#diff-67ad25f5467161a53eaf26246ce2cb4ad2a8807d3b23746ebe60e1d844ec1b13R32-R32)
Suggestion importance[1-10]: 8Why: Translating “Optional Program Stop (M1)” fills a gap in the translation file, ensuring consistency with other translated M-code commands and improving the file’s completeness. |
8 | |
✅ Standardize translations across different controller types for consistency_
For consistency, consider using “Suspensão” instead of “Dormir” for the “sleep” [src/app/i18n/pt/controller.json [39]](https://github.com/cncjs/cncjs/pull/886/files#diff-48f2e75fe9ab271bd8923c0652f6cab6bc08f82c9dafd133ab6ecb620ba74370R39-R39)
Suggestion importance[1-10]: 7Why: Changing “Dormir” to “Suspensão” for the “sleep” state in the Smoothie section ensures consistency with the Grbl section, enhancing uniformity across different controller types. |
7 | |
| Best practice |
Maintain consistent comment formatting throughout the language list_
Ensure consistency in comment formatting by adding a period at the end of the [src/server/config/settings.base.js [126-128]](https://github.com/cncjs/cncjs/pull/886/files#diff-6dad1f27360ef711af55e29f0c87cfc81093abd0e22db10009e3c40c3af618adR126-R128)
Suggestion importance[1-10]: 5Why: While the suggestion to add a period for consistency in comment formatting is valid, it is a minor stylistic improvement with limited impact on the code’s functionality or readability. |
5 |
#5 – cheton 于 2024-10-17
/review
#6 – codiumai-pr-agent-free[bot] 于 2024-10-17
Persistent review updated to latest commit https://github.com/cncjs/cncjs/commit/9920ff52c86eec48b901e36ac6b2ec18958dc296
#1 – codesandbox[bot] 于 2024-10-17
#### Review or Edit in CodeSandbox
Open the branch in source=ghapp”>VS Code • source=ghapp”>Preview