Skip to content

Commit

Permalink
Merge pull request #2426 from MushroomObserver/translations-term-date
Browse files Browse the repository at this point in the history
Switch search translation tag keys from `_date` to `_when`
  • Loading branch information
nimmolo authored Sep 28, 2024
2 parents 4f6c265 + 308819c commit 73a064a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/classes/pattern_search/observation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module PatternSearch
class Observation < Base
PARAMS = {
# dates / times
date: [:date, :parse_date_range],
when: [:date, :parse_date_range],
created: [:created_at, :parse_date_range],
modified: [:updated_at, :parse_date_range],

Expand Down
4 changes: 2 additions & 2 deletions config/locales/en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@
search_term_comments: comments
search_term_confidence: confidence
search_term_created: created
search_term_date: date
search_term_when: date
search_term_deprecated: deprecated
search_term_east: east
search_term_exclude_consensus: exclude_consensus
Expand Down Expand Up @@ -3664,7 +3664,7 @@
# Search bar help
pattern_search_terms_help: "Your search string may contain terms of the form \"variable:value\", where value can be quoted, and in some cases can contain more than one value separated by commas. Recognized variables include:"

observation_term_date: Date mushroom was observed; YYYY-MM-DD, YYYY or MM; ranges okay.
observation_term_when: Date mushroom was observed; YYYY-MM-DD, YYYY or MM; ranges okay.
observation_term_created: Date observation was first posted.
observation_term_modified: Date observation was last modified.
observation_term_name: Consensus name is one of these names.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class ChangeSearchTermDateTranslationTags < ActiveRecord::Migration[7.1]
def up
TranslationString.rename_tags(
{ search_term_date: :search_term_when,
observation_term_date: :observation_term_when }
)
end
def down
TranslationString.rename_tags(
{ search_term_when: :search_term_date,
observation_term_when: :observation_term_date }
)
end
end

0 comments on commit 73a064a

Please sign in to comment.