8 kyu
Welcome!
24,201 of 52,970lucymonie
Description:
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. The languages are listed below so you can copy and paste!
- Write a 'welcome' function that takes a parameter 'language', with a type
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
Please modify this as appropriate for your language.
[ ("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
Fundamentals
Similar Kata:
Stats:
Created | Jul 8, 2016 |
Published | Jul 8, 2016 |
Warriors Trained | 93566 |
Total Skips | 8873 |
Total Code Submissions | 151983 |
Total Times Completed | 52970 |
JavaScript Completions | 24201 |
Ruby Completions | 1521 |
Python Completions | 17877 |
C# Completions | 2639 |
CoffeeScript Completions | 27 |
Java Completions | 4771 |
Elixir Completions | 305 |
C Completions | 664 |
Rust Completions | 1106 |
Scala Completions | 91 |
TypeScript Completions | 446 |
PHP Completions | 497 |
Haskell Completions | 71 |
Total Stars | 859 |
% of votes with a positive feedback rating | 89% of 5318 |
Total "Very Satisfied" Votes | 4345 |
Total "Somewhat Satisfied" Votes | 788 |
Total "Not Satisfied" Votes | 185 |