public class LocalizedString extends Object implements I18NString, Serializable
Constructor and Description |
---|
LocalizedString(String key,
OSMWithTags way)
Creates String which can be localized
|
LocalizedString(String key,
String[] params)
Creates String which can be localized
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
String |
toString()
Returns translated string in default locale
with tag_names replaced with values
Default locale is defaultLocale from
ResourceBundleSingleton |
String |
toString(Locale locale)
Returns translated string in wanted locale
with tag_names replaced with values
|
public LocalizedString(String key, String[] params)
key
- key of translation for this way set in DefaultWayPropertySetSource
and translations read from from properties Filesparams
- Values with which tagNames are replaced in translations.public LocalizedString(String key, OSMWithTags way)
Uses getTagNames()
to get which tag values are needed for this key.
For each of this tag names tag value is read from OSM way.
If tag value is missing it is added as empty string.
For example. If key platform has key {ref} current value of tag ref in way is saved to be used in localizations.
It currently assumes that tag exists in way. (otherwise this namer wouldn't be used)
key
- key of translation for this way set in DefaultWayPropertySetSource
and translations read from from properties Filesway
- OSM way from which tag values are readpublic String toString()
ResourceBundleSingleton
toString
in interface I18NString
toString
in class Object
public String toString(Locale locale)
toString
in interface I18NString
locale
- Wanted localeCopyright © 2018. All rights reserved.