@@ -54,10 +54,7 @@ defmodule Gettext.Merger do
5454 { Messages . t ( ) , map ( ) }
5555 def merge ( % Messages { } = old , % Messages { } = new , locale , opts , gettext_config )
5656 when is_binary ( locale ) and is_list ( opts ) do
57- opts =
58- opts
59- |> handle_deprecated_plural_forms ( )
60- |> put_plural_forms_opt ( old , locale )
57+ opts = put_plural_forms_opt ( opts , old , locale )
6158
6259 stats = % { new: 0 , exact_matches: 0 , fuzzy_matches: 0 , removed: 0 , marked_as_obsolete: 0 }
6360
@@ -73,32 +70,6 @@ defmodule Gettext.Merger do
7370 { po , stats }
7471 end
7572
76- # TODO: remove in v0.24.0
77- defp handle_deprecated_plural_forms ( opts ) do
78- plural_forms = Keyword . get ( opts , :plural_forms )
79-
80- cond do
81- is_nil ( plural_forms ) ->
82- opts
83-
84- Keyword . has_key? ( opts , :plural_forms_header ) ->
85- raise ArgumentError , """
86- --plural-forms (or :plural_forms) and --plural-forms-header (or :plural_forms_header) \
87- cannot be used together\
88- """
89-
90- true ->
91- IO . warn ( """
92- The --plural-forms and :plural_forms options are deprecated. If your files \
93- have a Plural-Forms header, Gettext will use that to determin the number of plural \
94- forms for the locale. Otherwise, you can pass a Plural-Forms header via the \
95- --plural-forms-header or :plural_forms_header option.\
96- """ )
97-
98- Keyword . put ( opts , :plural_forms_header , "nplurals=#{ plural_forms } " )
99- end
100- end
101-
10273 defp merge_messages ( old , new , opts , gettext_config , stats ) do
10374 fuzzy? = Keyword . fetch! ( opts , :fuzzy )
10475 fuzzy_threshold = Keyword . fetch! ( opts , :fuzzy_threshold )
0 commit comments