Skip to content

Commit

Permalink
Disable keyword translation
Browse files Browse the repository at this point in the history
Why:
SMC does not have a paid Google account, so might as well disable the code and save some resources. We can always turn it back on later if desired.
  • Loading branch information
monfresh committed Aug 15, 2015
1 parent 9cf354b commit 1be20b9
Show file tree
Hide file tree
Showing 51 changed files with 1,251 additions and 1,367 deletions.
8 changes: 4 additions & 4 deletions app/controllers/locations_controller.rb
Expand Up @@ -6,17 +6,17 @@ def index
# To enable Google Translation of keywords,
# uncomment lines 9-11 and 19, and see documentation for
# GOOGLE_TRANSLATE_API_KEY in config/application.example.yml.
translator = KeywordTranslator.new(
params[:keyword], current_language, 'en', 'text')
params[:keyword] = translator.translated_keyword
# translator = KeywordTranslator.new(
# params[:keyword], current_language, 'en', 'text')
# params[:keyword] = translator.translated_keyword

locations = Location.search(params)

@search = Search.new(locations, Ohanakapa.last_response, params)

# Populate the keyword search field with the original term
# as typed by the user, not the translated word.
params[:keyword] = translator.original_keyword
# params[:keyword] = translator.original_keyword

cache_page(locations.max_by(&:updated_at).updated_at) if locations.present?
end
Expand Down
31 changes: 15 additions & 16 deletions spec/cassettes/all_results.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1be20b9

Please sign in to comment.