Skip to content

Conversation

AsCress
Copy link
Collaborator

@AsCress AsCress commented Jul 25, 2025

Resolves #2794.
Refactors our translations to use natural casing.
Replaces the ALL CAPS translations and uses toUpperCase() instead to handling casing at a UI level.

Summary by Sourcery

Refactor English translations to use natural casing and move uppercase formatting to the UI layer.

Enhancements:

  • Convert all translation getters to natural casing in localization files
  • Update UI components to apply .toUpperCase() on translation strings where uppercase display is required
  • Add missing override annotation for soundmeterConfig in localization file

@AsCress AsCress self-assigned this Jul 25, 2025
Copy link
Contributor

sourcery-ai bot commented Jul 25, 2025

Reviewer's Guide

This PR shifts text casing responsibility from localization files to the UI layer by converting all ALL-CAPS translation entries to natural case and replacing inline uppercase strings in the UI with calls to toUpperCase() as needed.

Class diagram for AppLocalizations and AppLocalizationsEn translation casing changes

classDiagram
  class AppLocalizations {
    +String oscilloscope
    +String multimeter
    +String logicAnalyzer
    +String sensors
    +String waveGenerator
    +String powerSource
    +String luxMeter
    +String accelerometer
    +String barometer
    +String compass
    +String gyroscope
    +String thermometer
    +String roboticArm
    +String gasSensor
    +String dustSensor
    +String soundMeter
    +String bluetooth
    +String wifi
    +String analysisOptionEveryEdge
    +String analysisOptionEveryFallingEdge
    +String analysisOptionEveryRisingEdge
    +String analysisOptionEveryFourthRisingEdge
    +String analysisOptionDisabled
    +String analyze
    +String cancel
    +String low
    +String high
  }
  class AppLocalizationsEn {
    +String oscilloscope = "Oscilloscope"
    +String multimeter = "Multimeter"
    +String logicAnalyzer = "Logic Analyzer"
    +String sensors = "Sensors"
    +String waveGenerator = "Wave Generator"
    +String powerSource = "Power Source"
    +String luxMeter = "Lux Meter"
    +String accelerometer = "Accelerometer"
    +String barometer = "Barometer"
    +String compass = "Compass"
    +String gyroscope = "Gyroscope"
    +String thermometer = "Thermometer"
    +String roboticArm = "Robotic Arm"
    +String gasSensor = "Gas Sensor"
    +String dustSensor = "Dust Sensor"
    +String soundMeter = "Sound Meter"
    +String bluetooth = "Bluetooth"
    +String wifi = "Wifi"
    +String analysisOptionEveryEdge = "Every Edge"
    +String analysisOptionEveryFallingEdge = "Every Falling Edge"
    +String analysisOptionEveryRisingEdge = "Every Rising Edge"
    +String analysisOptionEveryFourthRisingEdge = "Every Fourth Rising Edge"
    +String analysisOptionDisabled = "Disabled"
    +String analyze = "Analyze"
    +String cancel = "Cancel"
    +String low = "Low"
    +String high = "High"
  }
  AppLocalizationsEn --|> AppLocalizations
Loading

File-Level Changes

Change Details Files
Refactor localization strings to natural case
  • Replaced ALL CAPS getters in English localization with natural case
  • Updated abstract localization comments to reflect new casing
  • Synced ARB file entries to natural case
lib/l10n/app_localizations_en.dart
lib/l10n/app_localizations.dart
lib/l10n/app_en.arb
Move uppercase styling to UI via toUpperCase()
  • Added .toUpperCase() calls to instrument headings, analysis options, buttons, and labels
  • Replaced direct uppercase translation usage in various screens and widgets
lib/view/instruments_screen.dart
lib/view/widgets/logic_analyzer_channel_selection.dart
lib/view/widgets/robotic_arm_summary.dart
lib/view/connect_device_screen.dart
lib/view/logged_data_screen.dart
lib/view/widgets/config_widgets.dart
lib/view/widgets/robotic_arm_controls.dart
lib/view/luxmeter_screen.dart
lib/view/settings_screen.dart
lib/view/widgets/robotic_arm_dialog.dart
Add missing override annotation
  • Inserted @OverRide above soundmeterConfig in English localization
lib/l10n/app_localizations_en.dart

Possibly linked issues

  • #0: The PR refactors translations to natural casing in generated files and uses .toUpperCase() in UI, directly implementing the issue's recommendations.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @AsCress - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `lib/l10n/app_localizations.dart:544` </location>
<code_context>
   /// No description provided for @wifi.
   ///
   /// In en, this message translates to:
-  /// **'WIFI'**
+  /// **'Wifi'**
   String get wifi;

</code_context>

<issue_to_address>
Consider using 'Wi-Fi' instead of 'Wifi' in documentation.

'Wi-Fi' is the standard spelling and improves clarity.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
  /// No description provided for @wifi.
  ///
  /// In en, this message translates to:
=======
  /// No description provided for @wifi.
  ///
  /// In en, this message translates to:
  /// **'Wi-Fi'**
>>>>>>> REPLACE

</suggested_fix>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

github-actions bot commented Jul 25, 2025

@mariobehling
Copy link
Member

Please follow best practices and mention the issue this PR resolves in the description.

Copy link
Collaborator

@CloudyPadmal CloudyPadmal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor change. Rest looks good.

@AsCress
Copy link
Collaborator Author

AsCress commented Jul 30, 2025

@CloudyPadmal Thanks for the review ! Made the changes.

@AsCress AsCress requested a review from CloudyPadmal July 30, 2025 17:15
@AsCress AsCress enabled auto-merge (squash) July 31, 2025 05:42
@AsCress AsCress merged commit 3124fca into fossasia:flutter Jul 31, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor Translation Values to Use Natural Casing (Avoid ALL CAPS in .arb Files)
3 participants