larryaasen / upgrader

A Flutter package for prompting users to upgrade when there is a newer version of the app in the store.
MIT License
552 stars 269 forks source link

buttonTitleLater in Arabic language doesn't look good!! #202

Closed alhamri closed 2 years ago

alhamri commented 2 years ago

String 'Later' doesn't look good in Arabic language 'لاحقاً' , in both UpgradeDialogStyle.cupertino and UpgradeDialogStyle.material.

upgrader log:

I/flutter (11742): upgrader: default operatingSystem: android SE1A.211212.001.B1
I/flutter (11742): upgrader: operatingSystem: android
I/flutter (11742): upgrader: platform: TargetPlatform.android
I/flutter (11742): upgrader: isAndroid: true, isIOS: false, isLinux: false, isMacOS: false, isWindows: false, isFuchsia: false, isWeb: false
I/flutter (11742): upgrader: package info packageName: com.alhamryApp.hijrimiladi_converter
I/flutter (11742): upgrader: package info appName: Hijri-Gregorian Calendar
I/flutter (11742): upgrader: package info version: 1.0.0
I/flutter (11742): upgrader: countryCode: US
I/flutter (11742): upgrader: blocked: false
I/flutter (11742): upgrader: debugDisplayAlways: false
I/flutter (11742): upgrader: debugDisplayOnce: false
I/flutter (11742): upgrader: hasAlerted: false
I/flutter (11742): upgrader: appStoreVersion: 2.0.6
I/flutter (11742): upgrader: installedVersion: 1.0.0
I/flutter (11742): upgrader: minAppVersion: null
I/flutter (11742): upgrader: isUpdateAvailable: true
I/flutter (11742): upgrader: shouldDisplayUpgrade: true
I/flutter (11742): upgrader: shouldDisplayReleaseNotes: false
I/flutter (11742): upgrader: showDialog title: هل تريد تحديث التطبيق؟
I/flutter (11742): upgrader: showDialog message: نسخة جديدة من Hijri-Gregorian Calendar متوفرة! النسخة 2.0.6 متوفرة الآن, أنت تستخدم النسخة 1.0.0.
I/flutter (11742): upgrader: showDialog releaseNotes: null
D/EGL_emulation(11742): app_time_stats: avg=778.94ms min=361.07ms max=1609.93ms count=3

upgrader version number from the pubspec.lock file:

  upgrader:
    dependency: "direct main"
    description:
      name: upgrader
      url: "https://pub.dartlang.org"
    source: hosted
    version: "4.4.2"

later2 later1

alhamri commented 2 years ago

I suggest to remove the two line at the left top of the word 'لاحقاً' what we called in Arabic 'Tanween' 'التنوين'. In Arabic it's not necessary to write them espicially when there is nothing else to said (for example at the end of a sentence). I think flutter engine decode these two lines (characters) differently and that is what rise the issue. I made a little change in your code (in class UpgraderMessages line 338) and removing those two lines and it works as expected:

case 'ar':
        message = 'لاحقا';
        break;

later4 later3

larryaasen commented 2 years ago

@alhamri This is very interesting and I would like to get this fixed correctly. I am having trouble understand your proposed changed. Would you be willing to open an PR to help me better understand?

alhamri commented 2 years ago

PR done: https://github.com/larryaasen/upgrader/pull/203#issue-1324527873

larryaasen commented 2 years ago

The PR https://github.com/larryaasen/upgrader/pull/203 has been merged so this has been resolved.