leoafarias/sidekick

Why breaking up a single sentence in localizations?

Closed this issue · 2 comments

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(),
)
  • toSentenceCase() does not exist out of the box with Flutter, but we could easily add this by writing a String extension somewhere and importing it here.

This was discussed in #95 (review) 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: #112

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.