Use "mini" stream count alternatives for info items
Note: more_than_100_videos_mini and infinite_videos_mini are untranslatable
This commit is contained in:
parent
2b47a1b06a
commit
914d3c4a66
5 changed files with 23 additions and 9 deletions
|
|
@ -8,6 +8,7 @@ import android.content.res.Resources;
|
|||
import android.preference.PreferenceManager;
|
||||
|
||||
import org.schabi.newpipe.extractor.ListExtractor;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.DisplayMetrics;
|
||||
|
||||
|
|
@ -155,15 +156,26 @@ public final class Localization {
|
|||
public static String localizeStreamCount(final Context context, final long streamCount) {
|
||||
switch ((int) streamCount) {
|
||||
case (int) ListExtractor.ITEM_COUNT_MORE_THAN_100:
|
||||
return context.getResources().getString(R.string.playlist_more_than_100_items);
|
||||
return context.getResources().getString(R.string.more_than_100_videos);
|
||||
case (int) ListExtractor.ITEM_COUNT_INFINITE:
|
||||
return context.getResources().getString(R.string.playlist_infinite_items);
|
||||
return context.getResources().getString(R.string.infinite_videos);
|
||||
default:
|
||||
return getQuantity(context, R.plurals.videos, R.string.no_videos, streamCount,
|
||||
localizeNumber(context, streamCount));
|
||||
}
|
||||
}
|
||||
|
||||
public static String localizeStreamCountMini(final Context context, final long streamCount) {
|
||||
switch ((int) streamCount) {
|
||||
case (int) ListExtractor.ITEM_COUNT_MORE_THAN_100:
|
||||
return context.getResources().getString(R.string.more_than_100_videos_mini);
|
||||
case (int) ListExtractor.ITEM_COUNT_INFINITE:
|
||||
return context.getResources().getString(R.string.infinite_videos_mini);
|
||||
default:
|
||||
return String.valueOf(streamCount);
|
||||
}
|
||||
}
|
||||
|
||||
public static String localizeWatchingCount(final Context context, final long watchingCount) {
|
||||
return getQuantity(context, R.plurals.watching, R.string.no_one_watching, watchingCount,
|
||||
localizeNumber(context, watchingCount));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue