Repository: crsmithdev/arrow
Pull request #632 (2019-08-07 18:21:37)

Updates to BrazilianPortugueseLocale

jadchaar: @Choco02 thanks for the great contribution! Everything looks good except for the Travis CI build--the linting step is currently failing. You can fix this by running the following command: `make lint` or `tox -e lint`. Once you run this command, push the files to the branch :). 

Patch:
diff --git a/HISTORY.md b/HISTORY.md
index c430308..78425d8 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -1,5 +1,11 @@
 ## History
 
+### 0.14.5
+
+- [NEW] Added Afrikaans locale.
+- [CHANGE] Removed deprecated replace shift functionality.
+- [FIX] Fixed bug that occurred when factory.get() was passed a locale kwarg.
+
 ### 0.14.4
 
 - [FIX] Fixed a regression in 0.14.3 that prevented a tzinfo argument of type string to be passed to the `get()` function. Functionality such as `arrow.get("2019072807", "YYYYMMDDHH", tzinfo="UTC")` should work as normal again.
diff --git a/arrow/_version.py b/arrow/_version.py
index 224f1fb..141826d 100644
--- a/arrow/_version.py
+++ b/arrow/_version.py
@@ -1,1 +1,1 @@
-__version__ = "0.14.4"
+__version__ = "0.14.5"
diff --git a/arrow/factory.py b/arrow/factory.py
index c4c7291..8cca6ac 100644
--- a/arrow/factory.py
+++ b/arrow/factory.py
@@ -150,7 +150,7 @@ class ArrowFactory(object):
         """
 
         arg_count = len(args)
-        locale = kwargs.get("locale", "en_us")
+        locale = kwargs.pop("locale", "en_us")
         tz = kwargs.get("tzinfo", None)
 
         # if kwargs given, send to constructor unless only tzinfo provided
diff --git a/arrow/locales.py b/arrow/locales.py
index 20017af..81a7bad 100644
--- a/arrow/locales.py
+++ b/arrow/locales.py
@@ -1753,6 +1753,66 @@ class BrazilianPortugueseLocale(PortugueseLocale):
 
     past = "faz {0}"
 
+    future = "em {0}"
+
+    timeframes = {
+        "now": "agora",
+        "seconds": "segundos",
+        "minute": "um minuto",
+        "minutes": "{0} minutos",
+        "hour": "uma hora",
+        "hours": "{0} horas",
+        "day": "um dia",
+        "days": "{0} dias",
+        "month": "um mês",
+        "months": "{0} meses",
+        "year": "um ano",
+        "years": "{0} anos",
+    }
+
+    month_names = [
+        "",
+        "Janeiro",
+        "Fevereiro",
+        "Março",
+        "Abril",
+        "Maio",
+        "Junho",
+        "Julho",
+        "Agosto",
+        "Setembro",
+        "Outubro",
+        "Novembro",
+        "Dezembro",
+    ]
+    month_abbreviations = [
+        "",
+        "Jan",
+        "Fev",
+        "Mar",
+        "Abr",
+        "Mai",
+        "Jun",
+        "Jul",
+        "Ago",
+        "Set",
+        "Out",
+        "Nov",
+        "Dez",
+    ]
+
+    day_names = [
+        "",
+        "Segunda-feira",
+        "Terça-feira",
+        "Quarta-feira",
+        "Quinta-feira",
+        "Sexta-feira",
+        "Sábado",
+        "Domingo",
+    ]
+    day_abbreviations = ["", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab", "Dom"]
+
 
 class TagalogLocale(Locale):
 


Test patch:
diff --git a/tests/factory_tests.py b/tests/factory_tests.py
index 635f0d0..acd4c36 100644
--- a/tests/factory_tests.py
+++ b/tests/factory_tests.py
@@ -257,15 +257,19 @@ class GetTests(Chai):
         with self.assertRaises(TypeError):
             self.factory.get(year=2016, month=7)
 
-    def test_locale_kwarg_only(self):
+    def test_locale(self):
+        result = self.factory.get("2010", "YYYY", locale="ja")
+        self.assertEqual(
+            result._datetime, datetime(2010, 1, 1, 0, 0, 0, 0, tzinfo=tz.tzutc())
+        )
 
-        with self.assertRaises(TypeError):
-            self.factory.get(locale="ja")
+    def test_locale_kwarg_only(self):
+        res = self.factory.get(locale="ja")
+        self.assertEqual(res.tzinfo, tz.tzutc())
 
     def test_locale_with_tzinfo(self):
-
-        with self.assertRaises(TypeError):
-            self.factory.get(locale="ja", tzinfo=tz.gettz("Asia/Tokyo"))
+        res = self.factory.get(locale="ja", tzinfo=tz.gettz("Asia/Tokyo"))
+        self.assertEqual(res.tzinfo, tz.gettz("Asia/Tokyo"))
 
 
 class UtcNowTests(Chai):