Surgeweb now has extensive multilanguage support throughout the interface (as of surgemail version 4.2g-22+) to customise the interface for both for English and non English languages. Most of the strings displayed in the surgeweb interface can now be translated or customised (with a few exceptions for now, as noted later on).
Surgeweb language translation features are similar to the language translation capabilities of the other surgemail web interfaces, but are notably different in a few areas.
The surgeweb template files contain placeholder strings along the lines of $$st_cmd_reply$$ which are string table lookup entries that get replaced with the actual textual representation before getting served to the web browser. So in the case of the Reply button, this would be replaced with "Reply" in English or with the string "Antworten" if German was selected.
<input type=button value="$$st_cmd_reply$$">
# note1: Any line staring with a # is a comment # note2: lang*.dat files need to be UTF8 encoded # Language definition of the way languages get displayed in the interface # - both the english name and the native display name # - type of translation: *=full translation, # o/+=partial sample translation (under dropdown/more...) # -=hide interface # Here English is a full translation and german and spanish demo translations lang:*:English:English (UK) lang:o:German:Deutsch lang:+:Spanish:Español # ----------------- lang:English # ----------------- # Strings to add to English, individual strings can be added to alternate languages st_username Username st_password Password st_cmd_reply Reply German: Antworten st_cmd_forward Forward # Generally alternate languages are listed as complete standalone tables, # possibly in their own files. "lang:" must match a full lang line at top of file. # ----------------- lang:Spanish # ----------------- st_username Nombre de usuario st_password Contraseña st_cmd_reply Responder st_cmd_forward Reenviar
These surgeweb string tables are defined using the sum total of lang*.dat files in the surgemail/surgeweb/tpl and the surgemail/surgeweb/custom directories. Language tables in the tpl directory is loaded first, and this is overwritten by any customisation as defined in the custom directory. This allows you to implement full translations, or modify any terms or full translations as supplied with surgeweb. Anything in the tpl directory will be replaced on surgeweb upgrades, none of the language files in the custom directory will be touched during surgemail upgrades.
Some other important things to know:
If you are interested in supplying us with a translation of a non english languages we would be very keen to hear from you :-)
Search through tpl/lang.dat to find the phrase(es) in question.
eg. Change "Loading SurgeWeb email ... step n of 3" whilst logging in to "Please wait :-)"
st_loading_init Loading SurgeWeb email ... st_loading_usr Loading SurgeWeb email for %s@%s ... st_loading_step step %s of %sand add that to an appropriate custom/lang.dat file: (note: add to blank out phrases)
# ----------------- lang:English # ----------------- st_loading_init Please wait :-) st_loading_usr Please wait :-) st_loading_step
lang_no_demo true
Open tpl/lang.dat and copy just the strings you want to translate or the whole table and copy to custom/lang.dat or say custom/lang_german.dat. Translate all phrases you wish nationalised. Any phrases not translated will get displayed in surgeweb as default English UK. Also at the top add a lang line with 'o'/'+' converted to '*'. This means surgeweb will treat this language a full translation rather than a partial demo translations.
eg. in the case German:
lang:*:German:Deutsch # ----------------- lang:German # ----------------- st_username Nutzername st_password Passwort st_log_in Anmelden ... etc
Copy the "lang lines" from tpl/lang.dat to custom/lang.dat and change the 'o' or '+' to '-'.
eg. to remove Chinese and Japanese:
lang:-:Chinese 1:中文(繁體) lang:-:Chinese 2:中文(简体) lang:-:Japanese:日本語
To change the default language you can use the English language text description (as per lang*.dat files) in the surgemail.ini (g_)language_default settings.
eg. to switch to US English default:
g_language_default "English US"or Japanese
g_language_default "Japanese"Note: The laguage selection default is cookie based, and will not apply to users that have already connected to surgeweb unless they clear the cookies in their browser cache.
So far most of the phrases (approx 800) that have always been defined in the surgeweb templates are now customisable this way.
As noted earlier, for now there are several exceptions, which I will be adding to the language translation capabilities in the near future. These include:
Surgeweb language translation files, as contributed by customers.