From cb4b20af45fd409c63b695df225b95427b5bbe6b Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Thu, 26 Nov 2015 20:43:16 +0100 Subject: [PATCH] use format strings now --- .../org/schabi/newpipe/VideoInfoItemViewCreator.java | 4 ++-- .../org/schabi/newpipe/VideoItemDetailFragment.java | 11 ++++++++--- app/src/main/res/values-de/strings.xml | 4 ++-- app/src/main/res/values-es/strings.xml | 4 ++-- app/src/main/res/values-fa/strings.xml | 4 ++-- app/src/main/res/values-fr/strings.xml | 6 +++--- app/src/main/res/values-hu/strings.xml | 4 ++-- app/src/main/res/values-ja/strings.xml | 4 ++-- app/src/main/res/values-nl/strings.xml | 4 ++-- app/src/main/res/values-ru/strings.xml | 4 ++-- app/src/main/res/values-sr/strings.xml | 4 ++-- app/src/main/res/values/strings.xml | 4 ++-- 12 files changed, 31 insertions(+), 26 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/VideoInfoItemViewCreator.java b/app/src/main/java/org/schabi/newpipe/VideoInfoItemViewCreator.java index 19064c211..07cd09e3c 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoInfoItemViewCreator.java +++ b/app/src/main/java/org/schabi/newpipe/VideoInfoItemViewCreator.java @@ -57,12 +57,12 @@ public class VideoInfoItemViewCreator { } holder.itemVideoTitleView.setText(info.title); holder.itemUploaderView.setText(info.uploader); - holder.itemDurationView.setText(""+info.duration); + holder.itemDurationView.setText(info.duration); if(!info.upload_date.isEmpty()) { holder.itemUploadDateView.setText(info.upload_date); } else { //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; diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java b/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java index 3fe8a1548..8c244cff0 100644 --- a/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java +++ b/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java @@ -4,6 +4,7 @@ import android.annotation.SuppressLint; import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; +import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; @@ -197,6 +198,7 @@ public class VideoItemDetailFragment extends Fragment { public void updateInfo(VideoInfo info) { currentVideoInfo = info; + Resources res = activity.getResources(); try { VideoInfoItemViewCreator videoItemViewCreator = new VideoInfoItemViewCreator(LayoutInflater.from(getActivity())); @@ -235,8 +237,11 @@ public class VideoItemDetailFragment extends Fragment { Locale locale = getPreferredLocale(); NumberFormat nf = NumberFormat.getInstance(locale); String localisedViewCount = nf.format(info.view_count); - viewCountView.setText(localisedViewCount - + " " + activity.getString(R.string.viewSufix)); + viewCountView.setText( + String.format( + res.getString(R.string.viewCountText), localisedViewCount)); + /*viewCountView.setText(localisedViewCount + + " " + activity.getString(R.string.viewSufix)); */ thumbsUpView.setText(nf.format(info.like_count)); @@ -255,7 +260,7 @@ public class VideoItemDetailFragment extends Fragment { String localisedDate = df.format(datum); uploadDateView.setText( - activity.getString(R.string.uploadDatePrefix) + " " + localisedDate); + String.format(res.getString(R.string.uploadDateText), localisedDate)); descriptionView.setText(Html.fromHtml(info.description)); descriptionView.setMovementMethod(LinkMovementMethod.getInstance()); diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 8324cf614..b65b23ccf 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -2,8 +2,8 @@ NewPipe NewPipe - Aufrufe - Hochgeladen am + %1$s Aufrufe + Hochgeladen am %1$s Keinen Streamplayer gefunden. Vielleicht möchtest du einen installieren. Jetzt installieren Abbrechen diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 4bafaf739..02b2e49aa 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -2,8 +2,8 @@ NewPipe NewPipe - visitas - Subido el + %1$s visitas + Subido el %1$s No se ha encontrado ningún reproductor de vídeo. Quizás quieras instalar alguno. Instalarlo Cancelar diff --git a/app/src/main/res/values-fa/strings.xml b/app/src/main/res/values-fa/strings.xml index 8a5a7b831..171c95453 100644 --- a/app/src/main/res/values-fa/strings.xml +++ b/app/src/main/res/values-fa/strings.xml @@ -2,8 +2,8 @@ NewPipe NewPipe - نماها - بارگذاری‌شده در: + %1$s نماها + بارگذاری‌شده در: %1$s هیچ پخش‌کننده‌ی جریانی یافت نشد. ممکن است بخواهید یکی نصب کنید. نصب کنید انصراف diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 5b76817af..682b6653f 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -29,10 +29,10 @@ Afficher l\'option \"Lire avec Kodi\" Paramètres NewPipe - Mise en ligne le + Mise en ligne le %1$s Utiliser un lecteur externe - vues -Afficher le bouton de lecture sur la gauche. + %1$s vues + Afficher le bouton de lecture sur la gauche. Audio Format audio par défaut WebM- format libre diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 7a8abc699..440743000 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -2,8 +2,8 @@ NewPipe NewPipe - megtekintés - Feltöltve: + %1$s megtekintés + Feltöltve: %1$s Nem található lejátszó. Telepítsen egyet! Telepítsen egyet Mégse diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index f02bd6fcb..071fe997d 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -1,8 +1,8 @@ ニューパイプ ニューパイプ - 表示 - "アップロード: " + %1$s 表示 + "アップロード: "%1$s StreamPlayer が見つかりませんでした。インストールが必要になるかもしれません. インストール キャンセル diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 20b495726..834101e85 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -2,8 +2,8 @@ NewPipe NewPipe - keer bekeken - Geüpload op + %1$s keer bekeken + Geüpload op %1$s Geen speler met streaming ondersteuning gevonden. Misschien wil je er een installeren. Installeer speler Annuleer diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index ecacc79f7..350b72c16 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -2,8 +2,8 @@ NewPipe NewPipe - просмотров - Опубликовано: + %1$s просмотров + Опубликовано: %1$s Ни одного потокового проигрывателя не было найдено. Установить? Установить Отмена diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml index 9b916fa06..29d17c7db 100644 --- a/app/src/main/res/values-sr/strings.xml +++ b/app/src/main/res/values-sr/strings.xml @@ -2,8 +2,8 @@ Јутјуб цев Јутјуб цев - приказа - "Отпремљен " + %1$s приказа + "Отпремљен "%1$s Нема плејера токова. Можда желите да га инсталирате. Инсталирај Одустани diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0ef26f2b6..e0928837d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2,8 +2,8 @@ NewPipe NewPipe - views - Uploaded on + %1$s views + Uploaded on %1$s No stream player found. You may want to install one. Install Cancel