-
Notifications
You must be signed in to change notification settings - Fork 528
HOC: Update to 2020 dates #35735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HOC: Update to 2020 dates #35735
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,23 +152,30 @@ def localized_image(path) | |
|
|
||
| def campaign_date(format) | ||
| @country ||= hoc_detect_country | ||
| type = HOC_COUNTRIES[@country]['type'] || 'default' | ||
| language = HOC_COUNTRIES[@country]['default_language'] | ||
| id = 'campaign_date_full' | ||
|
|
||
| case format | ||
| when "start-short" | ||
| return HOC_COUNTRIES[@country]['campaign_date_start_short'] | ||
| id = 'campaign_date_start_short' | ||
| when "start-long" | ||
| return HOC_COUNTRIES[@country]['campaign_date_start_long'] | ||
| id = 'campaign_date_start_long' | ||
| when "short" | ||
| return HOC_COUNTRIES[@country]['campaign_date_short'] | ||
| id = 'campaign_date_short' | ||
| when "full" | ||
| return HOC_COUNTRIES[@country]['campaign_date_full'] | ||
| id = 'campaign_date_full' | ||
| when "year" | ||
| return HOC_COUNTRIES[@country]['campaign_date_year'] | ||
| id = 'campaign_date_year' | ||
| when "full-year" | ||
| return HOC_COUNTRIES[@country]['campaign_date_full_year'] | ||
| else | ||
| return HOC_COUNTRIES[@country]['campaign_date_full'] | ||
| id = 'campaign_date_full_year' | ||
| end | ||
|
|
||
| if %w(latam europe africa).include? type | ||
| id = "#{type}_#{id}" | ||
| end | ||
|
|
||
| return HOC_I18N[language][id] || HOC_I18N['en'][id] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 thanks! |
||
| end | ||
|
|
||
| def company_count | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth doing the opposite of this? i.e.
unless type == 'default'. I feel like it's possible that we add another set of dates and then we would only have to editcountries.jsonanden.ymlThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's fair, I was worried about the likelihood of someone putting an incorrect type in there, in which case we would want to fall back to default instead of using an id that doesn't exist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooo good point!