From 306374165fee7f441a6d46cd29064ee6406b0129 Mon Sep 17 00:00:00 2001 From: N0zz Date: Wed, 11 Feb 2015 23:59:40 +0100 Subject: [PATCH 1/4] add polish new polish language added and encoding changed to utf-8 which is requed by polish --- lib/hola/translator.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/hola/translator.rb b/lib/hola/translator.rb index a33abe6..8dce55d 100644 --- a/lib/hola/translator.rb +++ b/lib/hola/translator.rb @@ -1,3 +1,5 @@ +# encoding: UTF-8 + class Hola::Translator def initialize(language = "english") @language = language @@ -9,6 +11,8 @@ def hi "hola mundo" when "korean" "anyoung ha se yo" + when "polish" + "witaj świecie" else "hello world" end From 92ecb9a4f83562e1deaae9f4939c775e55fa14b3 Mon Sep 17 00:00:00 2001 From: N0zz Date: Thu, 12 Feb 2015 00:00:58 +0100 Subject: [PATCH 2/4] add test for polish test for polsih langauge, and also change encoding to utf-8 because of polish --- test/test_hola.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test_hola.rb b/test/test_hola.rb index 54d1b20..ae68243 100644 --- a/test/test_hola.rb +++ b/test/test_hola.rb @@ -1,3 +1,5 @@ +# encoding: UTF-8 + require 'test/unit' require 'hola' @@ -13,4 +15,8 @@ def test_any_hello def test_spanish_hello assert_equal "hola mundo", Hola.hi("spanish") end + + def test_polish_hello + assert_equal "witaj świecie", Hola.hi("spanish") + end end From a2154e2e99a0f6b2096dee4361ceb828c6634cd9 Mon Sep 17 00:00:00 2001 From: N0zz Date: Thu, 12 Feb 2015 00:07:12 +0100 Subject: [PATCH 3/4] polish test fix --- test/test_hola.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_hola.rb b/test/test_hola.rb index ae68243..8250329 100644 --- a/test/test_hola.rb +++ b/test/test_hola.rb @@ -17,6 +17,6 @@ def test_spanish_hello end def test_polish_hello - assert_equal "witaj świecie", Hola.hi("spanish") + assert_equal "witaj świecie", Hola.hi("polish") end end From 08a95a5ee6e74ae5a0da676d29b590aa4cd552bc Mon Sep 17 00:00:00 2001 From: N0zz Date: Thu, 12 Feb 2015 00:07:55 +0100 Subject: [PATCH 4/4] utf-8 encoding for polish --- lib/hola.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/hola.rb b/lib/hola.rb index 11183c3..b07421d 100644 --- a/lib/hola.rb +++ b/lib/hola.rb @@ -1,3 +1,5 @@ +# encoding: UTF-8 + class Hola def self.hi(language) translator = Translator.new(language)