Difference between revisions of "Translations"

From SME Server
Jump to navigationJump to search
m (draft)
Line 23: Line 23:
 
These changes are tracked in the  
 
These changes are tracked in the  
 
[http://bugs.contribs.org/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&product=SME+Server+Translations&long_desc_type=substring&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailqa_contact2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Bug+Number&field0-0-0=noop&type0-0-0=noop&value0-0-0=  Bug Tracker,] please add updated translations at each bug if you can.
 
[http://bugs.contribs.org/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&product=SME+Server+Translations&long_desc_type=substring&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailqa_contact2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Bug+Number&field0-0-0=noop&type0-0-0=noop&value0-0-0=  Bug Tracker,] please add updated translations at each bug if you can.
 +
 +
===Translating a panel===
 +
The goal of this howto is to create a translation for a given language of an existing panel in the server-manager.
 +
 +
See this [http://forums.contribs.org/index.php?topic=30780 topic] for detailled instructions.
 +
 +
====Locate needed files====
 +
Translating a panel is really easy, here are paths to files:
 +
/etc/e-smith/web/functions                          => Original files ('''do not modify any of these files!''')
 +
/etc/e-smith/locale/de/etc/e-smith/web/functions    => German  translations path
 +
/etc/e-smith/locale/en-us/etc/e-smith/web/functions => English translations path
 +
/etc/e-smith/locale/es/etc/e-smith/web/functions    => Spanish translations path
 +
/etc/e-smith/locale/fr/etc/e-smith/web/functions    => French  translations path
 +
/etc/e-smith/locale/it/etc/e-smith/web/functions    => Italian translations path
 +
/etc/e-smith/locale/sv/etc/e-smith/web/functions    => Swedish translations path
 +
Usually, panels have a user-friendly name. Check if a translation hasn't been started, else if the panel translation doesn't exist in your language path, simply copy the file from the English path and start to translate this new file!
 +
You will have to translate the content of text between '''<trans>''' and '''</trans>'''
 +
 +
====Apply changes====
 +
For changes to take effects, you will have to issue the following command:
 +
/etc/e-smith/events/actions/navigation-conf
 +
Now open your web browser at https://yourserver/server-manager and see your own modifications!
 +
 +
====Share your work====
 +
See this [http://wiki.contribs.org/Package_Modification article] to learn how to help modifying existing contribs.
 +
Then create a bug report and attach the patched file.
 +
 +
====Tips & Tricks====
 +
=====Limitations=====
 +
Panels not using formmagik can't be translated... However there is still a quick fix to change the panel name in the server-manager.
 +
 +
Let's take a look at AWStats and try to translate the panel name to French as an example:
 +
 +
Open the default file '''''/etc/e-smith/web/functions/awstats''''' and take a look on the first lines. You should see what is needed to change:
 +
# heading    : Administration => in which submenu the panel is put
 +
# description : Web statistics => display the panel name
 +
# navigation  : 4000 4350      => Not needed here, used for panel order
 +
create a file called '''''awstats''''' in '''''/etc/e-smith/locale/fr/etc/e-smith/web/functions/''''' with the following content:
 +
<lexicon lang="fr">
 +
    <entry>
 +
        <base>Administration</base>
 +
        <trans>Administration</trans>
 +
    </entry>
 +
    <entry>
 +
        <base>Web statistics</base>
 +
        <trans>Statistiques Web</trans>
 +
    </entry>
 +
</lexicon>
 +
And finally, apply changes with the following command:
 +
/etc/e-smith/events/actions/navigation-conf
 +
 +
=====Duplicate menus=====
 +
You may see some duplicate menus in the server-manager. This is a Formmagick related known problem.
 +
See this [http://bugs.contribs.org/show_bug.cgi?id=2734 bug] for more details.
 +
Still using FR and AWStats as an example... Simply modify original file to:
 +
<lexicon lang="fr">
 +
    <entry>
 +
        <base>Administration</base>
 +
        <trans>\n      Administration\n    </trans>
 +
    </entry>
 +
    <entry>
 +
        <base>Web statistics</base>
 +
        <trans>Statistiques Web</trans>
 +
    </entry>
 +
</lexicon>
 +
(\n and 6 spaces, then \n and 4 spaces)
 +
Apply and test.
  
 
===Contribs Translations===
 
===Contribs Translations===
Line 65: Line 132:
 
http://forums.contribs.org/index.php?topic=30780.0
 
http://forums.contribs.org/index.php?topic=30780.0
  
====Menus with non FormMagick contribs====
 
There is a workaround to translate just the menu category and heading.
 
 
create a locale file
 
nano /etc/e-smith/locale/fr/etc/e-smith/web/functions/userpanelaccess
 
<lexicon lang="fr">
 
    <entry>
 
        <base>Security</base>
 
        <trans>\n      Sécurité\n    </trans>
 
    </entry>
 
    <entry>
 
        <base>User Panel Access</base>
 
        <trans>Panneaux Utilisateurs</trans>
 
    </entry>
 
</lexicon>
 
 
regenerate the menus
 
/etc/e-smith/events/actions/navigation-conf
 
  
And email the locale file to the contrib maintainer for the next release
+
[[Category:Howto]]

Revision as of 23:31, 27 December 2007

Translations

SME Server Supports English, French, German, Spanish, Italian and Swedish.

Other Languages are in progress [Bug tracker - translations]

Adding new Languages

There is one file per server-manager panel, plus a few others.

To translate to another language

  • Raise a bug in the bug tracker to let us know you're starting or add to a work in progress
  • Refer to these forum posts

http://forums.contribs.org/index.php?topic=30780.0

http://forums.contribs.org/index.php?topic=29298.0

Maintaining Existing Languages

Ongoing updates to SME Server occasionally modify panel text and this requires updating of the translations.

These changes are tracked in the Bug Tracker, please add updated translations at each bug if you can.

Translating a panel

The goal of this howto is to create a translation for a given language of an existing panel in the server-manager.

See this topic for detailled instructions.

Locate needed files

Translating a panel is really easy, here are paths to files:

/etc/e-smith/web/functions                          => Original files (do not modify any of these files!)
/etc/e-smith/locale/de/etc/e-smith/web/functions    => German  translations path
/etc/e-smith/locale/en-us/etc/e-smith/web/functions => English translations path
/etc/e-smith/locale/es/etc/e-smith/web/functions    => Spanish translations path
/etc/e-smith/locale/fr/etc/e-smith/web/functions    => French  translations path
/etc/e-smith/locale/it/etc/e-smith/web/functions    => Italian translations path
/etc/e-smith/locale/sv/etc/e-smith/web/functions    => Swedish translations path

Usually, panels have a user-friendly name. Check if a translation hasn't been started, else if the panel translation doesn't exist in your language path, simply copy the file from the English path and start to translate this new file! You will have to translate the content of text between <trans> and </trans>

Apply changes

For changes to take effects, you will have to issue the following command:

/etc/e-smith/events/actions/navigation-conf

Now open your web browser at https://yourserver/server-manager and see your own modifications!

Share your work

See this article to learn how to help modifying existing contribs. Then create a bug report and attach the patched file.

Tips & Tricks

Limitations

Panels not using formmagik can't be translated... However there is still a quick fix to change the panel name in the server-manager.

Let's take a look at AWStats and try to translate the panel name to French as an example:

Open the default file /etc/e-smith/web/functions/awstats and take a look on the first lines. You should see what is needed to change:

# heading     : Administration => in which submenu the panel is put
# description : Web statistics => display the panel name
# navigation  : 4000 4350      => Not needed here, used for panel order

create a file called awstats in /etc/e-smith/locale/fr/etc/e-smith/web/functions/ with the following content:

<lexicon lang="fr">
   <entry>
       <base>Administration</base>
       <trans>Administration</trans>
   </entry>
   <entry>
       <base>Web statistics</base>
       <trans>Statistiques Web</trans>
   </entry>
</lexicon>

And finally, apply changes with the following command:

/etc/e-smith/events/actions/navigation-conf
Duplicate menus

You may see some duplicate menus in the server-manager. This is a Formmagick related known problem. See this bug for more details. Still using FR and AWStats as an example... Simply modify original file to:

<lexicon lang="fr">
   <entry>
       <base>Administration</base>
       <trans>\n      Administration\n    </trans>
   </entry>
   <entry>
       <base>Web statistics</base>
       <trans>Statistiques Web</trans>
   </entry>
</lexicon>

(\n and 6 spaces, then \n and 4 spaces) Apply and test.

Contribs Translations

Contribs that are not written with FormMagick cannot be easily translated.

smeserver-userpanel        not FormMagick

smeserver-userpanels 
- forwarding               fr, de, es*, it*, sv
- password                 fr, de, es, it, sv
- useraccounts/backup      not FormMagick

smeserver-vacation         fr, de, es

smeserver-mailsorting      fr, de, es

smeserver-remoteuseraccess fr, de, es, sv

if a language is shown the translation is finished
* means the translation is incomplete

** This table may not be current, email the rpm maintainer with updates, check first

To translate download the contrib rpm

either install and look in the locale dir

/etc/e-smith/locale/en-us/etc/e-smith/web/functions [original]

/etc/e-smith/locale/de/etc/e-smith/web/functions
/etc/e-smith/locale/es/etc/e-smith/web/functions
/etc/e-smith/locale/fr/etc/e-smith/web/functions
/etc/e-smith/locale/it/etc/e-smith/web/functions
/etc/e-smith/locale/sv/etc/e-smith/web/functions

or open the noarch.rpm or src.rpm, eg. with http://www.7-zip.org/ to get the locale file

choose a source language make a copy and overtype the translations

for a more detailed explanation see http://forums.contribs.org/index.php?topic=30780.0