The easy Weblog and Wiki Software
[ start | index | login ]
start > essmann > ideas > i18n

i18n

Created by essmann. Last edited by essmann, 3 years and 317 days ago. Viewed 119 times. #2
[diff] [history] [edit] [rdf]
labels
attachments

Internationalization for snips

The problem

I don't mind writing stuff in english, but since my native language is german I also like to write in german from time to time.

For my personal SnipSnap running at home I have the problem that I have friends that

  • don't speak english, and some that
  • don't speak german.

Solutions

Now, what should I do if I want to, say, post some stories and images from my last vacation on my SnipSnap?

I could:

  • Simply add german and english texts in all snips, letting the reader sort it out.
  • Set up two instances of SnipSnap, one for german native speakers and one with english as main language (I wouldn't even dream of wanting to synchronize these).
  • Use a naming convention for snips, like <foo>-de and <foo>-en (similar to Java resource bundles). SnipSnap already does this for comments.
  • Use namespaces for i18n, see phobias note about special namespaces in this context.
  • Try to use labels to achieve this, maybe in combination with namespaces.
  • Provide "inline" snip support for i18n, maybe with use of macros.
I'll quickly sketch some of the pros/cons (in my opinion) below.

Namespaces

I think using namespaces would provide the most powerful solution here. Using something like "/mysnip" for the default language and "/mysnip/i18n/de" for the german version would be fine.

That is if I wanted to use SnipSnap for something where the focus also lies on internationalization. For use in a fast changing environment where users add ideas, post comments, etc. this is probably overkill and hard to maintain.

The advantage on the other hand is a clear separation and I could always "extract" one language part, automatically check what still needs to be translated, maybe even employ tools like >>Babel Fish to automatically translate untranslated stuff.

Handling of requests wouldn't be simple anymore though, if a user requests "mysnip" he should get "mysnip/i18n/de" automatically if his language preference is german. A link at the top of the page should indicate that there are also other language versions available and last but not least input should also provide support for multiple languages.

=> Sounds like a fairly complicated solution.

Naming pattern for snips

A simple straightforward solution that could be implemented similar to comments.

The pros and cons are probably the same as for the namespaces solution sketched above, while it tastes a bit more like a "hack". :-)

Inline internationalization

That would be a very straightforward and simple way to get i18n. Consider the following macros:

{i18n}
{lang:de}
Deutscher Teil.
{lang:de}
{lang:en}
English part.
{lang:en}
{i18n}

Like this I could enter everything in one place and still render the preferred language for a user. Everything enclosed in a {i18n} block only gets rendered once, namely in the best suited language. This way I could also mix multi-language stuff in one snip.

Other solutions?

Any comments, ideas?!?

6 comments (by phobia, tigerf, essmann, akira, cbuchegger) | post comment

What is SnipSnap?
SnipSnap is a free and easy to install weblog and wiki tool written in Java.

SnipSnap download
Current version: 1.0b3-uttoxeter
Try our >>Web Start Demo!

Resources

5567 Users and 13712 Snips. Installed 6 years and 8 days ago

Logged in Users: (2)
… and 18 Guests.

snipsnap-changed for older changes.

< July 2008 >
SunMonTueWedThuFriSat
12345
6789101112
13141516171819
20212223242526
2728293031

snipsnap
Listed on BlogShares
XHTML 1.0 validated
CSS validated
RSS 2.0 validated
RSS Feed

pico-powered

Powered by SnipSnap 1.0b3-uttoxeter
YourKit >>Java Profiler

Fraunhofer FIRST

snipsnap.org | Copyright 2000-2006 Fraunhofer FIRST