-
Notifications
You must be signed in to change notification settings - Fork 2
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
Extract strings in code to resources/values/strings.xml and used it from there #21
Extract strings in code to resources/values/strings.xml and used it from there #21
Conversation
*not include non-composable code
2) Refactored @composable fun Counter
WalkthroughThe recent updates across the Minesweeper app's codebase primarily focus on enhancing internationalisation and localisation support. This includes adding imports for generated resources, utilising resource strings for UI text like actions, labels, and buttons, and incorporating Changes
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 as PR comments)
Additionally, you can add CodeRabbit Configration 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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
composeApp/src/commonMain/composeResources/values/strings.xml
is excluded by:!**/*.xml
Files selected for processing (5)
- composeApp/src/commonMain/kotlin/com/arkivanov/minesweeper/game/GameContent.kt (7 hunks)
- composeApp/src/commonMain/kotlin/com/arkivanov/minesweeper/root/RootContent.kt (2 hunks)
- composeApp/src/commonMain/kotlin/com/arkivanov/minesweeper/settings/EditSettingsContent.kt (3 hunks)
- composeApp/src/jvmMain/kotlin/Main.kt (2 hunks)
- composeApp/src/wasmJsMain/kotlin/Main.kt (1 hunks)
Additional comments: 17
composeApp/src/wasmJsMain/kotlin/Main.kt (1)
- 36-36: The TODO comment about understanding how to use resources for Wasm is noted. It might be beneficial to add more details or link this TODO to a specific issue in your project's issue tracker for better visibility and tracking.
composeApp/src/jvmMain/kotlin/Main.kt (2)
- 12-14: The imports for handling resources are correctly added.
- 34-34: Utilizing
stringResource
for the window title is a good practice for supporting localization. This change aligns well with the PR's objectives.composeApp/src/commonMain/kotlin/com/arkivanov/minesweeper/root/RootContent.kt (3)
- 19-23: The imports for accessing resource strings are correctly added.
- 34-34: Utilizing
stringResource
for the app name in theTopAppBar
title is a good practice for supporting localization.- 39-39: Using
stringResource
for the settings icon's content description enhances accessibility and supports localization.composeApp/src/commonMain/kotlin/com/arkivanov/minesweeper/settings/EditSettingsContent.kt (6)
- 19-26: The imports for accessing resource strings are correctly added.
- 42-42: Utilizing
stringResource
for the width label in theTextField
is a good practice for supporting localization.- 49-49: Using
stringResource
for the height label supports localization and enhances the user experience.- 56-56: Incorporating
stringResource
for the mine count label aligns with best practices for localization.- 65-65: Applying
stringResource
for the cancel button text is a good practice for supporting localization.- 69-69: Utilizing
stringResource
for the apply button text enhances maintainability and supports localization efforts.composeApp/src/commonMain/kotlin/com/arkivanov/minesweeper/game/GameContent.kt (5)
- 57-68: The imports for accessing resource strings are correctly added.
- 95-95: Utilizing
stringResource
for the mines counter content description is a good practice for supporting localization and enhancing accessibility.- 108-108: Using
stringResource
for the timer content description supports localization and enhances accessibility.- 207-207: Applying
stringResource
for the restart button's content description aligns with best practices for localization and accessibility.- 225-225: Incorporating
stringResource
for control instructions enhances the user experience and supports localization efforts.
2) Changed "" to '' (string to char)
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
composeApp/src/commonMain/composeResources/values/strings.xml
is excluded by:!**/*.xml
Files selected for processing (1)
- composeApp/src/commonMain/kotlin/com/arkivanov/minesweeper/game/GameContent.kt (8 hunks)
Files skipped from review as they are similar to previous changes (1)
- composeApp/src/commonMain/kotlin/com/arkivanov/minesweeper/game/GameContent.kt
One more thing that I want to say, the task of increasing level of accessibility is a not easy task and requires additional work and tests, so I think in context of this PR we may not target on this, but awesome that we have discussion about it! |
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
composeApp/src/commonMain/composeResources/values/strings.xml
is excluded by:!**/*.xml
Files selected for processing (1)
- composeApp/src/commonMain/kotlin/com/arkivanov/minesweeper/game/GameContent.kt (8 hunks)
Files skipped from review as they are similar to previous changes (1)
- composeApp/src/commonMain/kotlin/com/arkivanov/minesweeper/game/GameContent.kt
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
composeApp/src/commonMain/composeResources/values/strings.xml
is excluded by:!**/*.xml
Files selected for processing (1)
- composeApp/src/wasmJsMain/kotlin/Main.kt (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- composeApp/src/wasmJsMain/kotlin/Main.kt
Is |
I think test test is flaky, filed #22. |
Hello, Arkadii, I'm done with extracting user strings from code, please review.
I think that we may extract strings only that user interact with, because later its valueble for translate it for example.
Summary by CodeRabbit
Main.kt
file for potential resource integration with WebAssembly.