leoafarias / sidekick

A simple app to make Flutter development more delightful
BSD 3-Clause "New" or "Revised" License
1.57k stars 101 forks source link

Why breaking up a single sentence in localizations? #279

Closed BrutalCoding closed 1 year ago

BrutalCoding commented 1 year ago

Bug

This is one of the text issues that I noticed and wanted to solve:

image

As seen in the image, I have added the markers 1 and 2 to highlight the problem I'm describing below.

Problem

This single sentence is for no good reason broken up in 2 sentences. Is there a particular reason for this? These translations are only used on the page seen in my screenshot, so it's not being re-used anywhere else.

{
    "thisWillOnlyCloneFlutterAndNotInstall": "This will only clone Flutter and not install it ",
    "dependenciesAfterANewVersionIsInstalled": "Dependencies after a new version is installed.",
}

File location: localizations/en-US/modules.json

Solutions

There are quite a bit of translation files, and I don't have the time to go through them yet.

Merge into single sentence

But I'd propose to merge this into a single sentence.

For example:

{
    "onlyFlutterCloneAndNotTheDependencies": "This will only clone Flutter and not install it's dependencies after a new version is installed.",
}

Reason on why not to recase it in Dart

We shouldn't try to change the casing, although it will be perfectly fine in English, its not a guaranteed solution in other languages.

I'm talking about adjusting the following Dart code found in fvm_settings.scene.dart:

Original:

Text(
  context.i18n(
          'modules:settings.scenes.thisWillOnlyCloneFlutterAndNotInstall') +
      context.i18n(
          'modules:settings.scenes.dependenciesAfterANewVersionIsInstalled'),
)

Sentence case:

Text(
  (context.i18n(
          'modules:settings.scenes.thisWillOnlyCloneFlutterAndNotInstall') +
      context.i18n(
          'modules:settings.scenes.dependenciesAfterANewVersionIsInstalled')).toSentenceCase(),
)
aguilaair commented 1 year ago

This was discussed in https://github.com/fluttertools/sidekick/pull/95#pullrequestreview-686323545 and supposedly fixed. In this specific example, the strings should be separate lines in any case, as the sentence is not gramatically correct.

The other intl related PR: https://github.com/fluttertools/sidekick/pull/112

BrutalCoding commented 1 year ago

I'm closing this issue since it's been stale. I mainly opened this issue just to bring awareness. Thanks for your swift reply @aguilaair.