Localize building levels in place view.

To make it clearer what this field is about
and what the numerical value means.
For #4452.

Signed-off-by: Antonin Delpeuch <antonin@delpeuch.eu>
This commit is contained in:
Antonin Delpeuch 2024-03-16 10:03:07 +01:00 committed by Konstantin Pastbin
parent 6940375538
commit 9edf452d27
3 changed files with 17 additions and 1 deletions

View file

@ -662,6 +662,13 @@ public class Utils
return brand;
}
public static String getLocalizedLevel(@NonNull Context context, @Nullable String level)
{
if (TextUtils.isEmpty(level))
return "";
return context.getString(R.string.level_value_generic, level);
}
private static class SupportInfoWithLogsCallback implements LogsManager.OnZipCompletedListener
{
@NonNull

View file

@ -405,7 +405,8 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
refreshMetadataOrHide(Framework.nativeGetActiveObjectFormattedCuisine(), mCuisine, mTvCuisine);
refreshWiFi();
refreshMetadataOrHide(mMapObject.getMetadata(Metadata.MetadataType.FMD_FLATS), mEntrance, mTvEntrance);
refreshMetadataOrHide(mMapObject.getMetadata(Metadata.MetadataType.FMD_LEVEL), mLevel, mTvLevel);
final String level = Utils.getLocalizedLevel(getContext(), mMapObject.getMetadata(Metadata.MetadataType.FMD_LEVEL));
refreshMetadataOrHide(level, mLevel, mTvLevel);
final String cap = mMapObject.getMetadata(Metadata.MetadataType.FMD_CAPACITY);
refreshMetadataOrHide(!TextUtils.isEmpty(cap) ? getString(R.string.capacity, cap) : "", mCapacity, mTvCapacity);

View file

@ -14612,6 +14612,14 @@
zh-Hans = 楼层
zh-Hant = 樓層
[level_value_generic]
tags = android,ios
comment = Building level
en = Level: %s
de = Stock: %s
fr = Niveau : %s
ru = Этаж: %s
[please_note]
tags = ios
en = Please note