Skip to content

Commit

Permalink
Fix lformat wrong on AM/PM cases in locale tr (bitwalker#698)
Browse files Browse the repository at this point in the history
* Fix i18n for day_periods

* Add test case about %P and %p on locale tr
  • Loading branch information
thaiyojee authored May 3, 2022
1 parent 43c998e commit aa3fa6f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
8 changes: 4 additions & 4 deletions priv/translations/tr/LC_MESSAGES/day_periods.po
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ msgstr ""

#: lib/l10n/translator.ex:266
msgid "AM"
msgstr "ÖÖ"
msgstr "ÖÖ"

#: lib/l10n/translator.ex:268
msgid "PM"
msgstr "ÖS"
msgstr "ÖS"

#: lib/l10n/translator.ex:267
msgid "am"
msgstr "öö"
msgstr "öö"

#: lib/l10n/translator.ex:269
msgid "pm"
msgstr "ös"
msgstr "ös"
18 changes: 18 additions & 0 deletions test/lformat_strftime_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
defmodule DateFormatTest.LFormatStrftime do
use ExUnit.Case, async: true
use Timex

@aug182013_am Timex.to_datetime({{2013, 8, 18}, {11, 00, 5}})
@aug182013_pm Timex.to_datetime({{2013, 8, 18}, {12, 30, 5}})

describe "locale tr" do
test "lformat %P" do
formatter = Timex.Format.DateTime.Formatters.Strftime

assert {:ok, "öö"} = formatter.lformat(@aug182013_am, "%P", "tr")
assert {:ok, "ÖÖ"} = formatter.lformat(@aug182013_am, "%p", "tr")
assert {:ok, "ös"} = formatter.lformat(@aug182013_pm, "%P", "tr")
assert {:ok, "ÖS"} = formatter.lformat(@aug182013_pm, "%p", "tr")
end
end
end

0 comments on commit aa3fa6f

Please sign in to comment.