Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Rainfall update #1229

Merged
merged 3 commits into from
Nov 7, 2014
Merged

Rainfall update #1229

merged 3 commits into from
Nov 7, 2014

Conversation

MrChrisW
Copy link
Collaborator

@MrChrisW MrChrisW commented Nov 7, 2014

Add new triggers:

  • average rainfall
  • average annual rainfall

Add support for Alpha-3 country codes:

selection_027

if($countryCode) {
$countryName = code2country(country2code($countryName, LOCALE_CODE_ALPHA_2), LOCALE_CODE_ALPHA_2);
} else {
$countryName = code2country(country2code(code2country($countryName, LOCALE_CODE_ALPHA_3), LOCALE_CODE_ALPHA_2), LOCALE_CODE_ALPHA_2);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is ugly 😒 but is required as the Locale::Country::rename_country method only works for code2country LOCALE_CODE_ALPHA_2

@MrChrisW
Copy link
Collaborator Author

MrChrisW commented Nov 7, 2014

Should probably fix this #1219 also...

@jagtalon
Copy link
Member

jagtalon commented Nov 7, 2014

Thanks! Testing it out.

@jagtalon jagtalon self-assigned this Nov 7, 2014
@MrChrisW
Copy link
Collaborator Author

MrChrisW commented Nov 7, 2014

@jagtalon Let me know if I need to switch it to the base template....

@jagtalon
Copy link
Member

jagtalon commented Nov 7, 2014

@chrisjwilsoncom This looks good. Possible changes in the future:

  • No need to move to a base template, I think, but I think you can do without content.handlebars. If you return something like:
return {
    title: ...
    subtitle: ...
};

It should fix that whitespace at the top:

screen shot 2014-11-07 at 10 57 57 am

Take a look at expatistan.js as an example.

  • I'd like it to trigger on "average rainfall in".

jagtalon pushed a commit that referenced this pull request Nov 7, 2014
@jagtalon jagtalon merged commit 608fa20 into duckduckgo:master Nov 7, 2014
@jagtalon
Copy link
Member

jagtalon commented Nov 7, 2014

👍

@MrChrisW MrChrisW deleted the rainfall-update branch November 7, 2014 16:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants