all tags: japanese[52] education[24] travel[23] kanji[21] programming[15] MYJ15[13] NII17[10] research[10] website[8] linux[7] hardware[7] libertine[5] food[4] misc[4] time[2] games[2] movies[2] parkour[2] rant[2] self-reflection[2] manga[1] speedcubing[1] anime[1] books[1] translation[1] lego[1] i18n/l10n[1]

Mixed language content

A few days ago I was wasting a few seconds on Facebook, scrolling down the newsfeed, and was suprised to see a short Japanese post, 「残念だな」, by someone I was pretty sure doesn't know Japanese. Upon closer inspection it turned out Facebook had translated their German post into the language my account is set to display. This made me very aware — for a moment — that the fact in which language something is written carries information. Why did they suddenly post in Japanese? (Well ... they didn't.)
If, let's say, a Chinese acquaintance of whom I know that they don't know any German sent me birthday whishes in German, then they went through the trouble of goolging for German birthday whishes, using Google Translate or asking someone. In a similar fashion I report of elevators saying 「本日はご苦労様でした」 at my lab — because they do so in Japanese. Other times using a word from another language is just more concise and feels more accurate. Instead of talking about "a type of bicycle with a front basked often used by mothers" or leaving out information and just writing "bicycle" I name the thing by its name and say 「ママチャリ」.

The obvious problem with this is that my recent blog posts only really make sense to people that can read English and — at least some — Japanese. This made me think about working with Accept-Language headers. Just parse what a user's browser tells me about their language capabilities and display content accordingly.

To figure out how I'd go about the display content accordingly part I googled "mixed language web content" and similar things. This yielded a lot of SEO articles saying DON'T!, a few W3C resources on how to mark and style parts of text depending on language and even an interesting looking book titled Language Mixing and Code-Switching in Writing. No solution though for my balancing act between information/authenticity and audience/intelligibility.

So, I played around myself and came up with this: ← if your browser tells me you understand Japanese you will just see 「例」, otherwise the word will have a grey-ish background and when you hover over it, it will display "example".
Best thing about them? They're purely done in CSS. :3 (See the code here.) On the server side of things it gets a little bit unaesthetic — sadly. I maintain the contents of this website in Markdown and extra stuff is added in after parsing. For mixed language strings I use the following construct <‌!-- mixlang:例:example -->. Not quite as concise as e.g. Markdown links but well ... HTML comments go through the parser untouched and then I built my small <span> matryoshkas. Writing a Markdown extention would be an alternative but I don't have the time for looking into that right now.

By the time this post goes live I will have gone through my backlog of posts and added in optional English translation for all non English strings. レンジでgood!

Rebuilt in Python

I rebuilt the page with Python, Markdown, and Jinja2.

The code should be a lot cleaner and for me it's more comfortable to type pages and blog entries in Markdown. There are still a few things to sort out but the current state seems presentable. :3


Site update

The renovation cat must have sent it's friend. — I used the last two days to update the site a bit.

Blog section is now full width, manually chosen permalinks have been replaced by hashes, content has been restructured, the design changed a bit, spam protection is now done with reCAPTCHA, etc.
Future plans are to build the site so that it functions perfectly fine w/o JavaScript but, when enabled, makes good use of its benefits, heavily extend the interests section as implied there, etc. However, I guess it's going to take a while until I really find the time to make noticable changes again. I have a lot less free time than I'm used to atm and that's not going to change until February or so. :/

tags: website


Grid scroll

Added a "scrolling" fuctionality to the grid in the photography section — should now be at least a bit more comfortable to browse through. Writing it, however, wasn't that much of a pleasure. :D First of all things tend to end up pretty messy whenever I work on stuff "combining" PHP and JS. On top of that the "math" behind the shifting of my images went fully out of control. Loops and lists functioning in opposite directions, +1 here, -2 there — oh well ... somehow it's working now. :D

tags: website


Movielist changes + service

The first implementation of my movielist made use of IMDBPHP, a third party API thingy. I now finally got rid of it and wrote my own code. Not that IMDBPHP would have been bad in any way, it just was way to heavyweight for what I used it for. Additionally I created a little HTTP service which can be fed with an IMDb ID and a specification of information type via GET parameters to receive a plain text answer.
Since both the service and parts of the movielist use fsockopen() — which is disabled on bplaced.net — I have to host them on square7.ch.
Besides: Vim syntax highlighting (with background set to dark) is just sexy. <3


Proper subsequent loading of content

On today's schedule:
light exercises in JavaScript, regular expressions and Vim. :D

I finally managed to grant my Elfen Lied content base a proper functionality to load content on demand. The full page contains images worth >60MB. Combined with slow speed due to free webspace you end up with a browsing experience of pure "meh ...". Until now I only hid collapsed content and displayed it on demand. Now expanding and collapsing really means loading the content and removing it. Not only hiding and displaying while loading it anyway.

tags: website


Bad-ass movielist

Level up! for the cinephile. I rebuilt/improved my movielist. : )

The old list contained title, year and duration in a rather mediocre conceived notation. Now I note title, year and IMDb id. The first two to still have something human readable and independent from external sources, the third to gather all further data.

To access the IMDb page I use IMDBPHP, but the methods to sort out the data (rating, runtime, director, etc.) are self written. Since the process of accessing every single IMDb page (one for each movie) takes quite some time, my script saves all information as well as the image in a cache folder.

The list can be accessed here.


Renovation, again.

Uhm, yes ... I had to change it again. To be more precise: I built the site again pretty much from scratch. It's as if everytime I remake my page and use it for some time, I find new flaws and the desire to start all over again rises. ^^
This time I didn't make any major steps concerning technology — only added a little javascript. The look however changed quite a bit: centered again, uniform color, a picture in the header, different categories and no more name or title (like &code before). Greatest changes however were made concerning content. I overhauled most of it.

Oh and: old entries are old. I'm not going to import them ... this is gonna be kind of a new beginning. : )

tags: website