Subversion Repositories svnkaklik

Rev

Go to most recent revision | Blame | Last modification | View Log | Download

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Coppermine Photo Gallery - Translator's Guide</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<style type="text/css">

body {
        font-size: 12px; background: #F7F7F7; margin: 2%; color: black; font-family: verdana, arial, helvetica, sans-serif;
        scrollbar-face-color: #DEE3E7;
        scrollbar-highlight-color: #FFFFFF;
        scrollbar-shadow-color: #DEE3E7;
        scrollbar-3dlight-color: #D1D7DC;
        scrollbar-arrow-color:  #006699;
        scrollbar-track-color: #EFEFEF;
        scrollbar-darkshadow-color: #98AAB1;
}
td {
        font-size: 12px
}
h1 {
        font-weight: bolder; font-size: 24px; color: #0E72A4; line-height: 120%; font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; text-decoration: none
}
h2 {
        font-size: 20px; color: #0E72A4; font-family: Arial, Helvetica, sans-serif; text-decoration: none;
}
h3 {
        font-weight: bolder; font-size: 16px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none; color: #0E72A4;
}
h4 {
        font-weight: bold; font-size: 14px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none; color: #0E72A4;
}
p {
        font-size: 12px; margin: 10px 10px 0px 0px; font-family: Verdana, Arial, Helvetica, sans-serif
}
pre {
        border-right: #999999 1px solid; padding-right: 5px; border-top: #999999 1px solid; padding-left: 5px; font-size: 12px; padding-bottom: 5px; margin: 10px 10px 0px 0px; border-left: #999999 1px solid; padding-top: 5px; border-bottom: #999999 1px solid; font-style: normal; font-family: "Courier New", Courier, mono; background-color: #E0E0E0
}

tt {
        font-size: 12px;
        font-style: normal;
        font-family: "Courier New", Courier, mono;
        background-color: #E0E0E0;
        margin-right: 15px;
}

ul {
        padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 10px 0px 10px 5px; padding-top: 0px
}
ul.content {
        padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 5px 5px 0px 0px; padding-top: 0px
}
li {
        padding-right: 0px; margin-top: 4px; padding-left: 0px; list-style-position: outside; margin-bottom: 4px; padding-bottom: 0px; margin-left: 10px; padding-top: 0px;
}
li.content {
        padding-right: 0px; margin-top: 0px; padding-left: 0px; list-style-position: outside; margin-bottom: 5px; padding-bottom: 0px; margin-left: 10px; padding-top: 0px; list-style-type: none;
}
hr {
        border-right: #000000 0px solid; border-top: #000000 1px solid; border-left: #000000 0px solid; border-bottom: #000000 0px solid; height: 0px
}
.navbar {
        font-weight: bold; font-size: 10px; background: url(/coppermine/themes/pixel-rave-blue100/images/nav-bar-button.gif) #72a5cc no-repeat; vertical-align: middle; color: #A5C6DF; font-family: Arial, Helvetica, sans-serif
}
a.navbar {
        display: block; vertical-align: middle; width: 100px; color: #A5C6DF; line-height: 25px; position: relative; height: 25px; text-align: center; text-decoration: none
}
a.navbar:hover {
        color: #ffffff; text-decoration: none
}

.back {
        margin-top: 10px; font-size: 10px; margin-bottom: 10px
}
.important { color: red }

.example { color:#0E72A4;font-weight:bold; }
</style>
</head>
<body>
<!--
$Id: translation.htm,v 1.5 2004/07/31 06:00:21 gaugau Exp $
-->
<table cellspacing="0" cellpadding="0" width="100%" border="0">
  <tbody>
  <tr>
    <td>

<h1>Coppermine Photo Gallery - Translator's Guide</h1>




<h2>Translators wanted!</h2>
<p>One of the major advantages of Coppermine is the fact that all page content can be displayed in different languages, with translations being only in one file (inside the <i>lang</i> directory within coppermine). If you like Coppermine and you want to give something back to the community, why don't you start a translation of coppermine into your language?</p>
<p>There are, however, some rules and guidelines for translation outlined in this document...</p>

<h2>Why translate?</h2>
<ul>
<li>To give something back to the community</li>
<li>Because you needed the translation anyway...</li>
<li>To see your name on the credits list</li>
<li>To promote your services (being linked from a relevant page like the Coppermine team/credits page will increase your page rank as well)</li>
<li>Because you're a nice person</li>
</ul>

<h2>Translations for which languages are needed?</h2>
<p>There are already several languages supported by coppermine; as the number of language-files for coppermine grows, there may be translations available that were not included into the package you downloaded. Before you actually start to work on a translation, look here:
<ul>
<li>Is the language you're looking for already included in the lang-folder of the coppermine package you downloaded?</li>
<li>Is the language file already available as separate download in the language section of the coppermine project page? Visit <a href="http://sourceforge.net/project/showfiles.php?group_id=89658&package_id=98540">http://sourceforge.net/project/showfiles.php?group_id=89658&package_id=98540</a></li>
<li>Has someone volunteered to do the translation recently on the Coppermine board thread &quot;<a href="http://coppermine.sourceforge.net/board/index.php?topic=4623.0">[Help wanted]: Translations for CPG1.3.x</a>&quot;? Please read the thread carefully to check if the translation has already been done or is in the works - it'd be a pity if two translators went through all the work submitted two versions of the same language.<br />
You may find additional info there that didn't make it into this document you're reading...</li>
</ul>
</p>
<h2>Who can translate?</h2>
<p>In theory, everybody can, but for the first &quot;phase&quot; of translations when a new version of coppermine comes out, the dev team will contact the translators of pervious versions and ask them to translate the new version as well. Those &quot;original&quot; translators are asked to give a feedback first if they're willing to do the translation (before they actually start to work on the translation); the languages of those who say they're not going to do the &quot;new&quot; translation or from those who don't reply at all will be put on a list on <a href="http://coppermine.sourceforge.net/board/index.php?topic=4623.0">[Help wanted]: Translations for CPG1.3.x</a>; anyone who is ready to do the translation for those &quot;orphaned&quot; languages should reply to the thread and assign the translation to himself.</p>
<p>If you can speak a language that hasn't been translated yet and that nobody has assigned himself, please assign it to you.</p>

<h2>Character encoding</h2>
<p>Many languages have other alphabets than latin, or have additional characters (like &auml; &szlig; &agrave; &aacute; &acirc; &atilde; &aring; &aelig; &ccedil; &thorn; &eth; &oslash;). Many of those special chars have html equivalents (e.g. <i>&amp;auml;</i> for <i>&auml;</i>), but you must <b>not</b> use those html equivalents of your special characters in your translations, as unwanted side-effects may appear with the usage of JavaScript!</p>
<p>Coppermine adds a charset meta tag to the header of each ouput file to instruct the browser how to render special chars. You should add the name of the charset you're using for your translation at the very start of the language file, e.g.<pre>$lang_charset = 'iso-8859-1';</pre>. You can find a list of charsets at <a href="http://www.w3.org/International/O-charset-lang.html">http://www.w3.org/International/O-charset-lang.html</a>. Whenever possible, you shouldn't choose platform-dependant charset (e.g. <i>windows-1252</i>), but cross-platform ones (e.g. <i>iso-8859-1</i>).</p>
<p>You'll have noticed that coppermine language files come in two &quot;flavours&quot;: one in ANSI and one in utf-8 encoding. You won't have to take care of the creation of the utf-8 files, so you'll only have to submit a &quot;normal&quot; language file.</p>

<h2>Editors &amp; Tools</h2>
<p>In fact you can use nearly any <b>text</b> editor you feel comfortable with that will store your text in ANSI format - in most cases, Windows Notepad (also known as &quot;Editor&quot; in Windows 2000/XP) will be fine.</p>
<p>To find out wether your favorite text editor correctly handles encoding, just start the translation and translate a few lines (preferrably some that contain special chars from you language), save the translation file and close it. Then try to open it with a plain text editor on your system (e.g. Notepad) - if everything's showing up as expected, you should be fine.</p>
<p>Recommended Tools: to see what has changed between the language files of cpg1.2.1 and cpg1.3.x, we recommend using a diff viewer that can hilight the differences in both files. Windows users should go for the great diff viewer <a href="http://winmerge.sourceforge.net/">WinMerge</a> (available as freeware; 1.95 MB, localizations available as well): You can even edit the files with this tool (352 of 1152 lines have been added or changed). All new/changed lines have a comment at the end like this one: <tt>//cpg1.3.0</tt></p>

<h2>Full translations only</h2>
<p>For the last version of coppermine we used to send out only the lines that had changed in the language files from previous versions to the translators. Although this seemed to be a very easy solution in the first place we later discovered that this method has severe drawbacks:
<ul>
<li>The translators can't test their code immediately - if only one single quote is missing, the whole file won't work</li>
<li>Corrections had to be send back on forth between the dev team and the translators very often</li>
<li>The dev team had to merge the old language files with the bits that were newly translated - this resulted in a huge additional workload for the dev team, slowing down the new release and keeping them from what they do best</li>
<li>The translators don't know the context some lines appeared in, making it impossible to give correct translations</li>
</ul>
</p>
<p>For those reasons we decided to provide the translators with the most recent english language file along with all existing language files of previous versions for reference and the guide you're currently reading, asking them (the translators: <i>you</i> in this particular case) to translate the whole file. Of course, you can (and are even encouraged to) take a look at the language files from older versions and adopt the stuff that is already in the old version.</p>

<h2>Step by step</h2>
<p>Here are the steps for the translation in detail:</p>
<ol>
<li>open english.php with your text editor</li>
<li>Save the file immediately after opening with a different filename (to make sure you can always take another look at the unmodified english language file for reference) - the filenames of the language files will decide how the language name will look in the dropdown list of the coppermine backend - use the english name of your language as filename, everything lowercase, no spaces or special chars (except &quot;-&quot; and &quot;_&quot; and the dot to mark the extension. If the language name itself isn't self-explanatory, add info with an underscore.<br />
<b>Examples</b>: german.php, italian.php, greek.php, brazilian_portuguese.php</li>
<li>Edit the header info (example content is <span class="example">highlighted</span>):<br />
<tt>// info about translators and translated language</tt><br />
<tt>$lang_translation_info = array(</tt><br />
<tt>'lang_name_english' => '<span class="example">German</span>',</tt>The name of your language in English<br />
<tt>'lang_name_native' => '<span class="example">Deutsch</span>',</tt>The name of your language in your mother tongue<br />
<tt>'lang_country_code' => '<span class="example">de</span>',</tt>The country code representing your language. If your language is spoken in several countries, choose the one most people will relate to your language<br />
<tt>'trans_name'=> '<span class="example">GauGau</span>',</tt>Your name (or rather the name you would like to appear on the credits page)<br />
<tt>'trans_email' => '',</tt>Your email address you want to appear on the credits page (can be left blank)<br />
<tt>'trans_website' => '<span class="example">http://gaugau.de/</span>',</tt>Your website (goes to credit page). If you specify none, your profile page will be displayed instead<br />
<tt>'trans_date' => '<span class="example">2004-03-17</span>',</tt>The date you translated/last changed the language file<br />
<tt>);</tt><br />
Fill in the data you want to appear on the credits page as shown in the example above.</li>
<li>The coppermine language file actually fills php variables/arrays with content. There are different ways those arrays are being filled - as shown in these examples (stuff that needs to be translated is <span class="example">highlighted</span>):<br />
  <ul style="list-style-type:square" type="square">
  <li>
  <tt>$lang_day_of_week = array('<span class="example">Sun</span>', '<span class="example">Mon</span>', '<span class="example">Tue</span>', '<span class="example">Wed</span>', '<span class="example">Thu</span>', '<span class="example">Fri</span>', '<span class="example">Sat</span>');</tt>A plain list of values in an array. Translate each word inside the quotes.</li>
  <li><tt>$lang_yes = '<span class="example">Yes</span>';</tt></li>A value is assigned to a variable. Translate everything inside the single quotes.
  <li><tt>$lang_cat_list = array(<br />
        'category' => '<span class="example">Category</span>',</tt>An array with key =&gt; value pairs. Only translate the value, the key <b>must</b> be left alone!<br /><tt>
        'albums' => '<span class="example">Albums</span>',<br />
        'pictures' => '<span class="example">Files</span>',<br />
);</tt></li>
  <li><tt>if (defined('CONFIG_PHP')) $lang_config_data = array(</tt>Cascaded/multi-dimensional arrays. Translate the very first entry in each line.<br /><tt>
        '<span class="example">General settings</span>',<br />
        array('<span class="example">Gallery name</span>', 'gallery_name', 0),<br />
        array('<span class="example">Gallery description</span>', 'gallery_description', 0),<br />
        array('<span class="example">Gallery administrator email</span>', 'gallery_admin_email', 0),<br />
        array('<span class="example">Target address for the \'See more pictures\' link in e-cards</span>', 'ecards_more_pic_target', 0),<br />
        array('<span class="example">Gallery is offline</span>', 'offline', 1),<br />
        //...</tt></li>
        <li><tt>$lang_register_disclamer = &lt;&lt;&lt;EOT<br />
<span class="example">While the administrators of</span> {SITE_NAME} <span class="example">will attempt to remove or [...]</span><br />
&lt;br /&gt;<br />
<span class="example">By clicking 'I agree' below you agree to be bound by these conditions.</span><br />
EOT;</tt>Var definitions using the <a href="http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc">heredoc</a> syntax: make sure to only translate the plain text, leaving everything in curled braces and all html tags intact</li>
  </ul>
<p>Translate the whole language file as described - you'll quickly find your way around, even if you're not a PHP coder.</p>
</li>
<li>Test your translation: upload your language file to the server and browse you gallery, adding and additional parameter <tt>lang=your_language_name</tt> to the URL (e.g. <tt>http://yoursite.tld/coppermine/?lang=german)</tt>. Make sure to test as many aspects as possible from the file, especially creating, renaming and deleting of users,categories, albums, pictures and comments.</li>
<li>Proof-reading: if you can, let someone else (preferably non-tech user) test your translation as well. You'll be surprised what they will find out...</li>
<li>Send your translation as attachment to <tt>gaugau AT users DOT sourceforge DOT net</tt>. Please make sure to have a proper subject line saying &quot;Coppermine Translation: XXX language file&quot; (I get so much spam these days - if the subject line doesn't look ok for me I might accidentally delete the email without reading it).<br />
You can send the attachment as php file or you can put it inside a .zip archive, but please don't use exotic archive formats like .rar</li>
</ol>

<h2>Special issues</h2>
<h3>Escaping single quotes</h3>
<p>As you may have noted, all translation strings are put into single quotes - this is the proper way in PHP. If you want your translation to actually contain a single quote (apostrophe), you will have to &quot;tell&quot; PHP that the string that was started with a single quot; doesn't end at the next single quote. This is called <i>escaping</i> in programming languages. PHP uses the backslash (<span class="example">\</span>) to escape characters, that's why it must <b>not</b> be
<pre>array('Target address for the 'See more pictures' link in e-cards', 'ecards_more_pic_target', 0),</pre>, but
<pre>array('Target address for the \'See more pictures\' link in e-cards', 'ecards_more_pic_target', 0),</pre></p>
<h3>Single quotes in JavaScript (//js-alert)</h3>
<p>Things get even a bit more complicated if the output will not be only in plain HTML, but in JavaScript, as you have to escape the single quote in JavaScript with a backslash as well. That's why I marked the lines in the language file that will be JavaScript in Coppermine output later with a comment at the end of the line, saying <tt>//js-alert</tt>. If you want to have a single quote in the final output, you'll have to add 3 backslashes in front of the single quote, like in this example: <pre>'no_change' => 'Vous n\\\'avez effectué aucun changement !', //js-alert</pre></p>
<h3>Placeholders with %</h3>
<p>You'll notice that there are some places in the translation where the text contains a percent-sign (<span class="example">%</span>), followed by a letter. Those combinations mustn't be translated - they'll later be used as specifier arguments for some replacement or formating taking place.</p>

<h2>Language versions</h2>
<h3>Found a typo/spelling error?</h3>
<p>Maybe a translation for your language has already been done, but you're not happy with it: if there are bugs (spelling errors etc.), first check the <a href="http://sourceforge.net/project/showfiles.php?group_id=89658&package_id=98540">download section</a> if a fixed version has been done already. If not, report on the board along with your suggestion for a fix, like this:<br />
<i>in lang/yourlanguage.php search for</i>
<pre>  'some_definition' => 'bar foo',</pre>
<i>and replace with</i>
<pre>  'some_definition' => 'foo bar',</pre>
</p>
<h3>Another translation?</h3>
<p>Everybody who knows languages knows that there is no such thing as &quot;one correct translation&quot; - there are always different ways to translate words, or whole sentences. Maybe you feel that an existing version of your language file doesn't fit your purpose; probably the translator had another audience /target group, or you want a more formal translation (in many languages there's as well a difference in grammar between formal and casual speech).<br />
Please do not flame the original translator on the board, but provide an alternative translation along with details on what you changed and for whom your version is intended.</p>

<h2>Work in progress</h2>
<p>Coppermine's a work in progress - as most web-based projects. Maybe your copy of the english.php (that should be the base for your translation) is outdated. That's why it's recommended that you always take a look at the <a href="http://sourceforge.net/project/showfiles.php?group_id=89658&package_id=98540">download section</a> and get the most recent english language file (translator version) available before starting your translation (and maybe and updated version of this document as well, since there may be questions turning up later, after initial release of this document). Remember: if an option is not translated, it won't be visible in your language at all.</p>

<h2>Initial translation for release</h2>
<p>When preparing for a release, the dev team sets up a feature freeze to allow the translators to submit their translations, halting the coppermine development during that period. If you're willing to translate, do so as soon as possible and send your translation back immediately to ensure that the new version of coppermine can be released <b>with</b> your language file.</p>
<br />&nbsp;<br />&nbsp;<br />

GauGau (aka Joachim M&uuml;ller)<br />
- Coppermine dev team -


</td></tr></tbody></table>
</body></html>