1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 00:20:32 +00:00

use format strings now

This commit is contained in:
Christian Schabesberger 2015-11-26 20:43:16 +01:00
parent b8a27adb93
commit cb4b20af45
12 changed files with 31 additions and 26 deletions

View File

@ -57,12 +57,12 @@ public class VideoInfoItemViewCreator {
} }
holder.itemVideoTitleView.setText(info.title); holder.itemVideoTitleView.setText(info.title);
holder.itemUploaderView.setText(info.uploader); holder.itemUploaderView.setText(info.uploader);
holder.itemDurationView.setText(""+info.duration); holder.itemDurationView.setText(info.duration);
if(!info.upload_date.isEmpty()) { if(!info.upload_date.isEmpty()) {
holder.itemUploadDateView.setText(info.upload_date); holder.itemUploadDateView.setText(info.upload_date);
} else { } else {
//tweak if necessary: This is a hack to prevent having white space in the layout :P //tweak if necessary: This is a hack to prevent having white space in the layout :P
holder.itemUploadDateView.setText(""+info.view_count); holder.itemUploadDateView.setText(String.format("%d", info.view_count));
} }
return convertView; return convertView;

View File

@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Resources;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.os.Bundle; import android.os.Bundle;
@ -197,6 +198,7 @@ public class VideoItemDetailFragment extends Fragment {
public void updateInfo(VideoInfo info) { public void updateInfo(VideoInfo info) {
currentVideoInfo = info; currentVideoInfo = info;
Resources res = activity.getResources();
try { try {
VideoInfoItemViewCreator videoItemViewCreator = VideoInfoItemViewCreator videoItemViewCreator =
new VideoInfoItemViewCreator(LayoutInflater.from(getActivity())); new VideoInfoItemViewCreator(LayoutInflater.from(getActivity()));
@ -235,8 +237,11 @@ public class VideoItemDetailFragment extends Fragment {
Locale locale = getPreferredLocale(); Locale locale = getPreferredLocale();
NumberFormat nf = NumberFormat.getInstance(locale); NumberFormat nf = NumberFormat.getInstance(locale);
String localisedViewCount = nf.format(info.view_count); String localisedViewCount = nf.format(info.view_count);
viewCountView.setText(localisedViewCount viewCountView.setText(
+ " " + activity.getString(R.string.viewSufix)); String.format(
res.getString(R.string.viewCountText), localisedViewCount));
/*viewCountView.setText(localisedViewCount
+ " " + activity.getString(R.string.viewSufix)); */
thumbsUpView.setText(nf.format(info.like_count)); thumbsUpView.setText(nf.format(info.like_count));
@ -255,7 +260,7 @@ public class VideoItemDetailFragment extends Fragment {
String localisedDate = df.format(datum); String localisedDate = df.format(datum);
uploadDateView.setText( uploadDateView.setText(
activity.getString(R.string.uploadDatePrefix) + " " + localisedDate); String.format(res.getString(R.string.uploadDateText), localisedDate));
descriptionView.setText(Html.fromHtml(info.description)); descriptionView.setText(Html.fromHtml(info.description));
descriptionView.setMovementMethod(LinkMovementMethod.getInstance()); descriptionView.setMovementMethod(LinkMovementMethod.getInstance());

View File

@ -2,8 +2,8 @@
<resources> <resources>
<string name="app_name">NewPipe</string> <string name="app_name">NewPipe</string>
<string name="title_videoitem_detail">NewPipe</string> <string name="title_videoitem_detail">NewPipe</string>
<string name="viewSufix">Aufrufe</string> <string name="viewCountText">%1$s Aufrufe</string>
<string name="uploadDatePrefix">Hochgeladen am </string> <string name="uploadDateText">Hochgeladen am %1$s</string>
<string name="noPlayerFound">Keinen Streamplayer gefunden. Vielleicht möchtest du einen installieren.</string> <string name="noPlayerFound">Keinen Streamplayer gefunden. Vielleicht möchtest du einen installieren.</string>
<string name="installStreamPlayer">Jetzt installieren</string> <string name="installStreamPlayer">Jetzt installieren</string>
<string name="cancel">Abbrechen</string> <string name="cancel">Abbrechen</string>

View File

@ -2,8 +2,8 @@
<resources> <resources>
<string name="app_name">NewPipe</string> <string name="app_name">NewPipe</string>
<string name="title_videoitem_detail">NewPipe</string> <string name="title_videoitem_detail">NewPipe</string>
<string name="viewSufix">visitas</string> <string name="viewCountText">%1$s visitas</string>
<string name="uploadDatePrefix">Subido el </string> <string name="uploadDateText">Subido el %1$s</string>
<string name="noPlayerFound">No se ha encontrado ningún reproductor de vídeo. Quizás quieras instalar alguno.</string> <string name="noPlayerFound">No se ha encontrado ningún reproductor de vídeo. Quizás quieras instalar alguno.</string>
<string name="installStreamPlayer">Instalarlo</string> <string name="installStreamPlayer">Instalarlo</string>
<string name="cancel">Cancelar</string> <string name="cancel">Cancelar</string>

View File

@ -2,8 +2,8 @@
<resources> <resources>
<string name="app_name">NewPipe</string> <string name="app_name">NewPipe</string>
<string name="title_videoitem_detail">NewPipe</string> <string name="title_videoitem_detail">NewPipe</string>
<string name="viewSufix">نماها</string> <string name="viewCountText">%1$s نماها</string>
<string name="uploadDatePrefix">بارگذاری‌شده در: </string> <string name="uploadDateText">بارگذاری‌شده در: %1$s</string>
<string name="noPlayerFound">هیچ پخش‌کننده‌ی جریانی یافت نشد. ممکن است بخواهید یکی نصب کنید.</string> <string name="noPlayerFound">هیچ پخش‌کننده‌ی جریانی یافت نشد. ممکن است بخواهید یکی نصب کنید.</string>
<string name="installStreamPlayer">نصب کنید</string> <string name="installStreamPlayer">نصب کنید</string>
<string name="cancel">انصراف</string> <string name="cancel">انصراف</string>

View File

@ -29,10 +29,10 @@
<string name="showPlayWithKodiTitle">Afficher l\'option \"Lire avec Kodi\"</string> <string name="showPlayWithKodiTitle">Afficher l\'option \"Lire avec Kodi\"</string>
<string name="title_activity_settings">Paramètres</string> <string name="title_activity_settings">Paramètres</string>
<string name="title_videoitem_detail">NewPipe</string> <string name="title_videoitem_detail">NewPipe</string>
<string name="uploadDatePrefix">Mise en ligne le </string> <string name="uploadDateText">Mise en ligne le %1$s</string>
<string name="useExternalPlayerTitle">Utiliser un lecteur externe</string> <string name="useExternalPlayerTitle">Utiliser un lecteur externe</string>
<string name="viewSufix">vues</string> <string name="viewCountText">%1$s vues</string>
<string name="leftPlayButtonTitle">Afficher le bouton de lecture sur la gauche.</string> <string name="leftPlayButtonTitle">Afficher le bouton de lecture sur la gauche.</string>
<string name="playAudio">Audio</string> <string name="playAudio">Audio</string>
<string name="defaultAudioFormatTitle">Format audio par défaut</string> <string name="defaultAudioFormatTitle">Format audio par défaut</string>
<string name="webMAudioDescription">WebM- format libre</string> <string name="webMAudioDescription">WebM- format libre</string>

View File

@ -2,8 +2,8 @@
<resources> <resources>
<string name="app_name">NewPipe</string> <string name="app_name">NewPipe</string>
<string name="title_videoitem_detail">NewPipe</string> <string name="title_videoitem_detail">NewPipe</string>
<string name="viewSufix">megtekintés</string> <string name="viewCountText">%1$s megtekintés</string>
<string name="uploadDatePrefix">Feltöltve: </string> <string name="uploadDateText">Feltöltve: %1$s</string>
<string name="noPlayerFound">Nem található lejátszó. Telepítsen egyet!</string> <string name="noPlayerFound">Nem található lejátszó. Telepítsen egyet!</string>
<string name="installStreamPlayer">Telepítsen egyet</string> <string name="installStreamPlayer">Telepítsen egyet</string>
<string name="cancel">Mégse</string> <string name="cancel">Mégse</string>

View File

@ -1,8 +1,8 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<resources><string name="app_name">ニューパイプ</string> <resources><string name="app_name">ニューパイプ</string>
<string name="title_videoitem_detail">ニューパイプ</string> <string name="title_videoitem_detail">ニューパイプ</string>
<string name="viewSufix">表示</string> <string name="viewCountText">%1$s 表示</string>
<string name="uploadDatePrefix">"アップロード: "</string> <string name="uploadDateText">"アップロード: "%1$s</string>
<string name="noPlayerFound">StreamPlayer が見つかりませんでした。インストールが必要になるかもしれません.</string> <string name="noPlayerFound">StreamPlayer が見つかりませんでした。インストールが必要になるかもしれません.</string>
<string name="installStreamPlayer">インストール</string> <string name="installStreamPlayer">インストール</string>
<string name="cancel">キャンセル</string> <string name="cancel">キャンセル</string>

View File

@ -2,8 +2,8 @@
<resources> <resources>
<string name="app_name">NewPipe</string> <string name="app_name">NewPipe</string>
<string name="title_videoitem_detail">NewPipe</string> <string name="title_videoitem_detail">NewPipe</string>
<string name="viewSufix">keer bekeken</string> <string name="viewCountText">%1$s keer bekeken</string>
<string name="uploadDatePrefix">Geüpload op </string> <string name="uploadDateText">Geüpload op %1$s</string>
<string name="noPlayerFound">Geen speler met streaming ondersteuning gevonden. Misschien wil je er een installeren.</string> <string name="noPlayerFound">Geen speler met streaming ondersteuning gevonden. Misschien wil je er een installeren.</string>
<string name="installStreamPlayer">Installeer speler</string> <string name="installStreamPlayer">Installeer speler</string>
<string name="cancel">Annuleer</string> <string name="cancel">Annuleer</string>

View File

@ -2,8 +2,8 @@
<resources> <resources>
<string name="app_name">NewPipe</string> <string name="app_name">NewPipe</string>
<string name="title_videoitem_detail">NewPipe</string> <string name="title_videoitem_detail">NewPipe</string>
<string name="viewSufix">просмотров</string> <string name="viewCountText">%1$s просмотров</string>
<string name="uploadDatePrefix">Опубликовано: </string> <string name="uploadDateText">Опубликовано: %1$s</string>
<string name="noPlayerFound">Ни одного потокового проигрывателя не было найдено. Установить?</string> <string name="noPlayerFound">Ни одного потокового проигрывателя не было найдено. Установить?</string>
<string name="installStreamPlayer">Установить</string> <string name="installStreamPlayer">Установить</string>
<string name="cancel">Отмена</string> <string name="cancel">Отмена</string>

View File

@ -2,8 +2,8 @@
<resources> <resources>
<string name="app_name">Јутјуб цев</string> <string name="app_name">Јутјуб цев</string>
<string name="title_videoitem_detail">Јутјуб цев</string> <string name="title_videoitem_detail">Јутјуб цев</string>
<string name="viewSufix">приказа</string> <string name="viewCountText">%1$s приказа</string>
<string name="uploadDatePrefix">"Отпремљен "</string> <string name="uploadDateText">"Отпремљен "%1$s</string>
<string name="noPlayerFound">Нема плејера токова. Можда желите да га инсталирате.</string> <string name="noPlayerFound">Нема плејера токова. Можда желите да га инсталирате.</string>
<string name="installStreamPlayer">Инсталирај</string> <string name="installStreamPlayer">Инсталирај</string>
<string name="cancel">Одустани</string> <string name="cancel">Одустани</string>

View File

@ -2,8 +2,8 @@
<resources> <resources>
<string name="app_name">NewPipe</string> <string name="app_name">NewPipe</string>
<string name="title_videoitem_detail">NewPipe</string> <string name="title_videoitem_detail">NewPipe</string>
<string name="viewSufix">views</string> <string name="viewCountText">%1$s views</string>
<string name="uploadDatePrefix">Uploaded on </string> <string name="uploadDateText">Uploaded on %1$s</string>
<string name="noPlayerFound">No stream player found. You may want to install one.</string> <string name="noPlayerFound">No stream player found. You may want to install one.</string>
<string name="installStreamPlayer">Install</string> <string name="installStreamPlayer">Install</string>
<string name="cancel">Cancel</string> <string name="cancel">Cancel</string>