Skip to content

Commit

Permalink
[Locale] Fix punctuation issue in French
Browse files Browse the repository at this point in the history
In French, a two or multi-part punctuation mark must have space before and
after the punctuation mark. Consequently, : (colon) must have space on both
sides.

NOTE: While this fixes punctuation issue in most places, it cannot be asserted
that ALL punctuation issues have been fixed.

Signed-off-by: Muntashir Al-Islam <[email protected]>
  • Loading branch information
MuntashirAkon committed Sep 17, 2021
1 parent ec4adc6 commit 0285370
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
import android.content.res.Configuration;
import android.content.res.Resources;

import java.util.IllformedLocaleException;
import java.util.Locale;

import androidx.annotation.NonNull;
import androidx.collection.ArrayMap;
import androidx.core.os.ConfigurationCompat;
import androidx.core.os.LocaleListCompat;

import com.yariksoffice.lingver.Lingver;

import java.util.IllformedLocaleException;
import java.util.Locale;

import io.github.muntashirakon.AppManager.R;

public final class LangUtils {
Expand Down Expand Up @@ -68,4 +71,10 @@ public static boolean isValidLocale(@NonNull String languageTag) {
}
return false;
}

@NonNull
public static String getSeparatorString() {
if (Lingver.getInstance().getLanguage().equals("fr")) return " : ";
return ": ";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public static Spannable getStyledKeyValue(@NonNull Context context, @StringRes i

@NonNull
public static Spannable getStyledKeyValue(@NonNull Context context, CharSequence key, CharSequence value) {
return getStyledKeyValue(context, key, value, ": ");
return getStyledKeyValue(context, key, value, LangUtils.getSeparatorString());
}

@NonNull
Expand Down

0 comments on commit 0285370

Please sign in to comment.