Skip to content

Commit 2623aff

Browse files
author
Langston Smith
authored
Adding Portuguese language support to Localization Plugin (#979)
1 parent be65291 commit 2623aff

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

  • plugin-localization/src/main/java/com/mapbox/mapboxsdk/plugins/localization

plugin-localization/src/main/java/com/mapbox/mapboxsdk/plugins/localization/MapLocale.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,20 @@ public final class MapLocale {
192192
.include(new LatLng(27.4335426, -18.3936845))
193193
.include(new LatLng(43.9933088, 4.5918885)).build();
194194

195+
/**
196+
* Portugal Bounding box extracted from Open Street Map
197+
*/
198+
static final LatLngBounds PORTUGAL_BBOX = new LatLngBounds.Builder()
199+
.include(new LatLng(27.4335426, -18.3936845))
200+
.include(new LatLng(42.280468655, -6.3890876937)).build();
201+
202+
/**
203+
* Brazil Bounding box extracted from Open Street Map
204+
*/
205+
static final LatLngBounds BRAZIL_BBOX = new LatLngBounds.Builder()
206+
.include(new LatLng(5.2842873, -33.8689056))
207+
.include(new LatLng(-28.6341164, -73.9830625)).build();
208+
195209
/*
196210
* Some MapLocales already defined (these match with the predefined ones in the Locale class)
197211
*/
@@ -266,6 +280,16 @@ public final class MapLocale {
266280
*/
267281
public static final MapLocale SPAIN = new MapLocale(SPANISH, SPAIN_BBOX);
268282

283+
/**
284+
* Useful constant for country.
285+
*/
286+
public static final MapLocale PORTUGAL = new MapLocale(PORTUGUESE, PORTUGAL_BBOX);
287+
288+
/**
289+
* Useful constant for country.
290+
*/
291+
public static final MapLocale BRAZIL = new MapLocale(PORTUGUESE, BRAZIL_BBOX);
292+
269293
/**
270294
* Maps out the Matching pair of {@link Locale} and {@link MapLocale}. In other words, if I have a
271295
* {@link Locale#CANADA}, this should be matched up with {@link MapLocale#CANADA}.
@@ -286,6 +310,8 @@ public final class MapLocale {
286310
LOCALE_SET.put(Locale.FRANCE, MapLocale.FRANCE);
287311
LOCALE_SET.put(new Locale("ru", "RU"), RUSSIA);
288312
LOCALE_SET.put(new Locale("es", "ES"), SPAIN);
313+
LOCALE_SET.put(new Locale("pt", "PT"), PORTUGAL);
314+
LOCALE_SET.put(new Locale("pt", "BR"), BRAZIL);
289315

290316
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
291317
Locale zh_CN_Hans = new Locale.Builder().setLanguage("zh").setRegion("CN").setScript("Hans").build();

0 commit comments

Comments
 (0)