Change Your Website's Language With Swedish Chef's Accent

Does anyone know the Swedish Chef? I learned it also a few weeks ago. He is one of the characters of The Muppets. Watch this if you don't know the Swedish Chef. There is one plugin that transfers the website's content for you to Swedish Chef's accent. This is called Bork Bork! plugin. I will tell you how i wrote its code in Python.

Firstly, the system works like this, there is a one general rule that says for example "a should became e". However the system is not that simple. There is a few exceptional rules too. For instance, for latter 'a' exceptions are, "if a is singular it should remain a" and "final e should be appended a". If you use general rule like "text = text.replace('a', 'e')", you will lose all your exceptions, because; when you replace all of your 'a's with 'e', in the next step you won't know that if the letter 'e' was 'a' or original 'e'. Thus, you won't able to use the rule "final e should be appended a". However, there is an easy solution for this problem. You can replace your exceptions with special latters such that '%' (like printf function in c language), so now you can use general rule and this time you won't lose all your exceptions. For example, lets replace all final 'e's with '%1%' and singular 'a's with '%%%'. Then we can replace all 'a's with 'e'. Now, the program didn't touch our exceptions. This time we will use other rules on our special characters. Let's replace our '%1%'s with 'e-a 's and '%%%'s with 'a'. We can use this technique to replace other words.

I showed you how to write Bork Bork! plugin with this easy and useful technique. I hope this will help you in your study. Have a nice day!

The First Post --Static Site Generators--

Hello everyone. This web site is developed by one of the site generetors calling "Nikola". Static site generators basically work like that, they store content in flat files and serve generated purely static HTML to users immediately.

Nikola uses python language to serve html. Moreover it uses jinja2 and Mako templates and has MIT licence. In this blog I use bootstrap3 template of Nikola. You can reach Nikola official web page at getnikola.com . There are several other static site generators. For example; Pelican (uses also python), Jekyll (uses Ruby), GitBook (uses JavaScript), Hugo (uses Go) and many... See Tutorial to learn more.