forked from organicmaps/organicmaps
Added support of new plurals
This commit is contained in:
parent
c82204adb3
commit
9e93bce37a
7 changed files with 15 additions and 11 deletions
|
@ -51,7 +51,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/margin_quarter"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"
|
||||
android:text="@string/placepage_summary_rating_description"/>
|
||||
android:text="@plurals/placepage_summary_rating_description"/>
|
||||
<com.mapswithme.maps.widget.RatingView
|
||||
android:id="@id/rv__summary_rating"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -48,7 +48,8 @@ public class KmlImportController implements BookmarkManager.KmlConversionListene
|
|||
mProgressDialog.show();
|
||||
};
|
||||
|
||||
String msg = mContext.getResources().getQuantityString(R.plurals.bookmarks_detect_message, count);
|
||||
String msg = mContext.getResources().getQuantityString(
|
||||
R.plurals.bookmarks_detect_message, count, count);
|
||||
DialogUtils.showAlertDialog(mContext, R.string.bookmarks_detect_title, msg,
|
||||
R.string.button_convert, clickListener, R.string.cancel);
|
||||
}
|
||||
|
|
|
@ -212,8 +212,9 @@ public class UGCController implements View.OnClickListener, UGC.UGCListener
|
|||
}
|
||||
|
||||
Context context = mPlacePage.getContext();
|
||||
mReviewCount.setText(context.getString(R.string.placepage_summary_rating_description,
|
||||
String.valueOf(ugc.getBasedOnCount())));
|
||||
int reviewsCount = ugc.getBasedOnCount();
|
||||
mReviewCount.setText(context.getResources().getQuantityString(
|
||||
R.plurals.placepage_summary_rating_description, reviewsCount, reviewsCount));
|
||||
ratingView.setRating(Impress.values()[impress], rating);
|
||||
setSummaryViews(ugc, impress, rating);
|
||||
setUserReviewAndRatingsView(ugcUpdate);
|
||||
|
@ -231,8 +232,9 @@ public class UGCController implements View.OnClickListener, UGC.UGCListener
|
|||
RatingView ratingView = (RatingView) mSummaryRootView.findViewById(R.id.rv__summary_rating);
|
||||
ratingView.setRating(Impress.values()[impress], rating);
|
||||
Context context = mPlacePage.getContext();
|
||||
mSummaryReviewCount.setText(context.getString(R.string.placepage_summary_rating_description,
|
||||
String.valueOf(ugc.getBasedOnCount())));
|
||||
int reviewsCount = ugc.getBasedOnCount();
|
||||
mSummaryReviewCount.setText(context.getResources().getQuantityString(
|
||||
R.plurals.placepage_summary_rating_description, reviewsCount, reviewsCount));
|
||||
mUGCRatingRecordsAdapter.setItems(ugc.getRatings());
|
||||
|
||||
}
|
||||
|
|
|
@ -755,8 +755,9 @@ public class PlacePageView extends RelativeLayout
|
|||
mReviewAdapter.setItems(new ArrayList<>(Arrays.asList(info.mReviews)));
|
||||
//noinspection ConstantConditions
|
||||
mHotelRating.setText(mSponsored.getRating());
|
||||
String text = getResources().getString(R.string.placepage_summary_rating_description,
|
||||
String.valueOf(info.mReviewsAmount));
|
||||
int reviewsCount = (int) info.mReviewsAmount;
|
||||
String text = getResources().getQuantityString(
|
||||
R.plurals.placepage_summary_rating_description, reviewsCount, reviewsCount);
|
||||
mHotelRatingBase.setText(text);
|
||||
TextView previewReviewCountView = (TextView) mPreviewRatingInfo.findViewById(R.id.tv__review_count);
|
||||
previewReviewCountView.setText(text);
|
||||
|
|
|
@ -5,6 +5,6 @@ final class PPReviewHeaderCell: UITableViewCell {
|
|||
|
||||
@objc func config(rating: UGCRatingValueType, numberOfReviews: Int) {
|
||||
self.rating.text = rating.value
|
||||
count.text = String(coreFormat: L("placepage_summary_rating_description"), arguments: [numberOfReviews])
|
||||
count.text = String(format:L("placepage_summary_rating_description"), numberOfReviews)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ final class UGCSummaryRatingCell: MWMTableViewCell {
|
|||
}
|
||||
|
||||
@objc func config(reviewsCount: UInt, summaryRating: UGCRatingValueType, ratings: [UGCRatingStars]) {
|
||||
countLabel.text = String(coreFormat: L("placepage_summary_rating_description"), arguments: [reviewsCount])
|
||||
countLabel.text = String(format:L("placepage_summary_rating_description"), reviewsCount)
|
||||
ratingSummaryView.value = summaryRating.value
|
||||
ratingSummaryView.type = summaryRating.type
|
||||
self.ratings = ratings
|
||||
|
|
|
@ -55,7 +55,7 @@ final class PPPReview: MWMTableViewCell {
|
|||
ratingSummaryView.defaultConfig()
|
||||
|
||||
if reviewsCount > 0 {
|
||||
reviewsLabel.text = String(coreFormat: L("placepage_summary_rating_description"), arguments: [reviewsCount])
|
||||
reviewsLabel.text = String(format:L("placepage_summary_rating_description"), reviewsCount)
|
||||
reviewsLabel.isHidden = false
|
||||
} else {
|
||||
reviewsLabel.text = ""
|
||||
|
|
Loading…
Add table
Reference in a new issue