Skip to content

Ovidio welcome#105

Open
OvidioMiranda wants to merge 2 commits intodevelopfrom
ovidio_welcome
Open

Ovidio welcome#105
OvidioMiranda wants to merge 2 commits intodevelopfrom
ovidio_welcome

Conversation

@OvidioMiranda
Copy link
Contributor

Welcome!
Your start-up's BA has told marketing that your website has a large audience in Scandinavia and surrounding countries. Marketing thinks it would be great to welcome visitors to the site in their own language. Luckily you already use an API that detects the user's location, so this is an easy win.

The Task

Think of a way to store the languages as a database (eg an object). The languages are listed below so you can copy and paste!
Write a 'welcome' function that takes a parameter 'language' (always a string), and returns a greeting - if you have it in your database. It should default to English if the language is not in the database, or in the event of an invalid input
The Database

english: "Welcome",
czech: "Vitejte",
danish: "Velkomst",
dutch: "Welkom",
estonian: "Tere tulemast",
finnish: "Tervetuloa",
flemish: "Welgekomen",
french: "Bienvenue",
german: "Willkommen",
irish: "Failte",
italian: "Benvenuto",
latvian: "Gaidits",
lithuanian: "Laukiamas",
polish: "Witamy",
spanish: "Bienvenido",
swedish: "Valkommen",
welsh: "Croeso"

Possible invalid inputs include:

IP_ADDRESS_INVALID - not a valid ipv4 or ipv6 ip address
IP_ADDRESS_NOT_FOUND - ip address not in the database
IP_ADDRESS_REQUIRED - no ip address was supplied

@codecov-io
Copy link

codecov-io commented Aug 23, 2017

Codecov Report

Merging #105 into develop will increase coverage by 0.71%.
The diff coverage is 98.18%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop     #105      +/-   ##
=============================================
+ Coverage      86.34%   87.06%   +0.71%     
- Complexity       359      367       +8     
=============================================
  Files             85       87       +2     
  Lines            857      912      +55     
  Branches         141      143       +2     
=============================================
+ Hits             740      794      +54     
  Misses           105      105              
- Partials          12       13       +1
Impacted Files Coverage Δ Complexity Δ
.../java/org/fundacionjala/coding/ovidio/Welcome.java 100% <100%> (ø) 4 <4> (?)
...a/org/fundacionjala/coding/ovidio/ToLeetSpeak.java 97.05% <97.05%> (ø) 4 <4> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 65fcb8f...0725704. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants