<rdf:RDF
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xml:base='http://snipsnap.org/rdf'>
    <s:Snip rdf:about='http://snipsnap.org/rdf#essmann/ideas/i18n'
         s:name='essmann/ideas/i18n'
         s:cUser='essmann'
         s:oUser=''
         s:mUser='essmann'>
        <s:content>1 Internationalization for snips&#xD;&#xA;&#xD;&#xA;1.1 The problem&#xD;&#xA;&#xD;&#xA;I don&apos;t mind writing stuff in english, but since my native language is german I also like to write in german from time to time.&#xD;&#xA;&#xD;&#xA;For my personal SnipSnap running at home I have the problem that I have friends that&#xD;&#xA;- don&apos;t speak english, and some that&#xD;&#xA;- don&apos;t speak german.&#xD;&#xA;&#xD;&#xA;1.1 Solutions&#xD;&#xA;&#xD;&#xA;Now, what should I do if I want to, say, post some stories and images from my last vacation on my SnipSnap?&#xD;&#xA;&#xD;&#xA;I could:&#xD;&#xA;- Simply add german and english texts in all snips, letting the reader sort it out.&#xD;&#xA;- Set up two instances of SnipSnap, one for german native speakers and one with english as main language (I wouldn&apos;t even dream of wanting to synchronize these).&#xD;&#xA;- Use a naming convention for snips, like &lt;foo&gt;-de and &lt;foo&gt;-en (similar to Java resource bundles). SnipSnap already does this for comments.&#xD;&#xA;- Use namespaces for i18n, see [phobia]s note about [special namespaces] in this context.&#xD;&#xA;- Try to use labels to achieve this, maybe in combination with namespaces.&#xD;&#xA;- Provide &quot;inline&quot; snip support for i18n, maybe with use of macros.&#xD;&#xA;&#xD;&#xA;I&apos;ll quickly sketch some of the pros/cons (in my opinion) below.&#xD;&#xA;&#xD;&#xA;1 Namespaces&#xD;&#xA;&#xD;&#xA;I think using namespaces would provide the most powerful solution here. Using something like &quot;/mysnip&quot; for the default language and &quot;/mysnip/i18n/de&quot; for the german version would be fine.&#xD;&#xA;&#xD;&#xA;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.&#xD;&#xA;&#xD;&#xA;The advantage on the other hand is a clear separation and I could always &quot;extract&quot; one language part, automatically check what still needs to be translated, maybe even employ tools like {link:Babel Fish|http://babelfish.altavista.com/} to automatically translate untranslated stuff.&#xD;&#xA;&#xD;&#xA;Handling of requests wouldn&apos;t be simple anymore though, if a user requests &quot;mysnip&quot; he should get &quot;mysnip/i18n/de&quot; 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.&#xD;&#xA;&#xD;&#xA;=&gt; Sounds like a fairly complicated solution. &#xD;&#xA;&#xD;&#xA;1 Naming pattern for snips&#xD;&#xA;&#xD;&#xA;A simple straightforward solution that could be implemented similar to comments.&#xD;&#xA;&#xD;&#xA;The pros and cons are probably the same as for the namespaces solution sketched above, while it tastes a bit more like a &quot;hack&quot;. :-)&#xD;&#xA;&#xD;&#xA;1 Inline internationalization&#xD;&#xA;&#xD;&#xA;That would be a very straightforward and simple way to get i18n. Consider the following macros:&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;\{i18n\}&#xD;&#xA;\{lang:de\}&#xD;&#xA;Deutscher Teil.&#xD;&#xA;\{lang:de\}&#xD;&#xA;\{lang:en\}&#xD;&#xA;English part.&#xD;&#xA;\{lang:en\}&#xD;&#xA;\{i18n\}&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;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.&#xD;&#xA;&#xD;&#xA;1 Other solutions?&#xD;&#xA;&#xD;&#xA;Any comments, ideas?!?</s:content>
        <s:mTime>2004-09-05 08:59:59.494</s:mTime>
        <s:cTime>2004-09-05 08:59:23.269</s:cTime>
        <s:comments>
            <rdf:Bag>
                <rdf:li>
                    <s:Comment rdf:about='http://snipsnap.org/rdf#comment-essmann/ideas/i18n-1'
                         s:name='comment-essmann/ideas/i18n-1'
                         s:cUser='phobia'
                         s:oUser=''
                         s:mUser='phobia'>
                        <s:content>I prefer your latter approach.  The macro should even be possible today, although I&apos;m not sure I&apos;ve seen any examples of macros that &quot;nest&quot; like that.&#xD;&#xA;&#xD;&#xA;Perhaps the nesting isn&apos;t even necessary.  How about just the &quot;language&quot; macro, with an optional parameter that specifies whether the content should be always renders, rendered only if it matches the user locale, or rendered if no other content in this snip matches the user locale?  That last scenario might be tricky to implement.</s:content>
                        <s:mTime>2004-09-05 22:02:50.768</s:mTime>
                        <s:cTime>2004-09-05 22:02:50.239</s:cTime>
                        <s:commentedSnip rdf:resource='http://snipsnap.org/rdf#essmann/ideas/i18n'/>
                    </s:Comment>
                </rdf:li>
                <rdf:li>
                    <s:Comment rdf:about='http://snipsnap.org/rdf#comment-essmann/ideas/i18n-2'
                         s:name='comment-essmann/ideas/i18n-2'
                         s:cUser='tigerf'
                         s:oUser=''
                         s:mUser='tigerf'>
                        <s:content>I suggest that macro following:&#xD;&#xA;{code}&#xD;&#xA;{language:default=en}&#xD;&#xA;de: Deutscher Teil.&#xD;&#xA;en: English part.&#xD;&#xA;cn: 中文&#xD;&#xA;{language}&#xD;&#xA;{code}</s:content>
                        <s:mTime>2004-09-06 12:06:42.166</s:mTime>
                        <s:cTime>2004-09-06 12:03:51.173</s:cTime>
                        <s:commentedSnip rdf:resource='http://snipsnap.org/rdf#essmann/ideas/i18n'/>
                    </s:Comment>
                </rdf:li>
                <rdf:li>
                    <s:Comment rdf:about='http://snipsnap.org/rdf#comment-essmann/ideas/i18n-3'
                         s:name='comment-essmann/ideas/i18n-3'
                         s:cUser='essmann'
                         s:oUser=''
                         s:mUser='essmann'>
                        <s:content>[@phobia:|phobia] The reason I was thinking about a nested macro is that you need to be able to decide which translations belong to each other. I don&apos;t know if there are any implementation issues involved in retrieving the context block (i18n in the example) from the language macro, but when I wrote this I was just dumping an idea without actually thinking about the implementation.&#xD;&#xA;&#xD;&#xA;Also I don&apos;t know if it&apos;s really necessary to use a fallback language, but if I remember correctly, the client sends a block of languages in order of preference and then, well, the information would be needed to provide a best effort translation.&#xD;&#xA;&#xD;&#xA;[@tigerf:|tigerf] That would be even simpler to implement. I would omit the default language though, since there&apos;s a default for SnipSnap and there&apos;s the preferences from the client. Yet another default would probably be too much and trigger too seldom.&#xD;&#xA;&#xD;&#xA;More interesting to me would be how you go about writing larger blocks of text. I see that the macro would be handy to write a single sentence. But how about complex structured text? (That&apos;s why I thought about using a nested macro since the user is already familiar with the concept, even though probably not if they are used in context.)&#xD;&#xA;&#xD;&#xA;----&#xD;&#xA;&#xD;&#xA;The problem with translation ~~whole~~ snips however remains. Wouldn&apos;t it be simpler to have different snips for the translation. E.g. I was just thinking how this very snip looked if I had written it in more than one language...&#xD;&#xA;&#xD;&#xA;Maybe SnipSnap should even provide several ways to achieve internationalization, letting the user choose what suits her best for a given purpose.</s:content>
                        <s:mTime>2004-09-06 21:23:42.536</s:mTime>
                        <s:cTime>2004-09-06 21:23:40.567</s:cTime>
                        <s:commentedSnip rdf:resource='http://snipsnap.org/rdf#essmann/ideas/i18n'/>
                    </s:Comment>
                </rdf:li>
                <rdf:li>
                    <s:Comment rdf:about='http://snipsnap.org/rdf#comment-essmann/ideas/i18n-4'
                         s:name='comment-essmann/ideas/i18n-4'
                         s:cUser='phobia'
                         s:oUser=''
                         s:mUser='phobia'>
                        <s:content>I don&apos;t like using namespaces or multiple snips (clutters the snipspace) but understand the compulsion to &quot;break up&quot; the content.  Maybe content via attachments?  They could have locales associated with them, or be included within macros as we&apos;ve discussed via include macros.  But then you lose the abilities of snips (revision history, etc)...&#xD;&#xA;&#xD;&#xA;Every time I ponder it, I come back to believing that all the content should be in the same snip... it is, after all, the same content, just &quot;rendered&quot; differently.</s:content>
                        <s:mTime>2004-09-07 16:26:06.497</s:mTime>
                        <s:cTime>2004-09-07 16:26:05.445</s:cTime>
                        <s:commentedSnip rdf:resource='http://snipsnap.org/rdf#essmann/ideas/i18n'/>
                    </s:Comment>
                </rdf:li>
                <rdf:li>
                    <s:Comment rdf:about='http://snipsnap.org/rdf#comment-essmann/ideas/i18n-5'
                         s:name='comment-essmann/ideas/i18n-5'
                         s:cUser='cbuchegger'
                         s:oUser=''
                         s:mUser='cbuchegger'>
                        <s:content>To include [essmann/ideas/i18n] into [SnipSnap] is for me too much of an adempt to create a [Eierlegende Woll-Milch-Sau]. A translation of a snip is a further dimension which should not be modelled using one of the existing means like different snips and or namespaces. I would also prefer the macro in a single snip solution.&#xD;&#xA;&#xD;&#xA;Also in a wiki with even moderate changes in content the snips are always a moving target so that translation would never be able follow the originial content. Because of this I personally would consider using i18n only for rare use cases. For such an easy to implement and straight forward approach will be the most effective.&#xD;&#xA;</s:content>
                        <s:mTime>2004-09-07 20:01:18.873</s:mTime>
                        <s:cTime>2004-09-07 20:01:15.239</s:cTime>
                        <s:commentedSnip rdf:resource='http://snipsnap.org/rdf#essmann/ideas/i18n'/>
                    </s:Comment>
                </rdf:li>
                <rdf:li>
                    <s:Comment rdf:about='http://snipsnap.org/rdf#comment-essmann/ideas/i18n-6'
                         s:name='comment-essmann/ideas/i18n-6'
                         s:cUser='akira'
                         s:oUser=''
                         s:mUser='akira'>
                        <s:content>Hi, I created i18n macro. It can be downloaded from {link:my site|http://www.physalis.net/ss/space/i18n-plugin-en}.&#xD;&#xA;Although I noticed this snip today, my i18n macro looks like rather tigerf&apos;s idea which suits short text.&#xD;&#xA;I&apos;m using this in my site to switch menu text and snip links (one linked to English page and one to Japanese page).&#xD;&#xA;</s:content>
                        <s:mTime>2005-05-02 11:02:41.679</s:mTime>
                        <s:cTime>2005-05-02 11:02:38.486</s:cTime>
                        <s:commentedSnip rdf:resource='http://snipsnap.org/rdf#essmann/ideas/i18n'/>
                    </s:Comment>
                </rdf:li>
            </rdf:Bag>
        </s:comments>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='http://snipsnap.org/rdf#essmann/ideas'/>
                <rdf:li rdf:resource='#veedee'/>
                <rdf:li rdf:resource='#Wiki'/>
                <rdf:li rdf:resource='#funzel'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>
