Skip to content

Commit

Permalink
Don't force the "elixir-format" flag when merging
Browse files Browse the repository at this point in the history
  • Loading branch information
whatyouhide committed Jul 31, 2023
1 parent d7e1bef commit b9bd1cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/gettext.ex
Original file line number Diff line number Diff line change
Expand Up @@ -587,9 +587,9 @@ defmodule Gettext do
removing messages that you have extracted using another tool.
* `:custom_flags_to_keep` - a list of custom flags that will be kept for
existing messages during a merge. Gettext always keeps the `elixir-format`
and `fuzzy` flags.
existing messages during a merge. Gettext always keeps the `fuzzy` flag.
If you want to keep the `elixir-format` flag, which is also commonly
used by Gettext, add it to this list.
* `:write_reference_comments` - a boolean that specifies whether reference
comments should be written when outputting PO(T) files. If this is `false`,
Expand Down
4 changes: 2 additions & 2 deletions lib/gettext/merger.ex
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ defmodule Gettext.Merger do
}
end

@default_flags_to_keep ["elixir-format", "fuzzy"]
defp merge_flags(old_message, new_message, custom_flags_to_keep) do
flags_to_keep = Enum.uniq(@default_flags_to_keep ++ custom_flags_to_keep)
# Force the "fuzzy" flag.
flags_to_keep = Enum.uniq(["fuzzy" | custom_flags_to_keep])

%{flags: flags} =
Enum.reduce(flags_to_keep, new_message, fn flag, message ->
Expand Down

0 comments on commit b9bd1cd

Please sign in to comment.